Random number generator

Pick one or many random numbers in any range, with no repeats if you like, or draw them one at a time like numbered cards from a hat. There is a dice roller too.

Quick ranges

How the numbers are picked

The numbers come from your browser's cryptographic random generator (crypto.getRandomValues), the same source used to make encryption keys, rather than the simpler Math.random. Each press asks it for fresh random bits on your device.

Turning random bits into a range fairly takes one more step. The generator gives a whole number from 0 to 4,294,967,295 (232 − 1). Taking the remainder after dividing by 100 would make some numbers slightly more likely than others, because 4,294,967,296 does not divide evenly by 100. This tool uses rejection sampling: it only accepts draws below the largest multiple of the range size (4,294,967,200 for a range of 100) and draws again otherwise, so every number in your range is exactly as likely as every other.

  • No repeats draws without replacement: once a number is picked it cannot come up again in that batch, and every remaining number stays equally likely.
  • Decimals: with 2 decimal places, 1 to 2 means the 101 values 1.00, 1.01 … 2.00, each equally likely.
  • Leave out removes numbers from the range entirely; the rest stay equally likely.
  • Dice roll each die separately (1 to the number of sides), then add them up and apply the + or − amount.

Worked examples

  • Pick 5 different numbers from 1 to 50: set From 1, To 50, How many 5 and tick No repeats. There are 50 × 49 × 48 × 47 × 46 = 254,251,200 possible ordered draws, each equally likely.
  • Calling on 30 students in a random order: on Draw one at a time, set 1 to 30 (one number per student) and press Draw next each time. The counter shows how many are left; nobody is picked twice until you reset.
  • Roll 2d6: totals run from 2 to 12. A 7 is the most likely, with 6 of the 36 combinations (1+6, 2+5, 3+4, 4+3, 5+2, 6+1), a chance of 1 in 6. A 2 or 12 has only one combination each, 1 in 36.
  • Random number between 0 and 1 with 2 decimals: From 0, To 1, Decimal places 2 gives one of 101 values from 0.00 to 1.00.

Good uses

Picking a student to answer, sampling rows from a list for spot checks, settling who goes first, board-game and tabletop dice. To pick from a list of names instead of numbers, the wheel spinner shows the pick on a spinning wheel.

FAQ

Is this truly random?

It uses your browser's cryptographically secure generator, which is designed so its output cannot be predicted. Strictly it is a very high quality pseudo-random generator seeded from your device's hardware noise, which is what security software relies on too.

How do I generate random numbers with no repeats?

Tick No repeats before you press Generate. To draw them one by one over time instead, use the Draw one at a time tab, which remembers what has come up until you reset it.

Can I get a random number between 1 and 6, like a die?

Yes. Press the 1–6 button on the Dice tab, or set From 1 and To 6 on the Numbers tab.

What does 3d6+2 mean?

Roll three six-sided dice, add them up, then add 2. The total can be anything from 5 to 20.

Why might the same number come up twice in a row?

Because each draw is independent. With 1 to 10, the chance the next number matches the last one is 1 in 10. Tick No repeats if you never want duplicates within one batch.

Are the numbers saved?

No. They are made in your browser and disappear when you close or reload the page.