Coin Flip Probability Calculator

Exact probability of getting a given number of heads in n flips — for a fair or biased coin — plus the odds of a streak of k in a row. Full distribution chart and show/hide step-by-step working.

Streak probability

Probability of getting a run of k consecutive heads (or tails) somewhere within n flips.

What is coin flip probability?

A coin flip is the simplest possible random experiment: two outcomes (heads or tails), equally likely on a fair coin, and every flip independent of every other flip. That independence is what makes it the textbook example for the binomial distribution — the exact probability model for the number of "successes" in a fixed number of independent yes/no trials with a constant success probability.

Coin-flip probability, piece by piece

Exact probability of k heads

Coin flips are independent Bernoulli trials with a fixed probability p of heads. The number of heads in n flips follows a Binomial(n, p) distribution, whose PMF combines the binomial coefficient with the probabilities of the required heads and tails.

P(X = k)
= C(n
k) · pk · (1 − p)n − k
nnumber of flips·knumber of heads you want·pprobability of heads on any single flip·C(n, k)number of ways to arrange k heads among n flips
HP = pTP = 1 − p
Example
Given
n = 10
k = 5
p = 0.5
Substitute
C(10,5) · 0.5⁵ · 0.5⁵ = 252 / 1024
Answer
0.2461 (≈ 24.6%)

At least / at most k heads

Real questions usually ask 'k or more' or 'k or fewer' heads, which sums point probabilities across a range. The bar chart to the right shows every P(X = i) for n = 10 flips — adding up the bars from k to n gives P(X ≥ k), and from 0 to k gives P(X ≤ k).

P(X ≥ k) = Σi=k..n P(X = i)
P(X ≥ k)at least k heads·P(X ≤ k)at most k heads (0 through k)
n = 10 flips, k = 0 … 10 heads
Example
Given
n = 10
k = 7
p = 0.5
Substitute
(120 + 45 + 10 + 1) / 1024
Answer
P(X ≥ 7) ≈ 0.1719

Mean and variance

The expected number of heads is simply n·p, and the variance is n·p·(1 − p). For a fair coin this simplifies to n/2 and n/4 — so the standard deviation grows only as √n, which is why long runs of flips still cluster tightly around 50% heads.

μ = n · p  ·  σ²
= n · p · (1 − p)
μexpected number of heads·σ²variance of the head count
n = 10 flips, k = 0 … 10 heads
Example
Given
n = 100
p = 0.5
Substitute
μ = 100·0.5, σ²
= 100·0.5·0.5
Answer
μ = 50, σ
= 5

Probability of a streak

The chance of seeing a run of k or more consecutive heads (or tails) somewhere inside n flips is not just k · pᵏ — the possible starting positions overlap. This calculator uses the exact recurrence, so short runs in long sequences come out visibly more common than most people guess.

P(streak ≥ k in n flips) = 1 − Qn  (no-run recurrence)
Q_nprobability of no run of length k in n flips·ktarget streak length·nnumber of flips
THHHTHTHHTlooking for a run of 3+ heads
Example
Given
n = 20 fair flips
k = 5
Substitute
1 − Q₂₀ (recurrence)
Answer
≈ 0.25 (much higher than 5·0.5⁵ = 0.156)

Why streaks are more common than people expect

A single 5-heads-in-a-row block has probability (1/2)5 = 1/32 ≈ 3.13%. So people intuitively expect a 5-heads streak to be rare — and in a specific 5-flip window it is. But if you flip a fair coin 20 times, you get 16 overlapping windows where a length-5 streak could start (flips 1–5, 2–6, 3–7, …, 16–20). Those windows overlap, so we can't just multiply 16 × 3.13% — but the actual probability that at least one streak of 5 heads appears somewhere in those 20 flips is about 25%, roughly one in four.

That's the gambler's-fallacy trap in reverse: people expect streaks to be rare because a single specific streak is rare, but in a long enough sequence some streak is almost inevitable. The coin is not "on a hot streak" and it is not "due" for tails — it simply has no memory. Independence means each flip has probability p regardless of history, and streaks fall out as a mathematical consequence.

Common mistakes

  • The gambler's fallacy. A run of tails does not make heads more likely on the next flip. The coin has no memory; each flip is independent.
  • Confusing P(exactly k) with P(at least k). They are very different once k moves away from n/2. Always match the question to the right one.
  • Assuming the "average" is the most likely single value. The mean of 10 fair flips is 5 heads, and 5 is the most likely value here — but its probability is still only ~24.6%. In most flips you'll see something other than the mean.
  • Multiplying overlapping streak windows. The chance of at least one length-5 streak in 20 flips is NOT 16 × (1/32). Overlaps make the true probability harder — use the streak tool above (or the DP behind it).

Features of this calculator

  • Exact probability of exactly, at least, and at most k heads in n flips.
  • Fair coin (p = 0.5) by default, with a toggle for any biased probability between 0 and 1.
  • Streak sub-tool: probability of a run of k consecutive heads (or tails) somewhere within n flips — computed exactly, not simulated.
  • Full binomial distribution bar chart from 0 to n heads with your target highlighted.
  • Mean μ = n·p, variance σ² = n·p·(1 − p) and standard deviation printed alongside.
  • Show/hide step-by-step working — including the binomial coefficient and the formula substituted.
  • Copy the summary as text or download the result panel as a PNG.

Frequently asked questions

+What is the probability of getting 3 heads in 5 flips?

C(5, 3) / 25 = 10 / 32 = 5/16 ≈ 31.25%.

+What is the probability of 10 heads in a row?

(1/2)10 = 1/1024 ≈ 0.098%, or roughly one in a thousand for that exact 10-flip sequence.

+How does this differ from a coin flip simulator?

A simulator generates random flips — you'll see sampling variation. This calculator returns the true probability computed from the binomial formula (or the run-length DP for streaks). No sampling error.

+Can I model an unfair coin?

Yes — untick the fair-coin toggle and enter any p between 0 and 1. Every probability, mean and streak result adjusts automatically.

+What if I want probability of tails instead?

For the binomial tool, use k = n − (target tails) and p = 0.5 (or 1 − p for a biased coin). For the streak tool, switch the toggle to tails.

+How large an n does the calculator handle?

Up to n = 2000. The formula uses log-gamma so probabilities stay numerically stable even for large n and extreme k.

Related calculators