Coin Flip
Up to 1,000 at once.
Heads
- 1
- This flip: heads
- 0
- This flip: tails
- 1
- Session total
- 100.0%
- Heads so far
The flipper tosses a coin (one at a time, or up to a thousand at once) and keeps a running tally across the session. The odds are exactly even, which is more than can be said for a real coin.
How it works
Each flip takes one byte from the browser cryptographic generator and tests whether it is even. Because the byte is uniform across all 256 values and exactly 128 of those are even, the test is precisely fair, no rounding, no modulo bias, no leftover tail.
- The result is decided before the animation starts, so the outcome never depends on timing or frame rate.
- The session tally accumulates across flips, which is the quickest way to watch a proportion converge on 50%.
- Flipping many at once is genuinely useful for seeing how slowly that happens. Ten flips rarely give five heads.
- Nothing is stored between visits. Reloading the page starts the tally again.
Real coins are not quite fair. A spinning coin caught in the hand lands very slightly more often on the face that started upwards, Diaconis, Holmes and Montgomery put the bias at roughly 51 to 49, from the physics of precession rather than any asymmetry in the coin. A coin spun on a table is far more biased than that, because the heavier face tends to end downwards.
Examples
A single flip
Flips
1
Result
Heads or tails, 50% each
Exactly even, unlike a physical coin.
Ten flips
Flips
10
Result
Five heads only about a quarter of the time
The most likely single result is 5-5, and it still happens in only 24.6% of attempts. Small samples are noisy.
A thousand flips
Flips
1000
Result
Usually between 47% and 53% heads
Convergence is slow: the spread shrinks with the square root of the count, so a hundred times more flips narrows it only tenfold.
Frequently asked questions
Is this actually a fair 50/50?
Yes, and more precisely than a real coin. Each flip reads a cryptographic random byte and tests whether it is even, exactly 128 of the 256 possible values are, so there is no bias at all. No modulo remainder, no rounding.
I got six heads in a row. Is it broken?
No. Six in a row has a 1 in 64 chance, which happens regularly over a session. Streaks feel wrong because people expect randomness to look evenly mixed, but genuinely random sequences contain more runs than intuition allows for. The coin has no memory of the last flip.
Are real coins actually fair?
Not quite. Research by Diaconis, Holmes and Montgomery found a flipped coin lands about 51% of the time on the face that started upwards, because it precesses rather than tumbling cleanly. Spinning a coin on a table is much more biased still, since the heavier face tends to end up down.
Does the tally reset?
It runs for as long as the page stays open, and there is a button to clear it. Nothing is saved between visits, so reloading starts from zero.
Why flip a thousand coins at once?
To see how slowly a proportion settles. Ten flips give five heads only a quarter of the time; a thousand usually land between 47% and 53%. The spread narrows with the square root of the count, which is why a hundredfold increase in flips only tightens the result tenfold.