Dice Roller & Coin Flip

Roll dice of any size, or flip a coin β€” cryptographically fair.
Total β€”
Recent rolls
?
Tap Flip to start
Recent flips

How random dice and coins work

Rolling a die or flipping a coin online is only fair if the randomness is genuinely unpredictable. This tool uses crypto.getRandomValues(), the browser's cryptographic random number generator β€” the same source used for TLS keys and password generation. It's not the same as Math.random(), which is predictable and should never be used for games or anything else that needs fairness.

How the randomness works

When you tap "Roll dice," the browser pulls entropy from your operating system β€” a pool of unpredictable physical events like keystrokes, mouse movement, and disk timing. That entropy is fed through a cryptographic hash, producing numbers that can't be predicted even if someone knew your device, your habits, or the exact millisecond you tapped.

For a d6, the tool maps the random value to the range 1–6. For a d20, it's 1–20. For a d100, it's 1–100. In every case, all outcomes have exactly the same probability. The tool uses rejection sampling to avoid the modulo bias that affects many simple online dice rollers.

The dice

The tool supports the seven standard dice used in tabletop games:

You can roll up to 20 dice at once and see the total. The history below the dice keeps the last 8 rolls for reference.

The coin flip

A fair coin has exactly two outcomes β€” heads or tails β€” with 50% probability each. The tool uses the same secure randomness as the dice: generate a random bit, map 0 to heads and 1 to tails. For multiple flips, each flip is independent, so 10 flips don't bias toward heads or tails.

You can flip up to 100 times at once. For a single flip, the result shows H or T. For multiple flips, the result shows the totals β€” e.g., "6H Β· 4T" for 10 flips.

Why not use Math.random()?

Math.random() is not cryptographically secure. It's designed for non-security uses like generating random UI elements or picking a random color from a palette. In many JavaScript engines, its output is predictable if you observe enough previous outputs. For a game of dice, that's fine in theory β€” but online dice rollers are often used for real games with real stakes, so it's worth using a genuinely fair source.

Common questions

← Back to Your Online Helper