Skip to content

Coin Flip and Dice Roller

Estimates for educational purposes — not financial, medical, or legal advice. See terms.

Flip coins and roll polyhedral dice with cryptographic-grade fairness. Supports the seven standard tabletop dice (d4, d6, d8, d10, d12, d20, d100) with configurable dice counts, and a persistent roll history that survives page reloads.

How the randomness works

Every flip and roll uses crypto.getRandomValues — the browser’s built-in source of cryptographic-grade entropy. This is the same RNG used for generating session tokens, encryption keys, and UUIDs — it pulls from OS-level sources (disk jitter, interrupt timing, hardware RNG where available) and passes rigorous statistical tests. To convert the raw random bytes into dice values, the tool uses rejection sampling, which eliminates the subtle bias that naive % operations introduce when the range doesn’t evenly divide the RNG’s output space.

Net result: every face of every die is exactly equally likely on every roll, with no patterns, no correlations, no drift. The rolls are more uniform than physical dice — manufacturing imperfections, imbalance, and throwing surface all bias real dice slightly, and software dice have none of those.

Coin flips

Pick “Coin” mode, enter how many flips, click “Flip”. You get:

  • The individual flip sequence (H, T, T, H, …)
  • Heads and tails counts
  • The full sequence as coloured pills for quick visual scanning

Flip one coin for a yes/no decision, or a hundred at once to get a feel for how the law of large numbers works (50/50 ± a few percent). If you want to analyse the resulting sequence, the descriptive statistics calculator handles mean, stdev, and friends.

Dice rolls

Pick “Dice” mode, select a die size with the pill buttons (d4 through d100), enter how many dice, click “Roll”. You get:

  • Each individual roll
  • The sum
  • Standard dice notation (“3d6 = 4, 3, 5 → 12”) so you can copy results into an RPG log

Multiple dice are rolled independently — rolling 2d6 is equivalent to rolling a single d6 twice and adding, not rolling a single 2d6-distribution value (the difference matters for skewed distributions: 2d6 peaks at 7, while a hypothetical flat d11 would be uniform across 2–12).

Example: D&D ability score roll

4d6 drop lowest is a classic ability-score method. Roll 4d6 here, then mentally drop the lowest value and sum the rest. For 4d6 = 4, 3, 5, 6, drop the 3 → 4 + 5 + 6 = 15. Repeat five more times for a full set of ability scores.

Example: coin flip for a decision

One flip, one answer. H = do A, T = do B. Takes about 2 seconds including page load. Especially useful when the decision genuinely doesn’t matter and you just want to stop debating.

Example: 100 flips for fairness demo

Flip 100 coins. You should see 50 ± 5 or so heads — rarely exactly 50, but almost always between 40 and 60. If you see 80 heads out of 100, the probability of that under a fair coin is vanishingly small (about 1 in 2 million) — it’d be strong statistical evidence that the coin is biased, which for this software RNG means something went badly wrong somewhere.

Roll history

The tool keeps up to 50 recent rolls in your browser’s localStorage. Close the tab, come back tomorrow, and your history is still there. Each entry shows the notation and the result, in reverse chronological order (newest first). Nothing leaves your browser — localStorage is purely client-side, tied to the origin, with no network requests. The “Clear” button wipes the history if you want a fresh slate.

Standard dice and what they’re for

  • d4 (tetrahedron): lowest-damage weapons in D&D (daggers, darts), small healing spells
  • d6 (cube): the common dice everyone owns; used everywhere
  • d8 (octahedron): medium damage, some utility spells
  • d10 (pentagonal trapezohedron): percentile dice, some spell scaling
  • d12 (dodecahedron): heavy weapons, rare spell damage
  • d20 (icosahedron): attack rolls, saving throws, skill checks — the defining die of D&D and Pathfinder
  • d100 (Zocchihedron, or a pair of d10s): percentile rolls, loot tables, percentile skills in CoC and other systems

What this tool does not do

It doesn’t parse full dice notation. “2d6+3” or “4d6 drop lowest” requires a notation parser. Use a dedicated RPG tool for anything with modifiers or expressions.

It doesn’t support exploding, rerolling, or advantage/disadvantage mechanics. Each roll is a single independent draw from [1, sides]. For system-specific mechanics (D&D 5e advantage = roll 2d20, take higher; exploding dice = reroll on max), you need a game-aware tool.

It doesn’t simulate non-standard dice sizes (d3, d7, d30). Use the general random number generator with custom bounds for those.

It doesn’t support weighted dice or bias simulation. Every face is equally likely. For simulating loaded dice or probability distributions beyond uniform, you need a different tool.

It doesn’t sync history across devices. localStorage is per-browser-per-origin. Rolls you make on your laptop won’t show up on your phone.

Frequently asked questions

Which dice sizes are supported?

The seven standard polyhedral dice used in tabletop role-playing games: d4, d6, d8, d10, d12, d20, and d100. These correspond to the Platonic solids (d4 = tetrahedron, d6 = cube, d8 = octahedron, d12 = dodecahedron, d20 = icosahedron) plus d10 (pentagonal trapezohedron) and d100 (two d10 rolls combined, or a dedicated Zocchihedron). Non-standard dice (d3, d7, d30, etc.) are not supported — use the general random number generator for custom ranges.

Are these rolls really fair?

Yes, about as fair as any software simulation can be. The tool uses the browser's crypto.getRandomValues (the same cryptographic-grade entropy source used for generating encryption keys) and rejection sampling to eliminate modulo bias. Every face of every die is equally likely on every roll, and each roll is independent of the previous ones. The rolls are more statistically uniform than physical dice — physical dice have subtle biases from manufacturing imperfections, imbalance, and throwing surface, none of which apply here.

Why does the history persist between page loads?

The tool saves recent rolls to localStorage (up to 50 entries) so you can close the tab and come back to your rolling session later. This is especially useful for tabletop games where you want a running log of critical rolls. Nothing leaves your browser — localStorage is client-side only, tied to the origin, with no network traffic. Clearing your browser data or clicking 'Clear' wipes the history.

Can I roll complex dice notation like '2d6+3'?

Not directly — the tool handles dice count and die size, but not modifiers (like +3) or expressions mixing different dice. For 2d6+3 you'd roll 2d6 here and add 3 mentally. For a full dice-notation parser (e.g. '4d6 drop lowest', '2d20 advantage', 'd% + d10'), you'd want a dedicated RPG dice tool. This one is intentionally minimal — pick a single die type, pick a count, roll.

Why doesn't the coin flip show an image of a coin?

Because 'H' and 'T' convey the information in less space and remain readable at tiny sizes. The result card colours heads differently (accent-coloured pill for heads, default colour for tails) so batched flips are quick to scan at a glance. If you prefer emoji coins (🪙) or animated flips, you'd want a themed flipper page — this one prioritises clarity of counts over visual flair.