Home › Productivity › Random Number, Dice and Coin Generator

Random Number, Dice and Coin Generator

Pick random whole numbers in a range, roll dice, flip coins, or draw numbers without repeats. Results come from your browser's secure random source, and every value is equally likely.

Random numbers in a range

Choose a range, then press Generate numbers.

Dice

Choose the dice, then press Roll dice.
Total of the faces-

Coin flips

Choose how many flips, then press Flip coins.

Draw without repeats

Choose a range, then press Draw numbers. Each value appears at most once.
Everything runs in your browser. No results, inputs or choices are stored or sent anywhere. This page needs JavaScript.

How it works

Random source. Every value comes from your browser's secure random source (crypto.getRandomValues), in 32-bit unsigned whole numbers. Nothing else supplies the randomness.

Every value is equally likely. A range of values is picked from the 32-bit numbers by rejection sampling. A number that falls in the uneven leftover part of the 32-bit range is discarded and another one is drawn, so no value is favoured. Dice and coin flips use the same rule.

Dice and coins. Each die is a number from 1 to its sides. Each coin flip is one random bit: an even value is heads and an odd value is tails.

Draws without repeats. The values in the range are shuffled into a random order (Fisher-Yates shuffle), and the first ones are taken. Each value appears at most once.

Limits. Numbers and coin flips come 1 to 100 at a time. Dice have 1 to 20 dice with 2 to 100 sides. A range for random numbers can hold up to 4,294,967,296 values. A draw without repeats works on a range of up to 10,000 values.