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
- Choose Flip a coin or Roll dice under What to do.
- For coins, set How many coins, from 1 to 100. For dice, set How many dice, from 1 to 100, and pick the Sides.
- 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.
- Select Copy all for every result, one per line, or Copy next to a single one.
- 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
- Expecting a streak to turn. After nine Heads the tenth coin is still 1 in 2. Each coin takes one value of its own, and that value alone decides whether it shows Heads or Tails.
- Reading the total as a face. The total is the sum of every die in the roll, and each die’s face is on its own row. A Total 9 from 6 and 3 is not a 9 on either die.
- Mixing shapes in one roll. Sides applies to every die in the roll, and there is no field for a second shape. Roll each shape on its own and add the totals yourself.
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
- A coin has a chance of 1 in 2 for each side. A die with s sides has a chance of 1 in s for each face: 1 in 6 for a d6, 1 in 20 for a d20.
- Each coin and each die is independent. A result a moment ago doesn’t make the next one more or less likely.
- Rolling two dice gives totals from 2 to 12, and 7 comes up most often because six of the 36 combinations make it. Each die on its own is still equally likely to show any face.
- The most you can flip or roll at once is 100. Roll again for more.
- The Sides choice applies to all the dice in a roll. For different shapes together, roll each shape and add the totals.
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.