Free tool

Coin Flip Probability Calculator

Odds of exact counts, "at least" outcomes and streaks.

Heads in n flips

Exactly k heads
At least k heads
At most k heads

Odds of a streak

Chance of at least one run of that many heads in a row:

–

Advertisement

How the math works

Each fair flip has two equally likely outcomes, so the number of heads in n flips follows a binomial distribution. The chance of exactly k heads is C(n,k) ÷ 2n, where C(n,k) counts the ways to choose which flips land heads.

Streaks are less intuitive. In 100 flips, a run of 6 or more heads happens more often than not. That is why real random sequences look "streakier" than people expect and why the gambler's fallacy is so persuasive.

A step-by-step worked example

Take 10 flips and ask for exactly 7 heads. First count the outcomes. Ten flips give 2 to the power of 10, or 1,024, equally likely sequences. Next count the sequences with exactly 7 heads. That is C(10,7), the number of ways to choose which 7 of the 10 flips are heads, which works out to 10 x 9 x 8 divided by 3 x 2 x 1, or 120. Divide 120 by 1,024 and you get about 11.7%.

For "at least 7", add the counts for 7, 8, 9 and 10 heads: 120 + 45 + 10 + 1 = 176. Divide by 1,024 for about 17.2%. "At most 7" is everything except 8, 9 and 10 heads, so it is 1 minus 56 / 1,024, or about 94.5%. The calculator does this addition for you, for up to 1,000 flips.

What the inputs mean

In the first panel, n is the total number of flips and k is the number of heads you are asking about. Exactly means k heads and no other count. At least means k or more. At most means k or fewer. Because heads and tails are symmetric, the chance of k heads always equals the chance of k tails, so you can use the same numbers for tails.

In the streak panel, the number of flips is the length of the whole sequence and the streak length is the run of heads in a row you are asking about. The answer is the chance that at least one such run appears anywhere in the sequence. A run longer than your target counts too, so a run of eight heads also satisfies a target of seven.

How the streak odds are calculated

Streaks cannot be worked out with a single formula like C(n,k), because runs overlap and can occur anywhere. The calculator instead steps through the sequence one flip at a time, tracking the chance of being in a current run of length 0, 1, 2 and so on, up to the target. Each flip either extends the run with heads or resets it to zero with tails. Once a run reaches the target, that probability is moved to a "streak happened" total. The result is exact, not a simulation.

Some results: in 10 flips the chance of at least three heads in a row is about 50.8%. In 20 flips, four in a row is about 47.8%. In 100 flips, seven heads in a row is about 31.8%, but a run of seven of the same side, heads or tails, rises to about 54.2%. Keep that difference in mind, because the calculator counts heads only.

Advertisement

Waiting times and Penney's game

A related question is how many flips you need, on average, to see a given streak. For a run of r heads the answer is 2 to the power of r+1, minus 2. Three heads in a row takes 14 flips on average and five in a row takes 62. Patterns that look equally likely can have different waiting times. You wait on average 6 flips for heads-heads but only 4 for heads-tails, because a failed attempt at heads-tails still leaves you holding the first head. This idea is the basis of Penney's game, where the second player can always choose a three-flip pattern that is more likely to appear first.

Common mistakes

Confusing "exactly" with "at least" is the classic slip. The chance of exactly 60 heads in 100 flips is about 1.1%, but the chance of at least 60 is about 2.8%. Another is entering a value of k larger than n, which has no meaning. A third is reading a tiny percentage as zero. For long sequences the calculator can show values well under 0.1%, which is rare but still possible.

Frequently asked questions

What is the probability of 7 heads in 10 flips?

Exactly 7 heads: 120 ÷ 1,024 ≈ 11.7%. At least 7 heads: 176 ÷ 1,024 ≈ 17.2%.

Does a streak make the next flip more likely to be tails?

No. Coins have no memory; every flip is 50/50. Believing otherwise is called the gambler's fallacy.

How many flips does it take on average to get 3 heads in a row?

14 flips on average. The general rule for r heads in a row is 2 to the power of r+1, minus 2.

What is the probability of exactly 50 heads in 100 flips?

About 7.96%. It is the single most likely count, but most tosses of 100 coins land on some other number.

What are the chances of 7 heads in a row in 100 flips?

About 31.8% for heads specifically. A run of seven of either side appears about 54.2% of the time.

More tools

Advertisement