Random Number Generator
Set a range, choose how many numbers, and generate — with cryptographic randomness.
How to use
- Set the minimum and maximum of your range (both included).
- Choose how many numbers to generate, and whether the same number may appear twice.
- Press Generate. Press again any time for a fresh set.
Examples
Dice roll
Min 1, max 6, count 1 — a fair six-sided die. Set count to 2 for a pair of dice.
Lottery numbers
Min 1, max 45, count 6 with duplicates off gives six distinct lotto-style numbers.
Random PIN candidates
Min 0, max 9, count 4 with duplicates on produces four digits you can join into a PIN.
Drawing lottery-style numbers
Six numbers from 1 to 45 with duplicates off is the Korean lotto format. Turning duplicates off is what makes it a draw rather than six independent rolls — with duplicates on, the same number can appear twice, which is correct for dice but wrong for a draw from a pool.
Picking a winner from numbered entries
If entries are numbered 1 to 340, one number in that range picks the winner without needing the list itself. Drawing a few extra numbers at once gives you backups in order, which saves rerunning the draw when the first pick does not respond.
Sampling rows for a spot check
To audit 20 records out of 1,200, draw 20 numbers from 1 to 1,200 with duplicates off and check those row numbers. Choosing rows by eye is not sampling — people reliably avoid the top, the bottom and anything that looks unusual, which is exactly where problems hide.
FAQ
How random are the numbers?
They come from the browser’s cryptographic random generator (crypto.getRandomValues) with rejection sampling, so every value in the range has an exactly equal chance — better than the typical Math.random() approach.
Are min and max included in the results?
Yes, the range is inclusive on both ends: 1 to 10 can produce both 1 and 10.
What does “allow duplicates” change?
With duplicates on, every draw is independent (like rolling a die repeatedly). With duplicates off, numbers are drawn without replacement (like lottery balls) — so the count cannot exceed the size of the range.
Can I use negative numbers?
Yes. Any whole-number range works, for example −50 to 50.
Can I reproduce the same set of numbers later?
No. The generator uses the browser cryptographic random source, which has no seed you can set, so a draw cannot be repeated. That is the right property for a fair draw and the wrong one for a reproducible simulation. If you need repeatability, record the result rather than trying to regenerate it.
Is every number equally likely?
Yes, within the range you set. Each draw is uniform over the inclusive range, and turning duplicates off removes each drawn number from the pool so the remaining numbers stay equally likely among themselves. There is no weighting, no memory of previous draws and no adjustment for numbers that have not appeared.
Why does a truly random draw look clustered?
Because uniform randomness produces clumps and gaps far more often than people expect. Runs of nearby numbers, or a range with nothing in it, are normal in a small draw and are not evidence of a problem. A result that looks evenly spread out is actually the less likely outcome.