QuickUse Generator

Coin Flip

Crypto-backed coin flips with history, stats, and a bulk mode that demonstrates the Law of Large Numbers.

Tap Flip to spin the coin.

Disabled automatically when your system requests reduced motion.

Recent flips

No flips yet. Tap the coin to start.

Editorial guide

About this generator

An honest technical read on what is happening behind the Generate button.

A coin flip seems trivial — and it is, mathematically. One bit of entropy, no secret to protect, no algorithm to second-guess. The reason it is on this site anyway is the part most coin-flip pages skip: real coins are slightly biased, the digital ones in your phone often use a generator that is not suitable for any serious decision, and the "law of large numbers" people invoke after seven heads in a row is almost always the opposite of what they think it means. This page uses the Web Crypto API for the draw, persists your history locally so you can check fairness over time, and ships a bulk mode that runs ten thousand flips at once. The result tape is yours; nothing leaves your browser.

Is this coin flip actually fair?

Real physical coins are not. The Stanford group of Diaconis, Holmes, and Montgomery published a 2007 paper showing that a vigorously-flipped coin favours the side it started on by roughly 51% — a small but measurable bias from precession during flight. The bias grows for spun coins (where contact friction picks a winner), for worn coins, and especially for coins with embossed faces of different weight. None of that matters for the coin on this page. The draw is a single uniform randomInt(0, 2) call against Web Crypto — there is no precession, no contact, no weight asymmetry. Heads and tails arrive with probability 0.5 each, independent of every previous flip.

Bulk mode is the best way to convince yourself. Ten thousand flips against an unbiased coin land within a few dozen of the 5000 mark roughly 95% of the time. The chi-square fairness test below the histogram tells you whether the deviation you see is consistent with random noise or not, using Pearson's classic 1900 formulation. A p-value above 0.05 means the run is indistinguishable from a fair coin; below 0.01 means the bias is implausibly large for a fair process.

Why cryptographic randomness

For a binary outcome with no security stakes, Math.random() would have been fine — the bias of a typical JS PRNG is well below human-detectable. We use crypto.getRandomValues anyway, for consistency with the rest of the project: every QuickUseGenerator generator draws from the same well, so when you audit one you have audited all of them. There is no fallback path. If the Web Crypto API is not available, generation throws loudly rather than degrading silently.

When to flip a coin (and when not to)

Flip a coin when the cost of each outcome is roughly the same and the decision is not worth your time. Where to eat. Who clears the table. Whether to take a walk before finishing a draft. Behavioural research on tie-breaking suggests people are happier with coin-flipped outcomes than with deliberated ones at these stakes, probably because the coin frees them from owning the choice.

Do not flip for decisions you have already made unconsciously. The signal you will look for is your reaction when you see the result — and that reaction is the actual decision, not the coin. Do not flip for decisions you should be thinking harder about. A coin will solve a tie between options; it will not generate options you have not considered.

The Law of Large Numbers

Ten flips can land 7-3. A hundred usually lands within 45-55 heads. Ten thousand almost always lands within 4900-5100. The Law of Large Numbers says the empirical frequency converges to the expected probability as you collect more samples — but the convergence is slow and the absolute gap between heads count and tails count typically grows, not shrinks. Bulk mode lets you see this directly: the percentage approaches 50% as N climbs, but the raw difference (|heads − tails|) drifts upward proportional to √N.

Streaks and the gambler's fallacy

A coin has no memory. Ten heads in a row leaves the eleventh flip exactly 50/50. The intuition that tails is "due" is the gambler's fallacy; the mirror intuition that the coin is "running hot" for heads is the hot-hand fallacy. Both lose money at casinos for the same reason.

Long streaks are normal. The expected longest run of either side in N fair flips is approximately log₂(N). So a hundred flips will usually contain at least one run of 6 or 7; a thousand will contain a run around 10; ten thousand around 13. The bulk mode surface here surfaces the longest heads and longest tails streaks so you can confirm the empirical numbers track that prediction.

Frequently asked questions

My single-flip history shows 60% heads — is the coin broken?

Probably not. With 20 single flips the standard deviation of the heads proportion is around 11%, so anything between 28% and 72% is unsurprising. Switch to bulk mode and run a thousand for a tighter window.

Can the coin land on its side?

A real US quarter does land on its edge roughly once in 6000 flips on a hard, flat surface. Our digital coin: never. Two outcomes, by construction.

Is this random enough for a $100 bet with a friend?

Yes, unless they do not trust your computer. The draw is uniform and unbiased; the only attack surface is the device running the page.

Can I save my flip history?

It is already saved locally — up to 100 flips, in your browser’s localStorage, and never transmitted. The Clear button removes it on demand. For permanent archival, use the bulk-mode result tape’s Copy or Download buttons.

Why custom labels for heads and tails?

Because most coin flips are not actually about coins. "Pizza vs Burger", "Yes vs No", "Stay vs Go" all work the same — a 50/50 draw. Labelling the sides makes the result legible without forcing you to remember which outcome you mapped to heads.

How is the underlying randomness generated?

`crypto.getRandomValues()` from the Web Crypto API, the same source modern browsers use to seed TLS sessions. We map a single random byte to heads / tails with rejection sampling so each outcome gets exactly probability 0.5 — no modulo bias possible.

Can I run statistical tests on the bulk output?

The Download button exports the raw sequence as plain text — one outcome per line. From there it’s a one-liner in R, Python, or a spreadsheet to compute the heads ratio, the longest run, or a chi-square against the expected 50/50.