About the Random Number Generator
The Random Number Generator picks numbers that are truly fair: whole numbers or decimals in any range, many at once, with or without repeats. It also rolls dice, draws lottery-style numbers, flips coins and picks winners from a list of names or options.
Use it for raffles and giveaways, choosing a random sample, assigning groups or turns, games and tabletop role-playing, classroom activities, test data, or settling where to eat tonight. Every result comes with a copy and download option, so you can keep a record of the draw.
The numbers come from your browser's cryptographically secure random generator (crypto.getRandomValues), not from the predictable Math.random function. Every value in the range is equally likely, and nothing is sent to a server.
How to use it
- Choose a modeWhole numbers, Decimals, Dice, Lottery, Pick from a list or Coin flip.
- Set the range or optionsEnter From and To and how many results you want, or the number of dice, the lottery format, your list of items or the number of flips.
- Add rules if neededFor whole numbers, tick No repeats to get distinct values and Sort the results to list them from low to high.
- GeneratePress Generate. Each press gives a new, independent result.
- Copy or saveCopy the results or download them as a text file, one result per line.
Key features
Secure and unbiased
Uses the Web Crypto random generator with rejection sampling, so no number is even slightly more likely than another.
Huge ranges
Whole numbers anywhere between about -9 quadrillion and 9 quadrillion (the largest exact integers in JavaScript), up to 10,000 at a time.
No repeats when you need it
Draw distinct numbers, like raffle tickets, with a clear message if you ask for more numbers than the range holds.
Dice notation
Roll up to 100 dice with 4, 6, 8, 10, 12, 20 or 100 sides, add a modifier, and see every die as well as the total.
Lottery and list picks
Main numbers plus optional bonus balls from a separate pool, or a fair pick of names from your own list.
Sum and average
For several numbers, the sum and average are shown under the results.
Examples
Is it fair?
In one test, 10,000 whole numbers from 1 to 6 came out like this:
| Number | Times drawn |
|---|---|
| 1 | 1,668 |
| 2 | 1,708 |
| 3 | 1,657 |
| 4 | 1,688 |
| 5 | 1,668 |
| 6 | 1,611 |
The expected count is about 1,667 each, and differences of a few dozen are normal chance. The average was 3.4813, close to the theoretical 3.5. Your own run will give different numbers, which is the point.
Dice
| Setting | Example result | Possible totals |
|---|---|---|
| 3 dice, D6, add 2 | 10, from 2 + 3 + 3 + 2 | 5 to 20 |
| 1 die, D20, add -1 | 13, from 14 − 1 | 0 to 19 |
Copy gives the individual dice and the total, such as 2, 3, 3 + 2 = 10, handy for game logs.
Lottery-style draws
The default draws 5 numbers from 1 to 69 plus 1 bonus number from 1 to 26, the format Powerball uses, for example 10 16 21 51 66 + 13. Main numbers never repeat and are sorted. There are 292,201,338 possible combinations in that format, and no generator makes any of them more likely to win.
Rules that are enforced
| You ask for | Result |
|---|---|
| 7 numbers from 1 to 6, no repeats | Only 6 different numbers exist between 1 and 6. |
| From 10 to 1 | Read as 1 to 10 |
| Whole numbers from 0.5 to 3.5 | Read as 1 to 3 |
| To 1e20 | Too large for exact whole numbers; the tool asks for a smaller range |
Tips
- For a raffle, number the tickets, set the range to match, tick No repeats and set How many to the number of prizes. Then screenshot or download the result.
- To pick names, use Pick from a list instead of numbering people. Each name is equally likely, and the same name is never picked twice in one draw.
- For a random order, such as speaking turns, paste the list and set How many to the full number of items. The result is a fair shuffle.
- Need a random decimal for a simulation? Use Decimals and choose the number of decimal places, up to 10.
- For passwords and secret keys, use the Password Generator, which is built for that job.
Common mistakes and limits
- Thinking a number is "due"Each draw is independent. After five tails in a row, the next flip is still exactly 50/50.
- Expecting perfectly even countsRandom results clump. 468 heads and 532 tails in 1,000 flips is ordinary. Perfectly even counts would be suspicious.
- Using it to beat the lotteryNo method predicts lottery numbers. A random pick only spares you from choosing popular combinations like birthdays.
- Rounding decimals into a rangeWhen decimals are rounded to the places you choose, the To value itself can appear. Set the range slightly lower if the upper limit must be excluded.
- Re-rolling until you like itPressing Generate again until a favorite wins defeats the purpose. Decide in advance that the first result counts.