Coin Flip Probability Calculator
Find the chance of an exact run of flips, a number of heads in any order, a streak somewhere in your flips, or one pattern turning up before another. You can also test whether a real coin is fair. Every answer shows the exact fraction and the working.
What do you want to work out?
Use H for heads and T for tails. HHTH means heads, heads, tails, heads, in that order.
Heads can land in any order. Flipping several coins at once works the same way.
You always see both answers side by side, so you can compare.
Flip until one of the two patterns appears. This is Penney's game.
0.5 tests for a fair coin.
Type 0.5, 50% or 1/2. Use 0.5 for an ordinary coin.
Using a fair coin (50/50).
Results update as you type. Press Calculate or Enter to save one to your recent list.
Your recent calculations
Practice questions
Five fresh questions each time, with worked answers. Teachers can print them as a worksheet with an answer key, or save it as a PDF from the print window.
Order or count: the question that trips people up
"What's the chance of 3 heads in 5 flips?" and "What's the chance of HHTHT?" sound like the same question. They aren't. The first accepts any arrangement with 3 heads, such as HHTTH, HTHTH or THHHT. The second accepts only one arrangement.
With a fair coin, HHTHT has a 1 in 32 chance. There are 10 different orders that give 3 heads in 5 flips, so "3 heads in any order" is 10 times as likely, at 10/32 or 31.25%. The any-order answer is never smaller than the one-order answer, and it's only equal when you want all heads or no heads, since there's just one way to get those.
The formulas behind each mode
Exact order
P(sequence) = p^heads × (1 − p)^tails
Flips don't affect each other, so you multiply the chance of each flip in turn. With a fair coin every sequence of the same length has the same chance: 1 in 2 raised to the number of flips.
Number of heads (binomial)
P(X = k) = C(n, k) × p^k × (1 − p)^(n − k)
C(n, k) counts how many orders give exactly k heads in n flips. Each of those orders has the same chance, so you multiply. For "at least one head", it's quicker to work out 1 − (1 − p)^n.
A streak starting on the first flip
P = p^k
This is just one exact sequence: k heads in a row. For "either side", add the all-tails chance too: p^k + (1 − p)^k.
A streak anywhere in n flips
track the current run length after each flip, then P = 1 − P(no run of k)
No neat one-line formula exists, so the calculator follows every flip in turn and keeps count of how long the current run is. That tells it the exact chance of getting through all n flips without a run of k, and subtracting from 1 gives the answer.
Average wait for a pattern
E = sum of 1 / P(start of pattern), for each start that also ends the pattern
For a fair coin, HH overlaps itself at lengths 1 and 2, so the wait is 2 + 4 = 6 flips. HT only overlaps at its full length, so the wait is 4 flips. The same idea gives 2^(k+1) − 2 flips for k heads in a row.
Testing a coin
p-value = sum of P(X = i) for every i no more likely than your result
This is the exact binomial test. The range for the coin's true chance of heads uses the Clopper-Pearson method, which is exact and a little cautious.
Worked examples
2 heads in 4 flips
The exact order HHTT has a 1/2 × 1/2 × 1/2 × 1/2 = 1/16 chance, which is 6.25%. But six orders give exactly 2 heads: HHTT, HTHT, HTTH, THHT, THTH and TTHH. So the chance of 2 heads in any order is 6/16, which is 37.5%.
How rare is a streak of 5 heads?
Starting from the first flip, 5 heads in a row has a 1 in 32 chance, about 3.13%. Give the streak room to start anywhere and the picture changes completely. In 20 flips, the chance of at least one run of 5 heads is 24.99%. In 100 flips it's 81.01%. On average you'll wait 62 flips for your first run of 5 heads.
If you'll accept a run of either side, it's even more likely. There's an 80.68% chance of seeing 6 of the same side in a row somewhere in 100 fair flips. That's why long streaks in real sequences are normal and not a sign something's wrong.
HH against HT
Both patterns have the same 1 in 4 chance on any two given flips, yet HH takes 6 flips to appear on average and HT takes only 4. The reason is what happens after a near miss. If you're waiting for HH and get HT, you're back to square one. If you're waiting for HT and get HH, the second H still counts as a start.
Penney's game
Two players each pick a 3-flip pattern and flip until one appears. If your opponent picks HHT, you should pick THH, which wins 3 times out of 4. Every 3-flip pattern can be beaten by another one, so the player who picks second always has the edge.
Is a coin that gave 60 heads in 100 flips biased?
If the coin were fair, a result at least as far from 50 as 60 heads would happen 5.69% of the time. That's just above the usual 5% cut-off, so it's not strong evidence of bias. The 95% range for the coin's true chance of heads runs from 49.72% to 69.67%, which still includes 50%.
Common coin odds
All figures assume a fair coin.
| Situation | Exact | Probability | About 1 in |
|---|---|---|---|
| Heads on one flip | 1/2 | 50% | 2 |
| 3 heads in 3 flips | 1/8 | 12.5% | 8 |
| At least 1 head in 3 flips | 7/8 | 87.5% | 1.14 |
| Exactly 5 heads in 10 flips | 63/256 | 24.61% | 4.06 |
| 10 heads in a row | 1/1,024 | 0.0977% | 1,024 |
| 20 heads in a row | 1/1,048,576 | 0.0000954% | 1,048,576 |
| Exactly 50 heads in 100 flips | 7.96% | 12.6 | |
| 60 or more heads in 100 flips | 2.84% | 35.2 | |
| A run of 3 heads somewhere in 10 flips | 65/128 | 50.78% | 1.97 |
| A run of 5 heads somewhere in 100 flips | 81.01% | 1.23 |
How real coins behave
The maths on this page assumes an ideal coin. Real coins come very close, with one twist. In 2007, Persi Diaconis, Susan Holmes and Richard Montgomery worked through the physics of a flipped coin and predicted that it lands on the same side it started on about 51% of the time, because a spinning coin wobbles and spends slightly longer with its starting face up.
A team led by František Bartoš then tested this with 350,757 real flips, published in the Journal of the American Statistical Association in 2025. Coins landed on the side they started on 50.8% of the time. They showed no lean towards heads or tails, though: 175,420 heads out of 350,757 flips is 50.01%. You can check that yourself with the "Is my coin fair?" mode.
For everyday use a coin flip is still as good as fair. If the result matters, don't let the caller see which side is facing up before the flip.
Mistakes that give the wrong answer
The gambler's fallacy. After 5 heads in a row, many people feel tails is "due". It isn't. The coin has no memory, so the next flip is still 50/50. What's rare is 6 heads in a row seen from the start (1 in 64), not one more head after 5 have already happened.
Mixing up order and count. "HHT" and "2 heads in 3 flips" are different questions with different answers: 1 in 8 against 3 in 8.
Treating "a streak somewhere" like "a streak from the start". These can differ enormously. 3.13% against 81.01% for 5 heads, as shown above.
Reading too much into small experiments. 16 heads in 20 flips looks alarming, and it is unusual for a fair coin. But testing many coins, or stopping as soon as a result looks odd, will turn up "biased" coins by chance alone.
How we calculate
Exact order, number of heads, streak and pattern results use exact whole-number arithmetic (JavaScript BigInt) whenever the numbers allow, so the fraction you see is exact. For very long runs of flips the calculator switches to high-precision decimals and stops showing the fraction. Percentages are rounded only at the last step.
Streak and pattern chances are worked out by following every flip in turn and tracking how much of the streak or pattern has been built so far. The race between two patterns is solved as a set of linear equations over those same states. The coin test uses the exact binomial test and the Clopper-Pearson interval.
The simulation button flips 10,000 sets of coins in your browser and counts how often your target happens. It lands close to the exact answer but rarely on it, and the result tells you the range to expect. Every number in the worked examples and tables on this page was checked against an independent calculation in Python. If you spot a mistake, let us know and we'll correct it and note the change here.
References
- Persi Diaconis, Susan Holmes and Richard Montgomery, "Dynamical Bias in the Coin Toss", SIAM Review, 49(2), 2007, pages 211 to 235.
- František Bartoš and colleagues, "Fair Coins Tend to Land on the Same Side They Started: Evidence from 350,757 Flips", Journal of the American Statistical Association, 2025.
- William Feller, An Introduction to Probability Theory and Its Applications, Volume 1, 3rd edition, Wiley, 1968. Covers success runs in detail.
- Charles Grinstead and J. Laurie Snell, Introduction to Probability, 2nd edition, American Mathematical Society, 1997.
Related calculators
- Binomial Probability Calculator, the general version of the number-of-heads maths for any number of trials
- Combinations and Permutations Calculator, which explains the C(n, k) term
- Card Probability Calculator, for draws where the deck changes after every card
- Probability Calculator, the full set of tools
Questions people ask
Is every sequence of coin flips equally likely?
Yes, with a fair coin. HHHHH has exactly the same chance as HTHTH: 1 in 32. What differs is how many sequences share a feature. Only one sequence is all heads, but ten have exactly 3 heads, so "3 heads" happens far more often than "5 heads".
After 5 heads in a row, is tails more likely?
No. Each flip is independent, so the next flip is still 50/50. Believing otherwise is called the gambler's fallacy.
What are the chances of a streak somewhere in my flips?
Much higher than most people guess. In 100 fair flips there's an 81.01% chance of at least one run of 5 heads, and an 80.68% chance of a run of 6 of the same side. Use the Streaks mode with "Anywhere in my flips" for your own numbers.
How do I work out the chance of at least one head?
Work out the chance of no heads at all, which is (1 − p) raised to the number of flips, and subtract it from 1. For 3 fair flips that's 1 − 1/8 = 7/8, or 87.5%.
How does a weighted coin change the answer?
Replace 0.5 with the coin's real chance of heads. The formulas stay the same. In Advanced mode, or by pressing "Weighted coin?", you can type it as 0.6, 60% or 3/5.
How can I tell if my coin is biased?
Flip it many times, then enter the number of flips and heads in the "Is my coin fair?" mode. A p-value below 5% suggests bias. With few flips, even a clearly unfair-looking result can happen by chance, so more flips give a more reliable answer.
Is a real coin flip really 50/50?
Almost. A study of 350,757 real flips found no lean towards heads or tails, but coins landed on the side they started on 50.8% of the time. For everyday decisions a coin flip is fair enough.