Skip to content

Random number generator

 —

Numbers come from your browser's secure random generator, so every value in the range is equally likely. Dice are fair dice and coins are fair coins. Nothing is stored.

What do you need

No repeats

Result

—

Loading…

Getting a fair random result

People are poor at being random. Asked to pick a number from 1 to 10, far more choose 7 than 1 or 10. A generator removes that bias, which is why it is handy for raffles, classroom picks, games and deciding who goes first.

Three modes are here. A number in a range gives every whole number an equal chance, and No repeats makes each draw unique, like taking numbered tickets out of a hat. Dice mode rolls up to 100 dice with 4 to 20 sides and shows each die and the total. Coin mode flips once, or many times to show how the split settles near 50/50.

A fair result can still look streaky. Ten coin flips land 5 and 5 only about a quarter of the time, and runs of four heads in a row are common. That is normal randomness, not a fault.

Results come from crypto.getRandomValues, the browser's secure random source, with a correction so that no number is more likely than another. Nothing is saved, so record the result yourself if it matters.

Sources

What this calculator does not account for

  • Saving or proving a draw, so record it yourself.
  • Rules for regulated lotteries and prize draws.
  • Decimal numbers; results are whole numbers.

How this is calculated

Formula: Fair random picks

chance of any number =1 ÷ (highest − lowest + 1)

What the symbols mean

  • highest − lowest + 1How many whole numbers are in the range.

Good to know

  • The average of n dice with s sides is n × (s + 1) ÷ 2, so two six-sided dice average 7.
  • To pick names instead of numbers, use the random name picker.

Read the full methodologyFound an error? Contact us

Worked examples

Each example is worked out by the same code as the calculator above.

One number from 1 to 100

Each number has a 1 in 100 chance.

Three six-sided dice

A total from 3 to 18, averaging 10.5.

Embed this calculator

The frame shows the tool only.

<iframe src="/embed/random-number-generator" title="Random number" width="100%" height="720" style="border:0;max-width:42rem" loading="lazy"></iframe>

Questions

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

Leave From at 1 and To at 100 and read the result. Every number has a 1 in 100 chance. Tap Generate again for another.

Can I get numbers with no repeats?

Yes. Turn on No repeats and ask for several numbers. It works like drawing balls from a bag without putting them back.

Is a coin flip really 50/50?

Here it is: each flip is an independent fair choice. With a real coin, studies have found a tiny bias toward the side that started facing up.

What is the most common total with two dice?

Seven. Six of the 36 possible combinations add up to 7, a 1 in 6 chance.

Is this random enough for a raffle?

It uses the browser's cryptographic random generator, which is suitable for fair draws. For a regulated lottery, follow the rules that apply to you.