Coin Flip Simulator
How it works
Flipping a coin produces the simplest possible random experiment: two equally likely outcomes (heads/tails). The Coin Flip Simulator performs single or batch coin flips using cryptographically secure randomness, logs the history, and displays running totals — useful for probability demonstrations, resolving decisions, and statistical experiments.
**True randomness vs. pseudo-randomness** Physical coin flips are not perfectly fair — a study by Persi Diaconis (Stanford) found that coins tend to land the same face up 51% of the time when flipped from rest because of the rotation dynamics of a spinning disc. A bias of just 1% means in 1000 flips, the biased side appears 510 times, not 500. This simulator uses `crypto.getRandomValues()` — the browser's cryptographically secure pseudo-random number generator — for genuinely unbiased 50/50 results.
**Batch flipping** The batch mode lets you flip 10, 100, or 1000 coins at once, showing the distribution of heads vs. tails. This directly demonstrates the Law of Large Numbers: while any individual sequence may deviate from 50%, the cumulative average converges to 0.5 as the number of flips increases. With 100 flips, the standard deviation of the proportion heads is √(0.25/100) = 5%, so 40–60% heads is expected ~68% of the time.
**Decision making** Psychologists have found that flipping a coin to resolve a decision is genuinely useful — not because the coin decides for you, but because your emotional reaction to the result (relief or disappointment) reveals your actual preference. If you flip and feel disappointed when it lands heads, you probably wanted tails.
Privacy: all random generation runs in the browser. No flip results are transmitted.
Frequently Asked Questions
- Not quite. Research by Persi Diaconis (Stanford) found that coins flipped from a resting position on the thumb tend to land the same face up approximately 51% of the time, due to the precessing motion of a spinning disc. Magicians can exploit this for 'force flips'. However, coins tossed vigorously and caught (not rolled on a surface) come close to 50/50. This digital simulator uses cryptographic randomness for exactly 50% probability.
- A hypothesis test for coin fairness: with 100 flips, if you observe between 40 and 60 heads, you can't reject fairness at the 5% significance level (the expected range for a fair coin at 95% confidence). To detect a 1% bias (51% instead of 50%), you need approximately 25,000 flips for 80% statistical power. This is why detecting slight physical coin bias requires very large experiments.
- The Law of Large Numbers states that the sample mean converges to the true probability as sample size increases. With 10 flips: anywhere from 2 to 8 heads is plausible for a fair coin. With 1000 flips: the proportion of heads will be within about 3% of 50% about 95% of the time. With 10,000 flips: within about 1%. The law guarantees convergence — but doesn't say anything about short-run sequences. 'Due for heads after 10 tails' (the gambler's fallacy) is false — each flip is independent.
- For small samples (< 20 people), coin flips are a legitimate randomisation method for A/B testing. For larger studies, computerised block randomisation is preferred to ensure balance. The Coin Flip Simulator's batch mode can generate sequences of N assignments (H=group A, T=group B) quickly. For clinical trials and formal experiments, use a verified randomisation service rather than any online tool.