Coin Flip
Flip a coin online for heads or tails, or flip up to 10,000 at once and see the counts, percentages, full sequence and longest streak.
Ready to flip
Press Flip to flip the coin.
Each flip is an independent 1 in 2 draw from crypto.getRandomValues, made in your browser.
01 · Definition
What is an online coin flip?
An online coin flip picks heads or tails with equal probability using a random number generator instead of a physical coin. Each flip is independent: the result does not depend on earlier flips, so after five heads in a row the chance of heads on the next flip is still 1 in 2.
02 · Overview
How the Coin Flip works
Press Flip for a single heads or tails, or choose 10, 100, 1,000 or a custom number of flips up to 10,000. For more than one flip the tool shows how many heads and tails came up, each as a percentage, the full sequence in order, and the longest run of the same side. Every flip is an independent draw with probability exactly 1/2 from crypto.getRandomValues. Nothing is flipped until you press the button. The coin animation is skipped when your system asks for reduced motion, and the result is announced to screen readers immediately.
03 · Guide
Streaks are normal
Runs of the same side feel suspicious but are expected. In 20 fair flips, the chance of at least one run of 5 or more identical results (heads or tails) is 45.84%: 480,670 of the 1,048,576 possible sequences contain one. That figure is exact. A script counted the sequences with no run that long and subtracted from the total, and a second script checked the count by listing all 1,048,576 sequences.
The table gives the same exact calculation for other lengths. In 100 flips a run of 7 or more is more likely than not.
An even split is also less common than people expect. Exactly 5 heads in 10 flips happens 24.6% of the time (252 of 1,024 sequences), and exactly 50 heads in 100 flips about 8.0% of the time.
| Flips | Run of 4+ | Run of 5+ | Run of 7+ |
|---|---|---|---|
| 10 | 46.48% | 21.68% | 3.91% |
| 20 | 76.84% | 45.84% | 11.51% |
| 50 | 98.12% | 82.09% | 30.89% |
| 100 | 99.97% | 97.17% | 54.23% |
04 · Guide
Online flip vs a real coin
Each flip here is one random bit, taken without bias from the browser's cryptographic random source, so heads and tails each have probability exactly 1/2 and the software has no memory of earlier flips.
A coin tossed by hand is very slightly different. A study that collected 350,757 real coin flips found that a coin lands on the side that was facing up when it was tossed about 50.8% of the time, as a physics model by Diaconis, Holmes and Montgomery had predicted. With the starting side chosen at random, heads and tails came up equally often.
05 · Use cases
When to use the Coin Flip
- 01
Settle a two-way choice or decide who goes first
- 02
Show a class that streaks appear in random sequences
- 03
Generate a heads and tails sequence for a statistics exercise
- 04
Compare observed counts against the expected 50% over 1,000 flips
06 · Examples
Coin Flip examples
1 flip
ex 01Heads
One draw with a 1 in 2 chance of each side.
20 flips
ex 02TTTHTTHHHHHTTHHHTTTH Heads: 10 (50%) Tails: 10 (50%) Longest streak: 5 heads
A real run from the tool. It happens to split evenly and still contains a run of five heads.
1,000 flips
ex 03Heads: 520 (52%) Tails: 480 (48%) Longest streak: 13 tails
Counts drift a few percent from 50% even over 1,000 flips. The full sequence is shown in the tool.
07 · FAQ
Coin Flip: frequently asked questions
Is this coin flip fair?
I got five heads in a row. Is something wrong?
How many coins can I flip at once?
What does the tool show for many flips?
Does the animation decide the result?
Is anything sent to a server?
08 · Reference
Specs and further reading
These are the primary sources this tool follows. Where a specification defines the behaviour, we link the specification, not a summary of it.
- Web Cryptography API: the getRandomValues method
W3C. The specification of the browser's source of cryptographically strong random values that each flip is drawn from.
- Fair coins tend to land on the same side they started: Evidence from 350,757 flips
arXiv (Bartoš et al.). Reports a same-side probability of 0.508 for hand-tossed coins and no heads-tails bias when the starting side is random.
- Crypto.getRandomValues()
MDN Web Docs. Usage notes and browser support for the same method.
09 · More
Tools that pair with Coin Flip
Dice Roller
Roll d4, d6, d8, d10, d12, d20, d100 or a custom die, up to 100 at once, with a modifier. Type dice notation such as 3d6+2 or 2d20kh1.
Random Number Generator
Generate random integers or decimals between any two numbers, up to 10,000 at a time. Allow or forbid repeats, and add a seed for a repeatable sequence.
Random Name Picker
Paste a list of names, then pick one or more winners at random, shuffle the whole list, or split it into teams. Every draw is unbiased.