A coin toss is the simplest experiment in probability: two outcomes, heads or tails, each with a 50 % chance on a fair coin. Yet it raises surprisingly rich questions. What are the chances of exactly 5 heads in 10 flips? Of at least 8? How likely is a streak of 5 heads in a row somewhere in 20 tosses? And on average, how many flips does it take to see three heads in a row?
This coin flip calculator answers all of these exactly, in three modes:
- Number of heads — the binomial probability of exactly, at least and at most heads in flips, with a chart of every possible count.
- Streaks — the probability of at least one run of heads (or of identical faces) in flips, computed exactly rather than simulated, plus the expected number of flips until the streak first appears.
- Flip coins — a virtual coin that tosses up to 1,000 times, shows every result, the totals, the longest streak and how the share of heads settles towards 50 %.
You can also set a different probability of heads to model a biased coin. The tool is for learning, classroom work and settling friendly arguments — it is not a gambling aid: no strategy changes the odds of a fair coin.
How to use this calculator
- Pick the question: number of heads, streaks, or flip coins.
- For number of heads, enter the number of flips and the number of heads . Read the probability of exactly, at least and at most heads.
- For streaks, enter the number of flips and the streak length, and choose whether only heads count or a run of either face. Read the probability and the expected waiting time.
- For flip coins, enter how many flips you want and a seed. Change the seed for a new series; the same seed always reproduces the same flips.
- Leave the probability of heads at 50 % for a fair coin, or change it for a biased one.
The formula
Number of heads. With independent flips and probability of heads, the number of heads follows a binomial distribution:
"At least " adds the terms from to ; "at most " adds them from 0 to . The expected number of heads is .
Streaks. Track the length of the current run of heads after each flip (0, 1, …, ). A head extends the run with probability ; a tail resets it to 0. Summing the probability of reaching length over steps gives the exact chance of at least one streak. For a fair coin, the number of sequences without heads in a row follows a generalised Fibonacci recurrence.
Expected flips. The mean number of flips until the first run of heads is
For a run of either face on a fair coin, it is .
Worked example
Exactly 5 heads in 10 flips: , so 24.61 %. At least 8 heads: (5.47 %).
Three heads in a row within 10 flips: 0.5078 (50.78 %) — slightly better than even. Five heads in a row within 20 flips: 0.2499, about 24.99 %, or one chance in four. A run of five identical faces, heads or tails, in 20 flips: 0.4584 (45.84 %).
Waiting time: on average 14 flips to see three heads in a row () and 62 flips for five; three identical faces of either kind take 7 flips on average.
Simulation: 100 flips with seed 2026 give 47 heads and 53 tails, with a longest streak of 5.
Streaks are more common than intuition says
Most people underestimate how often long runs appear in random sequences. In 100 fair flips, the longest run of the same face is most often 6, 7 or 8, and a run of at least 5 heads in a row happens in roughly 4 out of 5 series. When students are asked to invent a "random" sequence, they switch sides too often and almost never write long runs — a classic way for teachers to spot made-up data. Use the Streaks mode with 100 flips to check it.
The gambler’s fallacy
After five heads in a row, the next flip is still 50/50: the coin has no memory. Long-run balance does not come from tails "catching up" but from the early streak being diluted by many later flips. That is why the share of heads in the simulation drifts towards 50 % while the gap between heads and tails, in absolute numbers, can stay large. For the full binomial toolbox, see the binomial distribution calculator; for dice, the dice probability calculator.
Frequently asked questions
What is the probability of getting heads 5 times in a row?
If you flip exactly five times, it is (1/2)⁵ = 1/32, about 3.1 %. Within a longer series it is much higher: in 20 flips, the chance of at least one run of 5 heads is about 25 %. The Streaks mode computes it exactly for any length.
How many flips does it take to get 3 heads in a row?
On average 14, given by the formula 2^(r+1) − 2 with r = 3. The actual number varies a lot: sometimes three flips are enough, sometimes it takes more than 40.
Is a coin flip really 50/50?
Very nearly. Studies of real tosses have found a slight tendency to land on the side that started face up, of the order of 51 %. For practical purposes, and in this calculator by default, a fair coin is 50/50.
Can I use the simulator to make a decision?
Yes, flip once to choose between two options. Write down the seed beforehand if someone else needs to check the result. The flips are pseudo-random and reproducible, not suitable for security or betting.
Does a streak of tails make heads more likely?
No. Each flip is independent; the probability stays the same whatever happened before. Believing otherwise is the gambler’s fallacy.
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.18 Binomial distribution
- OpenStax, Introductory Statistics 2e, §4.3 Binomial distribution
- M. F. Schilling (1990), The longest run of heads, The College Mathematics Journal 21(3):196–207
- D. Blackman, S. Vigna, xoshiro / xoroshiro generators (reference implementation)
Last updated: