A random number generator picks a whole number from a range you choose, with every number in that range equally likely. Use it to pick a number from 1 to 10, draw up to 500 different numbers for a raffle, or make a set of lottery-style numbers.
How to use the random number generator
Type the lowest number you want in From and the highest in To. Both ends count, so 1 to 10 can give 1, 10, or anything in between. The line under the result tells you the chance of each number, such as 1 in 100 (1%) for the range 1 to 100.
Next, choose how many numbers you want, from 1 to 500, with the plus and minus buttons or by typing the amount. Then press Generate, tap the big number, or press Enter in one of the boxes. A single number rolls through a few values for a moment before it lands. Several numbers appear one after another.
Ranges and limits: negative, huge, and swapped numbers
Any whole numbers work, including negative ones, from −9,007,199,254,740,991 up to 9,007,199,254,740,991. That's the largest whole number a browser can store exactly. A single range can hold up to 9,007,199,254,740,992 numbers, about 9 quadrillion, so 0 to 9,007,199,254,740,991 works, but the full span from the most negative number to the most positive is too wide.
You don't need to be tidy when you type. Spaces, commas, and underscores are ignored, so 1,000,000 and 1 000 000 both work. Decimals aren't accepted, because the generator only picks whole numbers. If From is bigger than To, the two are swapped for you and the result says so.
No repeats, or repeats allowed
With No repeats on, every number in one draw is different, as if each one were taken out of a hat and kept out. That suits raffles, seating plans, and picking students by number. You can't ask for more numbers than the range holds: 11 different numbers from 1 to 10 isn't possible, and the generator tells you so.
Switch it off when each number should be a separate draw, like rolling a die again and again. Then any number can turn up more than once, and every draw gives every number the same chance, whatever came before. The next draw starts fresh either way: No repeats only applies within one draw.
Lottery numbers, dice, and other quick ranges
The quick ranges set up common draws in one tap:
- 1 to 10, 1 to 100, and 1 to 1,000 for everyday picks.
- Dice (1 to 6) gives one number, like a single die. For several dice with totals and a chart, roll a die instead.
- 6 of 49 draws six different numbers from 1 to 49 and sorts them, the shape of many lotteries. There are 13,983,816 possible sets, and each is equally likely.
No generator can make a lottery ticket more likely to win. Every set of six has the same 1 in 13,983,816 chance of matching a 6 of 49 draw, including the sets that look like patterns.
Is this random number generator fair?
Yes. Each number starts as a raw 32-bit value from your browser's cryptographic generator, the kind built for making encryption keys. Turning that into 1 to 100 with a plain remainder would favor 1 to 96 very slightly, because 4,294,967,296 isn't a multiple of 100: 2^32 mod 100 = 96. So those top 96 raw values are thrown away and redrawn whenever they come up, a method called rejection sampling, and every number from 1 to 100 ends up with exactly the same chance. The 1 to 1,000 range throws back 296 values, and ranges wider than about 4.3 billion use 53 random bits the same way.
No repeats uses a Fisher–Yates shuffle on just the part of the range it needs, so every set of numbers, and every order, is equally likely. In a 6 of 49 draw, the first number is one of 49, with 39 leftover raw values set aside, then one of the 48 left, and so on. All numbers are decided the moment you press Generate. The digits that flash for about two-thirds of a second before a single number lands are only for show.
Sorting, sums, averages, and copying
When you draw several numbers, the result line lists them with their sum and average. Turn on Sort the results to show them from smallest to largest; leave it off to see them in the order they were drawn, which matters for a prize draw. Over many draws, the average settles near the middle of the range: 5.5 for 1 to 10 and 50.5 for 1 to 100.
The copy button puts the numbers on your clipboard as plain digits separated by commas, ready for a spreadsheet, a chat, or a document. Recent numbers keeps your last 20 draws with their ranges, newest first, and Clear empties it.
Why random numbers repeat: the birthday problem
People expect repeats to be rare, but they turn up fast. Draw 13 numbers from 1 to 100 with repeats allowed and there's a 55.7% chance that at least two are the same. It's the same math as the birthday problem: in a group of just 23 people, the chance that two share a birthday is 50.7%.
The flip side is that some numbers stay away for a long time. Draw 100 numbers from 1 to 100 and each number has a 36.6% chance of never coming up, so on average about 37 of the hundred don't appear at all. Gaps and clusters like these are what randomness looks like.
Uses in class, in games, and for seating
Teachers use it to call on students by class number, pick a page to read, or make quick practice sums. It also settles who goes first in a game, chooses a winning raffle ticket, assigns seats or teams, and picks a random line from a numbered list. For a list of names rather than numbers, the random name picker does the same job with a wheel.
Tap, type, or press G
The big number doubles as a button, so on a phone one tap draws again, and on a computer you never need to leave the keyboard:
- Touch or mouse: tap the big number or the Generate button, and use the plus and minus buttons to change the count.
- Keyboard: press Enter in any box, or press Space, Enter, or G while the generator is on screen.
- Screen readers: the buttons have labels, and each result, with its range, sum, and average, is announced.
With reduced motion turned on, a single number appears without its roll. When From equals To there's nothing to roll, so that number shows at once too.
A short history of random numbers
Before computers, people who needed random numbers looked them up. In 1927 the statistician L. H. C. Tippett published a table of 41,600 random digits, the first of its kind. In 1955 the RAND Corporation published A Million Random Digits with 100,000 Normal Deviates, made with an electronic roulette wheel. In 1938 Ronald Fisher and Frank Yates described the shuffle that computers still use to put things in a random order.
What the generator remembers
There's no account to create. The page needs a connection to load, but the numbers are drawn in your browser and aren't sent to a server. Your range, count, No repeats and Sort settings, and last 20 draws are kept in this browser's local storage for next time, as the privacy policy explains. Clear next to Recent numbers removes the saved draws.