Coin Flip Probability Calculator

Find the exact probability of getting a given number of heads in n coin flips using the binomial formula P = C(n,k)·pk·(1−p)n−k. Works for fair or biased coins.

Quick Facts

Method
Binomial distribution: P(X=k) = C(n,k)·pk·(1−p)n−k
Each flip is independent; a fair coin uses p = 0.5. Expected heads = n·p.

Your Results

Calculated
P(exactly k heads)
-
P(X = k)
P(at least k heads)
-
P(X ≥ k)
P(at most k heads)
-
P(X ≤ k)
Expected heads
-
Mean = n·p

Ready

Enter n, k, and p, then press Calculate.

How coin flip probability works

A sequence of coin flips is the textbook example of a binomial experiment: a fixed number of independent trials (n flips), each with two outcomes (heads or tails) and the same probability of heads on every trial (p). If you want the chance of getting exactly k heads in n flips, the answer is the binomial probability mass function:

P(X = k) = C(n, k) · pk · (1 − p)n − k

Here C(n, k) = n! / (k! · (n − k)!) is the binomial coefficient — the number of distinct orderings in which k heads can appear among n flips. The term pk is the probability of the k heads and (1 − p)n − k is the probability of the remaining tails. Multiplying the count of arrangements by the probability of one arrangement gives the total probability. For a fair coin p = 0.5, so the formula simplifies to P(X = k) = C(n, k) / 2n.

Worked example: 5 heads in 10 flips

With n = 10, k = 5, and a fair coin (p = 0.5): C(10, 5) = 252, and 210 = 1024, so P = 252 / 1024 = 0.24609 ≈ 24.6%. Five heads is the single most likely count, yet it still occurs less than a quarter of the time — because the ten other possible counts (0–4 and 6–10) split up the remaining ~75%. This surprises many people and is a good reminder that "the most likely outcome" is not the same as "a likely outcome."

Exactly, at least, and at most

  • Exactly k: use the formula above directly.
  • At most k: P(X ≤ k) = Σi=0..k C(n, i) · pi · (1 − p)n − i — add up the exact probabilities from 0 heads through k heads.
  • At least k: P(X ≥ k) = Σi=k..n C(n, i) · pi · (1 − p)n − i, or equivalently 1 − P(X ≤ k − 1). Using the complement is usually easier than summing many terms.

The calculator above reports all three plus the expected number of heads, the mean of the distribution, which is simply μ = n · p (5 for ten fair flips). The spread is measured by the standard deviation σ = √(n · p · (1 − p)) = √2.5 ≈ 1.58 heads for that case.

Reference values for a fair coin

  • P(exactly 1 head in 1 flip) = 1/2 = 50%.
  • P(2 heads in a row) = 1/4 = 25%; P(3 in a row) = 1/8 = 12.5%; P(10 in a row) = 1/1024 ≈ 0.098%.
  • P(exactly 2 heads in 3 flips) = 3/8 = 37.5%.
  • P(at least 1 head in 10 flips) = 1 − (1/2)10 = 1023/1024 ≈ 99.9%.
  • P(0 heads in 4 flips, i.e. all tails) = 1/16 = 6.25%.

Independence and the gambler's fallacy

Every flip is independent: the coin has no memory, so a run of heads does not "owe" you tails. After ten heads in a row, the eleventh flip is still 50/50. What the law of large numbers actually says is that the proportion of heads converges toward p as n grows, not that short-run streaks get corrected. A related mistake is assuming a specific ordering (HHHHH) is rarer than a mixed one (HTHTH) — for a fair coin both exact sequences have identical probability (1/32); mixed counts are more likely only because more orderings produce them.

Frequently Asked Questions

What is the probability of getting exactly 5 heads in 10 flips?
For a fair coin, P = C(10,5) · 0.510 = 252/1024 = 0.24609, or about 24.6%. It is the most likely single count but still happens less than a quarter of the time.
If I flip 5 heads in a row, is tails "due" on the next flip?
No. Flips are independent, so the next flip is still exactly 50% heads and 50% tails regardless of the streak. Expecting a correction is the gambler's fallacy. The probability of the streak before you start flipping is low (1/32 for five specific heads), but once four have landed, the fifth is unaffected by them.
How do I handle a biased or weighted coin?
Set p to the coin's true probability of heads (for example 0.6 for a coin that lands heads 60% of the time). The binomial formula still applies; only p changes. The expected number of heads becomes n · p and the distribution shifts toward the more likely side.
Why isn't the probability of "at least half heads" exactly 50%?
For an even n like 10, the outcome exactly at the mean (5 heads) sits in the middle, so P(X ≥ 5) = 0.623 and P(X ≤ 5) = 0.623 — they overlap at the 5-head case and each exceed 50%. Only P(X ≥ 6) versus P(X ≤ 4) are symmetric at about 37.7% each. The middle bin gets counted in both "at least" and "at most."