A fair coin whenever you need one
No coin in your pocket? This Coin Flipper gives you a genuine 50/50 heads-or-tails result on demand, plus running statistics so you can see fairness in action. Use it to settle a quick decision, run a classroom probability experiment, or simply enjoy watching the streaks form.
How it works
Every flip generates a random number between 0 and 1 with Math.random(). If that number is below 0.5 the result is Heads, otherwise Tails — an exactly even split with no bias. The tool then records the result in a running history and recomputes three things: the total counts and percentages for each side, and the current streak. The streak is found by scanning backward from the most recent flip and counting how many consecutive results match it, stopping at the first difference. A short shuffle animation cycles a few random faces before settling, but the recorded result is its own independent draw.
The law of large numbers in practice
Flip ten times and you might see seven heads and three tails — a 70/30 split that feels unfair. Flip a hundred times and you will likely be closer to 48/52 or 52/48. Flip a thousand times and the percentages will have converged very close to 50/50. This is the law of large numbers: the sample average converges to the expected value as the sample grows, but any short sequence can look lopsided.
The streak counter makes this easy to observe directly. Short runs of five or six identical results happen far more often than most people expect. The probability of getting five heads in a row is 1 in 32 — not rare at all. With enough flips, runs of eight or nine become fairly common too.
Practical uses
- Quick decisions — flip instead of arguing about who goes first in a game, who picks the restaurant, or who makes the coffee.
- Classroom probability — demonstrate independence of events and the law of large numbers live with visible counters.
- Fairness testing — run 100 flips and see how close the percentages get to 50/50, illustrating that a fair coin has no memory of past results.
- Simulation warm-ups — when you need a simple random yes/no for a manual simulation step.
Tips and notes
Flip a few dozen times and watch the heads and tails percentages drift toward 50 percent — this is the law of large numbers at work. Do not be surprised by long streaks; with a fair coin, a run of five or six identical results is common and does not mean the coin is “due” to switch. The full history is shown as a compact H/T sequence so you can review the exact run. Everything runs locally in your browser, and reloading the page clears the record.