Skip to content
PrintablePaperKit

Random Number Generator

Draw random whole or decimal numbers from any range, roll up to 50 dice from d4 to d100, or pick names from a list, using your browser's secure random source.

  • Secure randomness
  • No-repeat draws
  • d4 to d100

What to generate

Pick a mode

Range

1 to 100

Minimum
Maximum
How many

History

0 saved

Result

Press generate

Numbers come from crypto.getRandomValues(), the browser cryptographic random source, with modulo bias rejected so every value in the range is equally likely.

How to generate random numbers

  1. Choose a mode. Under What to generate, pick Numbers, Dice or Pick.
  2. Set the range or dice. Enter a Minimum and Maximum and How many, or choose a die and How many dice, or paste your list.
  3. Decide on repeats. Turn on No repeats for raffles and team picking; leave it off for dice-style draws.
  4. Generate. Press Generate, then Copy results; the last 15 results are kept under History.

The three modes

ModeWhat it doesLimits
NumbersWhole numbers from the minimum to the maximum (both included), or decimals between themFrom −1,000,000 to 1,000,000, up to 500 numbers per draw
DiceRolls a set of identical dice and shows each roll and the totald4, d6, d8, d10, d12, d20 or d100, up to 50 dice
PickChooses entries from a list you type, one per line, never the same one twiceUp to as many as the list holds

Advanced options in Numbers mode add up to six decimal places, an Order setting (As drawn, Low to high or High to low) and a seed. Sorting does not change which numbers were drawn, only how they are listed. With decimal places above zero, every value in the range is possible, so No repeats has no effect.

Why the random source matters

Math.random() is a pseudorandom generator: quick and fine for shuffling a screensaver, but its next value can in principle be predicted from earlier ones. The browser’s crypto.getRandomValues() is built for security work such as making encryption keys, and is the source this tool uses for every unseeded draw.

There is a second, quieter problem: turning a big random number into a small range. If a generator gave the values 0 to 9 and you took the remainder after dividing by 3 to get 0, 1 or 2, the result 0 would come from 0, 3, 6 and 9 (four ways) while 1 and 2 would come from only three ways each. That is called modulo bias. The generator here throws away the few raw values that would cause it and draws again, so the odds stay exactly equal.

With or without repeats

SettingRepeats possible?Use for
No repeats onNoRaffles, team picking, choosing several winners
No repeats offYesDice-style rolls, simulations, sampling with replacement

Choosing the wrong one is the most common mistake. A raffle drawn with repeats allowed can pick the same ticket twice, and a simulation of dice that forbids repeats is no longer dice.

Running a fair draw

  1. Number the entries in a fixed order you can show people, such as ticket order.
  2. Announce the range and how many winners there will be before drawing.
  3. Set the Minimum and Maximum to match, turn on No repeats, and leave Use a seed off.
  4. Press Generate once, and screenshot or read out the result straight away.
  5. Do not draw again. A second draw replaces the first, and nobody can tell which one you would have kept.

For a small group it is often simpler to use Pick and paste the names directly, which removes the step of matching numbers to people.

Dice notation and totals

Tabletop games write dice as NdX: N dice with X sides each. One d20 gives every number from 1 to 20 with the same 5% chance. Several dice added together behave differently. Two d6 total anything from 2 to 12, but 7 can be made six ways out of 36 (a one in six chance) while 2 and 12 can each be made only one way. Three d6 run from 3 to 18 and average 10.5, with 10 and 11 the most likely totals. The Dice mode shows each die and the total, so you can use either.

The password generator uses the same secure random source for passwords. For randomness on paper, the bingo card generator makes cards with different numbers on each, and the road trip games page has printable games for the journey.

Frequently asked questions

How random are the numbers?

Unless you turn on a seed, every number comes from crypto.getRandomValues(), the browser’s cryptographic random source, rather than Math.random(). Values that would make some results slightly more likely than others are thrown away and drawn again, so every whole number in your range has the same chance.

What does No repeats do?

It draws without replacement, so once a number has come up it cannot come up again in that draw. Use it for raffles, team picking and choosing several winners. Leave it off for anything that behaves like dice, where repeats are normal. You cannot ask for more unique numbers than the range holds: 1 to 10 gives at most ten.

Can I pick names instead of numbers?

Yes. Choose Pick, type or paste one entry per line, and set How many to pick. Picks are always drawn without replacement, so nobody is chosen twice. Blank lines are ignored, but a name typed twice is two entries and has twice the chance.

Is it fair for a prize draw?

The randomness is sound. In a draw with real stakes the weak point is the process: publish the range and the number of winners before you draw, draw once with No repeats on, and record the result. Drawing again because you did not like the first result makes the draw unfair, however good the numbers are.

What is a seed for?

Under Advanced options, Use a seed makes the results reproducible: the same seed and settings give the same numbers every time. That suits a classroom exercise or a test you want to repeat. Seeded numbers can be worked out by anyone who knows the seed, so never use a seed for a prize draw.

Why does the same number keep coming up?

Because repeats are part of real randomness. Draw ten numbers from 1 to 100 with repeats allowed and there is roughly a 37% chance that two of them match. Roll a d20 five times and the chance of a repeated number is about 42%. Random sequences look less even than people expect.

Is anything sent to a server?

No. Numbers are generated in your browser. Your settings and the last 15 results in History are kept in this browser only, and Clear history removes them.

More online tools

All 15 online tools