Skip to content
Tejo Tools
Search
Menu
Processed on your device

Coin flip and dice roller

Flip up to 100 coins or roll up to 100 dice, from a d4 to a d20. Each result is drawn on your device.

What to do
Generated values

Your values will appear here.

Last updated

What it does

The coin flip and dice roller draws random results for a game, a decision or a classroom. Flip a coin for Heads or Tails, or roll dice with 4, 6, 8, 10, 12 or 20 sides. You can flip or roll up to 100 at once.

The page opens with one coin already flipped. Choose Roll dice and a roll of two six-sided dice appears. Change the number of coins or dice, or the sides, and a new result appears straight away.

How to use it

  1. Choose Flip a coin or Roll dice under What to do.
  2. For coins, set How many coins, from 1 to 100. For dice, set How many dice, from 1 to 100, and pick the Sides.
  3. Read the result under the settings. Coins show Heads or Tails for each coin and how many of each. Dice show each face and the total.
  4. Select Copy all for every result, one per line, or Copy next to a single one.
  5. Select Regenerate, or press Ctrl+Enter (⌘+Enter on a Mac), to flip or roll again with the same settings.

The page remembers your choices on this device, so they’re there the next time you open it. The results themselves are never kept.

How it works

Each flip and roll is drawn from your browser’s cryptographic random number generator, the same source used for encryption keys. The generator reads the browser’s random bytes 4 at a time, as a 32-bit value from 0 to 4,294,967,295.

A coin uses one value for each flip: Heads when the number it gives is 0, Tails when it is 1. A die with s sides uses a number from 0 to s − 1 and adds 1, so a six-sided die gives 1 to 6.

A plain remainder (modulo) would favour some faces whenever the sides don’t divide 4,294,967,296 evenly. 4,294,967,296 is exactly divisible by 2, 4 and 8, so a coin, a d4 and a d8 never need a correction. It isn’t divisible by 6, 10, 12 or 20. For a six-sided die the last 4 values would make 1, 2, 3 and 4 slightly more likely than 5 and 6, so the generator sets those 4 aside. If one of them comes up it’s skipped and the next one is used. What’s left divides evenly, so every face has exactly the same chance.

The total is added up from the dice shown, with nothing else involved.

How it’s calculated

Each coin and each die is its own draw, and every outcome of it has the same chance: 1 in 2 for a side of a coin, 1 in s for a face of a die with s sides. The outcomes of separate dice multiply. Two six-sided dice have 6 × 6 = 36 equally likely pairs, and a total is as likely as the number of pairs that make it.

A total of 7 has 6 pairs, so 6 in 36, about 16.7%. A total of 2 or 12 has 1 pair, so 1 in 36, about 2.8%. Ten coins have 2^10 = 1,024 equally likely runs of Heads and Tails, and 252 of them have exactly 5 Heads, about 24.6%.

Worked examples

Two six-sided dice

Under What to do choose Roll dice, and leave How many dice at 2 and Sides at 6. If the first two values drawn are 5 and 2, the faces are 6 and 3, and the line under the count reads Total 9 (2 dice, 6 sides each).

Ten coins

Choose Flip a coin and set How many coins to 10. If the ten values drawn are 0, 0, 1, 0, 0, 1, 0, 1, 0 and 0, the coins read Heads, Heads, Tails, Heads, Heads, Tails, Heads, Tails, Heads and Heads, and the line under the count reads 7 heads, 3 tails.

One twenty-sided die

Choose Roll dice, set How many dice to 1 and Sides to 20. A drawn value of 0 shows 1 and a value of 19 shows 20. The line under the count reads Total 20 (1 die, 20 sides) for the top face.

What the odds count

Feed the draw every pair of values from 0 to 5 and the 36 pairs give totals from 2 to 12 that occur 1, 2, 3, 4, 5, 6, 5, 4, 3, 2 and 1 times. Feed it every run of ten values of 0 or 1 and the 1,024 runs are all different, with 252 of them at 5 Heads.

Common mistakes

Dice notation and sides

Tabletop games write a roll as the number of dice, a d, and the number of sides: 2d6 is two six-sided dice and 3d8 is three eight-sided ones. How many dice and Sides hold the same two numbers, so 3d8 is How many dice 3 with Sides 8. The totals then run from the number of dice up to the number of dice times the sides: 3 to 24 for 3d8.

The page reads no added number, as in 2d6 + 3, because there is no field for it, so add it to the total yourself. A coin is the case of two sides, with its own mode: it shows Heads and Tails and how many of each, and no total.

Good to know

Privacy

The flips and rolls are drawn in your browser, on your device. Nothing is sent to a server and the results aren’t stored. Only your choices (what to do, how many and how many sides) are kept, in this browser’s storage, so the page can show them again.

Advertisements

Frequently asked questions

Is a coin flip here really 50/50?

Yes. Each coin is Heads or Tails with a chance of 1 in 2, and the two outcomes are equally likely. The result comes from your browser's cryptographic random number generator, not from a pattern or a timer. Flipping several coins at once gives each coin its own flip, so one coin landing Heads has no effect on the next. A run of several Heads in a row is a normal result, not a sign that something is off.

What dice can I roll?

Choose 4, 6, 8, 10, 12 or 20 sides, the shapes used in board games and tabletop role-playing games. A six-sided die gives 1 to 6, a ten-sided die gives 1 to 10 and a twenty-sided die gives 1 to 20. Every face has the same chance, 1 in the number of sides. You can roll from 1 to 100 dice of one shape at a time. To roll different shapes together, roll each shape on its own and add the totals.

How is the total worked out?

The total is the sum of every die in the roll. Two dice that show 3 and 4 give a total of 7, and the line under the count says so, for example Total 7 (2 dice, 6 sides each). Each die is shown on its own row too, in the order it was rolled, so you can read the individual faces. With coins there's no total. The line under the count says how many came up Heads and how many Tails.

Is the roll fair, and could it be rigged?

The page doesn't choose results: it asks your browser for random bytes and turns them into a face without favouring any of them. Nothing is sent to a server, so nobody else can see or change a roll. For the same reason the page can't be a source for a game that needs a result both players can check afterwards. Anyone who wants proof can follow the steps in How it works.

Can I use it to settle a choice or pick a number?

Yes, for a quick decision or a game. Agree what each result means before you flip or roll, for example Heads for the first option and Tails for the second. For a number in any range, such as 1 to 500, use the random number generator. The page shows the result of a draw; it doesn't tell you what to choose.

Advertisements