How to use the random number generator
- Enter the smallest and largest number you want. Both are included.
- Choose how many numbers to pick, up to 1,000 at once.
- Tick No repeats for all-different numbers, or untick it to allow duplicates.
- Press Generate, then copy the results if you need them.
Popular ranges
Open a ready-made generator: 1–21–31–41–51–61–81–101–121–201–501–521–1001–10000–9
- 1 to 6: roll a die.
- 1 to 10 or 1 to 100: guessing games and quick picks.
- 1 to 49, six numbers, no repeats: many national lotteries.
- 1 to the number of participants: raffle ticket draws.
Settings for common jobs
| Job | Min | Max | How many | No repeats |
|---|---|---|---|---|
| Roll one die | 1 | 6 | 1 | Either |
| Roll two dice | 1 | 6 | 2 | Off |
| Draw 3 raffle winners from 250 tickets | 1 | 250 | 3 | On |
| Shuffle a class of 30 into a running order | 1 | 30 | 30 | On |
| Make a 4-digit PIN | 0 | 9 | 4 | Off |
| Sample 20 rows from a 1,500-row sheet | 2 | 1501 | 20 | On |
The last row starts at 2 for a sheet whose row 1 holds column headings. Tick Sort results for jobs like that one, so you can work down the sheet in order instead of jumping around.
Lottery-style picks
For a game that draws 5 numbers from 1 to 69 and a bonus ball from 1 to 26, generate the main numbers first (1 to 69, five numbers, No repeats) and then the bonus ball on its own (1 to 26, one number). Two separate draws keep the bonus ball independent of the main numbers, so it can match one of them.
The odds of matching all six come straight from the arithmetic: 11,238,513 sets of five main numbers, times 26 bonus balls, is 1 in 292,201,338. Every combination has exactly that chance, including 1, 2, 3, 4, 5, so random numbers win no more and no less often than numbers you choose yourself.
For draws without a bonus ball, the odds of matching every number depend only on how many are drawn and from how big a pool:
| Draw | Possible combinations | Chance of matching all |
|---|---|---|
| 3 from 1–20 | 1,140 | 1 in 1,140 |
| 5 from 1–35 | 324,632 | 1 in 324,632 |
| 6 from 1–49 | 13,983,816 | 1 in 13,983,816 |
| 5 from 1–69 | 11,238,513 | 1 in 11,238,513 |
| 7 from 1–50 | 99,884,400 | 1 in 99,884,400 |
The number of balls drawn matters more than the size of the pool. Six from 1–49 has 13,983,816 combinations, more than the 11,238,513 of five from 1–69, even though that pool is bigger.
Odds of a single number in common ranges
Every number in a range has the same chance, so the odds only depend on how many numbers the range holds.
| Range | Possible numbers | Chance of one number |
|---|---|---|
| 1–2 | 2 | 1 in 2 (50.0%) |
| 1–3 | 3 | 1 in 3 (33.3%) |
| 1–4 | 4 | 1 in 4 (25.0%) |
| 1–5 | 5 | 1 in 5 (20.0%) |
| 1–6 | 6 | 1 in 6 (16.7%) |
| 1–8 | 8 | 1 in 8 (12.5%) |
| 1–10 | 10 | 1 in 10 (10.0%) |
| 1–12 | 12 | 1 in 12 (8.3%) |
| 1–20 | 20 | 1 in 20 (5.0%) |
| 1–50 | 50 | 1 in 50 (2.0%) |
| 1–52 | 52 | 1 in 52 (1.9%) |
| 1–100 | 100 | 1 in 100 (1.0%) |
| 1–1000 | 1,000 | 1 in 1,000 (0.10%) |
| 0–9 | 10 | 1 in 10 (10.0%) |
Repeats allowed or no repeats?
Leave No repeats ticked when you're drawing from a fixed pool: raffle tickets, lottery numbers, a running order or a sample of rows. Each number can then appear once, and you can't ask for more numbers than the range holds. With 1 to 50, for example, the most you can draw is 50, which gives you the whole range in a random order.
Untick it when each pick should be independent, like rolling a die several times. Two rolls of a die can both land on 4, and so can two numbers here. Repeats turn up more often than people expect: pick 5 numbers from 1 to 10 with repeats allowed and there's a 69.8% chance at least two of them match.
| Range | 3 picks | 5 picks | 10 picks | 20 picks |
|---|---|---|---|---|
| 1–10 | 28.0% | 69.8% | 99.96% | over 99.99% |
| 1–20 | 14.5% | 41.9% | 93.5% | over 99.99% |
| 1–50 | 5.9% | 18.6% | 61.8% | 98.8% |
| 1–100 | 3.0% | 9.7% | 37.2% | 87.0% |
| 1–1,000 | 0.30% | 1.00% | 4.4% | 17.4% |
Each cell is the chance of at least one repeat with repeats allowed. Even 20 picks from 1 to 1,000 repeat 17.4% of the time, so tick No repeats whenever a duplicate would spoil the result.
Negative numbers, decimals and big ranges
- Negative numbers work: a range of −10 to 10 has 21 possible results, including 0.
- Decimals aren't generated directly. For one decimal place between 0 and 1, pick from 0 to 10 and divide by 10; for two places, pick from 0 to 100 and divide by 100.
- Large ranges are fine up to about 4.29 billion possible numbers, the size of the 32-bit random values the generator draws.
- Results aren't saved. Copy them before you generate again if you need a record.
Why the numbers are fair
Many simple generators use a shortcut that makes some numbers slightly more likely than others. Picture a random source with 256 possible values and a range of 1 to 100. Taking the remainder after dividing by 100 gives 56 of the numbers three chances each and the other 44 only two, so those 56 come up 50% more often.
This generator uses rejection sampling instead. It draws 32-bit values from your browser's cryptographic random source (the Web Crypto API), throws away the few leftover values that would cause that bias, and draws again. Every number in your range then has precisely the same probability. It's fair for games, classrooms and giveaways, but it isn't a certified source for official lotteries or legal draws.