Home › Math › Random Number Generator
Random Number Generator
Pick a range and how many numbers you want. Every number in the range has an equal chance, endpoints included. Use the presets for a die roll or a lottery-style draw.
For fun, games and classroom draws. Not suitable for gambling, official lotteries, or cryptography — see the FAQ.
How it works
Each number is drawn with the formula floor(random × (maximum − minimum + 1)) + minimum, where random is a value from 0 up to (but not including) 1. The +1 is what makes both endpoints possible: without it the maximum could never appear. With "no repeats" on, a number already drawn is discarded and drawn again until the set is full — so asking for more unique numbers than the range holds is impossible, and the tool says so instead of hanging. Worked example: for the range 1–100, a random value of 0.3742 gives floor(0.3742 × 100) + 1 = floor(37.42) + 1 = 37 + 1 = 38. Every integer from 1 to 100 has the same 1-in-100 chance on each draw.
Frequently asked questions
Are the endpoints included?
Yes — both the minimum and the maximum can be drawn. That is the most common surprise with random generators, so this one is explicit about it.
What does 'no repeats' do?
It draws without replacement: each number can appear only once, like balls drawn from a bag. It is what lottery-style draws and raffle winners need.
Is this random enough for a lottery or a raffle?
For a classroom draw, a game, or picking a winner among friends, yes. For money, official lotteries, or security, no — browsers use a pseudo-random generator that is not cryptographically secure and not audited.
Can I generate numbers in a negative range?
Yes — enter, for example, -10 to 10. The formula works the same way, and zero is a possible result.
Why did I get the same number twice?
With repeats allowed, each draw is independent: drawing a 7 does not make the next 7 any less likely. That is how dice work, and why a run of repeats is normal.