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 to use

  1. Random numbers. Enter the lowest and highest value (both can be included in the result), choose how many numbers you want, from 1 to 100, and press Generate numbers. The same number can appear more than once.
  2. Dice. Choose 1 to 20 dice and 2 to 100 sides on each, then press Roll dice. The faces are listed and the total is shown.
  3. Coin flips. Choose 1 to 100 flips and press Flip coins. Each result is heads or tails.
  4. Draw without repeats. Enter a range and how many values to draw, then press Draw numbers. Each value comes up at most once, like pulling numbered balls from a bag.

If an entry is not a whole number or is out of range, the result line says what to fix.

Worked example

Random output changes every time, so these examples show the arithmetic behind it instead of one result.

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. It is documented on MDN and in the W3C Web Cryptography API. Browsers seed it from the operating system, so it is suitable for security work as well as games. It is not the same as Math.random(), which is not designed to be unpredictable.

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. Taking a simple remainder instead would favour the low values slightly. 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. Every order is equally likely.

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.

Common mistakes

Frequently asked questions

Is it truly random?

It uses the browser's cryptographically secure generator, which is designed to be unpredictable. Strictly it is pseudorandom, seeded from the operating system's entropy, and that is the standard used for security.

Can I get the same result again?

No. There is no seed to set, so results cannot be replayed. Copy the result if you need it later.

Are the results stored or sent?

No. Everything runs in your browser and nothing is stored.

Why is the draw limited to 10,000 values?

A draw shuffles every value in the range, so a limit keeps the page fast and the memory use small.

Can I use it to pick a password?

For passwords, use the Password Generator. It is built for that job.

Related tools