
We Flipped Our Coin 10,000 Times: A Fairness Test With Real Results
By Said · November 2026 · 5-minute read
A coin flip page only has to do one thing well: give heads and tails the same chance. Saying so is easy, so I checked it. I flipped the Spin Numbers Coin Flip 10,000 times on the live page and compared the results with what a fair coin should produce.
The short version
- Heads came up 5,056 times and tails 4,944 times out of 10,000 flips (50.56% heads).
- A chi-square test gives 1.25. A result above 3.84 would have suggested a bias at the usual 5% level, so the counts are consistent with a fair coin.
- The longest streak was 14 tails in a row, close to what 10,000 fair flips usually produce.
- The coin uses the browser’s standard random number function. It is fine for everyday decisions and games, not for security or money.
How the Coin Flip picks heads or tails
For each flip, the tool asks the browser for a random number between 0 and 1 with Math.random(). Below 0.5 the result is heads, otherwise tails. The result is decided before the coin animation starts, so the animation has no effect on the outcome.
How I ran the test
- I opened the public Coin Flip page in a Chromium-based browser and set it to 20 flips per click.
- I clicked Flip 500 times, which makes 10,000 flips. To finish in minutes instead of hours, I shortened the animation delays during the test only. The code that picks heads or tails was not changed.
- After each click I recorded the sequence the tool displays, such as HHTHT, and joined all 500 sequences into one list of 10,000 results.
- I counted heads and tails, ran a chi-square goodness-of-fit test, and looked at streaks.
Results
| Measure | Result | What a fair coin gives |
|---|---|---|
| Heads | 5,056 | 5,000 on average |
| Tails | 4,944 | 5,000 on average |
| Chi-square (1 degree of freedom) | 1.25 | Below 3.84 in 95% of fair tests |
| Heads in each block of 1,000 flips | 489 to 526 | Usually within about 470 to 530 |
| Changes between heads and tails | 4,987 | About 5,000 |
| Longest streak | 14 (tails) | Usually close to 13 |
The ten blocks of 1,000 flips gave 504, 496, 509, 489, 526, 501, 504, 511, 514 and 502 heads. With a fair coin, the number of heads in 1,000 flips has a standard deviation of about 16, so blocks that sit 10 to 26 away from 500 are normal.
Streaks
Many people expect a fair coin to alternate more than it does. In a fair sequence, about half of the runs have length 1, a quarter have length 2, an eighth length 3, and so on. That is what the test showed.
| Run length | Observed | Expected (from 4,988 runs) |
|---|---|---|
| 1 | 2,497 | 2,494 |
| 2 | 1,214 | 1,247 |
| 3 | 641 | 624 |
| 4 | 320 | 312 |
| 5 | 166 | 156 |
The longest run was 14 tails. For 10,000 fair flips the longest run is usually close to 13, because log2(10,000) is about 13.3. A streak of 10 or more can look suspicious in a single session, but it is expected over thousands of flips.
What this test can and cannot show
What it can show
It shows that, in this test, the Coin Flip produced heads and tails in proportions and patterns that match a fair coin.
What it cannot show
- It does not prove that the coin is fair in every browser. The random function comes from the browser, and browsers can differ.
Math.random()is not a cryptographically secure generator, so the coin must not be used for security, gambling or anything involving money.- A fair result does not mean the choice is a good one. A coin decides between two options; it does not weigh them.
Run your own test in four steps
- Open the Coin Flip and choose 20 flips per click.
- Click Flip 50 times and write down the heads and tails counters (1,000 flips).
- Compute (heads − 500)² / 500 + (tails − 500)² / 500.
- If the result is below 3.84, your sample is consistent with a fair coin. In about 1 test out of 20, a fair coin still goes above 3.84 by chance.
Frequently asked questions
Is an online coin flip really 50/50?
In this test it behaved like a 50/50 coin: 50.56% heads over 10,000 flips, which is within normal chance variation.
Why did I get five heads in a row?
Five in a row happens often. In this test there were 166 runs of exactly five identical results.
Can I use it to settle a bet?
Only for friendly, informal decisions. It is not designed or certified for gambling.
Related: We Rolled Our Dice Roller 15,000 Times · Random Number Picker Test
References
NIST/SEMATECH. (n.d.). 1.3.5.15. Chi-square goodness-of-fit test. e-Handbook of Statistical Methods. https://www.itl.nist.gov/div898/handbook/eda/section3/eda35f.htm
V8 team. (2015, December 17). There’s Math.random(), and then there’s Math.random(). V8 blog. https://v8.dev/blog/math-random
MDN Web Docs. (n.d.). Math.random(). Mozilla. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random




