HomeText & Developer Tools › Dice Roller & Coin Flip

Dice Roller & Coin Flip

Roll up to ten dice with 4, 6, 8, 10, 12, 20 or 100 sides and flip any number of coins - with the total, the per-die breakdown and a heads/tails tally.

How the roller works

Each die is rolled independently: the page asks the browser for a random 32-bit number from crypto.getRandomValues(), discards it and draws again if it lands in the incomplete final block of the range (rejection sampling, which removes modulo bias), then maps what is left onto 1 through the number of sides. Every face therefore has exactly the same probability - 1 in 6 for a d6, 1 in 20 for a d20 - with none of the edge weighting or manufacturing tolerance of a physical die. Coins work the same way with two outcomes. There is no seed, no history and no network call; reload the page and every result is gone.

The supported dice are the standard polyhedral set: d4, d6, d8, d10, d12, d20 and d100 (percentile). The modifier is added to the dice total after the roll, so 3d6+2 means roll three six-sided dice, add them, then add 2. The summary line shows the possible range and the average for the dice you chose, which is a quick sanity check on whether a roll was lucky.

The probabilities behind the numbers

A single die is uniform: on a d20, each of the 20 results is equally likely, so there is a 5% chance of a natural 20 and a 5% chance of a natural 1. Two or more dice are not uniform at all. Two six-sided dice have 6 x 6 = 36 equally likely outcomes, and the sums range from 2 to 12. A total of 7 can happen six ways (1+6, 2+5, 3+4, 4+3, 5+2, 6+1), so its probability is 6/36 = 1/6, about 16.7% - the most likely sum. A total of 2 or 12 can happen exactly one way each, 1/36 or 2.8%. That bell-shaped spread is why board games built on 2d6 feel very different from games built on a single d20.

The average of one die with s sides is (s+1)/2, so a d6 averages 3.5 and n dice average n(s+1)/2: 3d6 averages 10.5 with a range of 3 to 18. For coins, each flip is independent, and the chance of the same side coming up k times in a row is 1/2^k - about 3.1% for five in a row. A previous run of heads changes nothing about the next flip; believing otherwise is the gambler's fallacy.

Uses and fair-play notes

Handy when the dice are lost, when you are playing a tabletop game over video chat, for settling a decision with a coin flip, for classroom probability lessons where students need hundreds of trials quickly, and for randomizing turn order. Roll 50 coins a few times and you will see the heads count cluster near 25 but rarely hit it exactly - a fast demonstration of sampling variation and the law of large numbers.

One honest caveat: an online roll cannot be verified by the other players the way a physical die on the table can, because only the person pressing the button sees the draw. For competitive play, share your screen or use a roller that both sides can see. And no online tool is appropriate for real-money gambling, which is regulated and requires audited random number generators.

Frequently asked questions

Are these dice really fair?

Yes. Each face is drawn from the browser's cryptographic random generator with rejection sampling, so every face has exactly equal probability - arguably fairer than a plastic die with rounded corners.

Why do I keep rolling low on my d20?

Coincidence. Each roll is independent and there is no memory between rolls, so a bad streak carries no information about the next one. Over hundreds of rolls the average converges on 10.5.

What is the chance of rolling a 7 with two dice?

6 out of 36, or about 16.7% - the most likely of all the sums. A 2 or a 12 is 1 in 36, about 2.8%.

Can I roll dice types the tool does not list, like 3d6+2?

Yes: set the number of dice to 3, the sides to 6, and the modifier to 2. The summary then shows the range 5 to 20 and the average of 12.5.