Flip a coin up to 10,000 times with adjustable bias. Track heads/tails counts, streaks, z-scores, running percentages, and alternation rates.
Need a quick decision? Flip a coin. Want to understand probability? Flip ten thousand. Our Coin Flipper does both — from a single fair coin toss to massive simulations with adjustable bias, streaks analysis, z-score fairness testing, and a running percentage tracker that visualizes the law of large numbers in real time.
Every simulation shows the full sequence with color-coded results, so you can visually spot patterns (and then learn why those patterns don't actually mean anything in a random process). The z-score output tells you whether your results deviate significantly from expectations — useful for testing suspect coins or validating random number generators.
Whether you're settling a bet, teaching probability in a classroom, or running Monte Carlo experiments, this tool transforms the simplest random event into a rich statistical experience. Switch between Heads/Tails, 1/0, or Win/Lose labels to match your use case. Check the example with realistic values before reporting.
A physical coin flip is limited to one toss at a time with no record-keeping. Our digital flipper provides instant batch simulations, automatic statistical analysis, and visual sequence displays. The z-score output gives you a rigorous fairness test that would be impractical to compute by hand.
For educators, the running percentage table demonstrates the law of large numbers beautifully — early flips show wild swings, but the percentage converges toward the true probability as sample size grows. This single visualization teaches more about statistics than a chapter of textbook theory.
For N flips with probability p of heads: Expected heads = Np. Standard deviation = √(Np(1-p)). Z-score = (observed - expected) / σ. A |z| > 1.96 suggests the coin may be biased at the 5% significance level.
Result: Heads: 53 (53%), Tails: 47 (47%), Longest H streak: 6, Z-score: 0.60
53 heads in 100 fair flips gives a z-score of 0.60, well within the normal range (|z| < 1.96). The longest streak of 6 matches the expected ~6.6.
The coin flipper's running percentage table illustrates one of probability's most fundamental theorems. After just 10 flips, the observed heads percentage might be anywhere from 20% to 80%. After 100 flips, it typically narrows to 40-60%. After 10,000 flips, you'll almost always see 49-51%. The sample proportion converges to the true probability — this is the law of large numbers in action.
This convergence is why casinos are profitable: individual gamblers experience wild swings, but the house edge compounds over millions of bets to produce reliable profit. The same principle underlies insurance, polling, and quality control.
If you suspect a physical coin is biased, you need a statistical test. Flip it N times, count heads H, and compute z = (H - N/2) / √(N/4). If |z| > 1.96, you can reject fairness at the 5% significance level. For practical detection of small biases (1-2%), you need several thousand flips.
Real coins do have slight biases — a 2007 Stanford study found that coins are about 51% likely to land on the same face they started on, due to precession during the flip. This 1% bias is undetectable in fewer than about 10,000 flips.
The simple binary random variable is foundational to computer science. Randomized algorithms, hash functions, load balancers, and cryptographic protocols all build on coin-flip-like primitives. The Bernoulli distribution (single coin flip) generates the Binomial distribution (N flips), which connects to the Normal distribution via the central limit theorem.
It uses Math.random(), a pseudorandom number generator that's more than sufficient for casual use, simulations, and teaching. For cryptographic purposes, use window.crypto instead.
The z-score measures how many standard deviations the observed heads count is from expected. A |z| > 1.96 means the result is in the extreme 5% of outcomes, suggesting possible bias.
Streaks are guaranteed in random sequences. In N flips, expect the longest streak to be about log₂(N). It's a common misconception that random means alternating — true randomness is clumpier than people expect.
The percentage of consecutive flip pairs that differ (e.g., HT or TH). A fair coin should show ~50% alternation. Significantly higher suggests alternating bias; lower suggests clumping.
You need about 400 flips to reliably detect a 5% bias (power > 80% at α = 0.05). Small biases require thousands of flips to distinguish from luck.
Absolutely! A single fair coin flip (50% probability) is a perfectly valid decision-making tool when two options are equally good. Some psychologists even suggest noting which outcome you hope for as the coin is in the air.