Random Number Generator

Pick one or many random numbers between any two whole numbers. Choose whether numbers can repeat, and sort the results if you like.

How to use the random number generator

  1. Enter the smallest and largest number you want. Both are included.
  2. Choose how many numbers to pick, up to 1,000 at once.
  3. Tick No repeats for all-different numbers, or untick it to allow duplicates.
  4. 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

Settings for common jobs

JobMinMaxHow manyNo repeats
Roll one die161Either
Roll two dice162Off
Draw 3 raffle winners from 250 tickets12503On
Shuffle a class of 30 into a running order13030On
Make a 4-digit PIN094Off
Sample 20 rows from a 1,500-row sheet2150120On

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:

DrawPossible combinationsChance of matching all
3 from 1–201,1401 in 1,140
5 from 1–35324,6321 in 324,632
6 from 1–4913,983,8161 in 13,983,816
5 from 1–6911,238,5131 in 11,238,513
7 from 1–5099,884,4001 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.

RangePossible numbersChance of one number
1–221 in 2 (50.0%)
1–331 in 3 (33.3%)
1–441 in 4 (25.0%)
1–551 in 5 (20.0%)
1–661 in 6 (16.7%)
1–881 in 8 (12.5%)
1–10101 in 10 (10.0%)
1–12121 in 12 (8.3%)
1–20201 in 20 (5.0%)
1–50501 in 50 (2.0%)
1–52521 in 52 (1.9%)
1–1001001 in 100 (1.0%)
1–10001,0001 in 1,000 (0.10%)
0–9101 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.

Range3 picks5 picks10 picks20 picks
1–1028.0%69.8%99.96%over 99.99%
1–2014.5%41.9%93.5%over 99.99%
1–505.9%18.6%61.8%98.8%
1–1003.0%9.7%37.2%87.0%
1–1,0000.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

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.

Frequently asked questions

How do I pick a random number between 1 and 10?

Set the minimum to 1 and the maximum to 10, then press Generate. Both ends are included, so 1 and 10 can both come up.

Can I generate numbers without repeats?

Yes. Keep "No repeats" ticked and every number in the result will be different, like drawing numbered balls from a bag. Untick it to allow the same number more than once.

Are the minimum and maximum included?

Yes. Both ends of the range can come up, so 1 to 10 has ten possible numbers, each with the same chance.

How random are the numbers?

They come from your browser's cryptographic random number generator (the Web Crypto API), with a method that gives every number in the range exactly the same chance.

Can I use it for lottery numbers?

Yes. For example, set 1 to 69, five numbers, no repeats. Every combination is equally likely, so random picks win as often as any others.