Random Number Generator
Pick one or more random whole numbers between any two numbers, with or without repeats. Every number in the range has exactly the same chance.
Both ends can come up.
Up to 1,000 at a time.
Random number from 1 to 100
–
| Range | 1 to 100 |
|---|---|
| Whole numbers in the range | 100 |
| Chance of each number1% | 1 in 100 |
How this is calculated
The numbers come from crypto.getRandomValues, the cryptographically strong random generator built into your browser. They are drawn on your device, nothing is sent to us, and Math.random is never used.
Fair, without modulo bias
The generator delivers a random 32-bit number, one of 4,294,967,296 equally likely values. The quick way to turn that into a number from 1 to 100 is to take the remainder after dividing by 100. But 4,294,967,296 is not a multiple of 100: it leaves 96 values over, so the numbers 1 to 96 would come up a tiny bit more often than 97 to 100. This is called modulo bias.
The calculator avoids it by rejection: it throws away those last 96 values and draws again. What is left divides evenly by 100, so each number from 1 to 100 is exactly as likely as any other. The same happens for any range.
With or without repeats
With repeats allowed, every pick is independent: after a 7, the next pick is just as likely to be 7 again. With no repeats, the calculator shuffles the range (a Fisher–Yates shuffle) and takes the first numbers, or, for ranges over 100,000 numbers, keeps drawing and skips numbers it already has. Both give every set of numbers the same chance. For 5 numbers from 1 to 69 without repeats, each number has a 5 in 69 chance of being among them.
Both ends count: from 1 to 10 you can get 1 and 10. Decimal bounds are rounded inward to whole numbers. The generator draws up to 1,000 numbers at a time from a range of up to 4,294,967,296 numbers. For an official drawing, follow the rules that apply to it.
Questions people ask
Is this random number generator truly random?
It uses crypto.getRandomValues, the cryptographically strong generator in your browser, and rejects uneven values so there is no modulo bias. Every number in the range is equally likely, and the next number cannot practically be predicted from earlier ones.
How do I pick a random number between 1 and 10?
Enter 1 as the smallest and 10 as the largest number and leave “How many numbers?” at 1. Each number from 1 to 10 has a 1 in 10 chance.
How do I draw lottery-style numbers?
Set the range of your game, the count of numbers and choose No repeats. For 5 numbers from 1 to 69, each number has a 5 in 69 chance of being among them.
Can the same number come up twice?
Only if you choose Repeats allowed. With No repeats each number appears at most once, so you cannot ask for more numbers than the range holds.
Why did I get the same number twice in a row?
Each draw is independent of the last. From 1 to 10, the chance that the next number matches the previous one is 1 in 10.