Coin Flip Probability Calculator

Find the probability of any heads/tails outcome in n flips — for fair or biased coins.

🎵 Coin Flip Probability Calculator
Number of Flips (n)
Number of Heads (k)
Head Probability (%)

🎵 What is Coin Flip Probability?

Coin flip probability is the study of outcomes when a coin is tossed one or more times. A fair coin has p = 0.5 for heads and 0.5 for tails on each flip. Each flip is an independent Bernoulli trial — the result of one flip does not affect any other. The total number of heads in n flips follows a binomial distribution with parameters n (number of trials) and p (probability of success per trial).

The binomial probability formula gives the exact probability of getting exactly k heads in n flips: P(X = k) = C(n, k) × pk × (1−p)n−k. C(n,k) is the binomial coefficient — the number of distinct arrangements of k heads among n flips. For example, with n=5 and k=3: C(5,3) = 10, so there are 10 ways to get exactly 3 heads in 5 flips.

Beyond basic probability, this calculator also computes streak probability: what is the chance of seeing at least s consecutive heads (or successes) in n flips? This is a more complex problem requiring dynamic programming, because streaks can start at any position. Streak probabilities are typically much higher than people expect — the human brain is poor at estimating how common long runs are in random sequences.

Coin flip models apply far beyond coin tossing. Any binary process with independent trials follows the same math: manufacturing defect rates, clinical trial success rates, binary option pricing, sports win/loss records, and reliability engineering all use the binomial distribution. A “biased coin” with p ≠ 0.5 models any such real-world process by adjusting the head probability.

📐 Formulas

P(X = k) = C(n, k) × pk × (1 − p)n−k
n = total flips  ·  k = desired heads  ·  p = P(heads) per flip
C(n,k) = n! / [k!(n−k)!] = “n choose k” (number of arrangements)
Example: n=10, k=3, p=0.5: P = C(10,3) × 0.5³ × 0.5⁷ = 120 × 1/1024 = 11.72%
P(at least k heads) = ∑i=kn P(X = i)
Also: P(X ≥ k) = 1 − P(X ≤ k−1)
Expected heads E[X] = n × p; Std Dev = √(np(1−p))
Streak probability computed via DP: P(streak ≥ s in n flips)
Uses O(n × s) dynamic programming — tracks states by current consecutive run length
Example: P(streak ≥ 5 in 20 fair flips) ≈ 25.2%

📖 How to Use This Calculator

Exact Count Mode

1
Enter n (total flips, 1–100) and k (desired heads, 0–n).
2
Set head probability (50 for a fair coin, or custom % for a biased coin).
3
Click Calculate to see P(exactly k), P(at least k), P(at most k), and expected heads.

Streak Mode

1
Enter n (total flips, up to 200) and s (minimum streak length).
2
Set success probability per flip (50% for fair coin).
3
Results: P(streak ≥ s), P(no streak of s), and P(exactly one run of s starting at a single fixed position = ps).

💡 Example Calculations

Example 1 — Exactly 5 Heads in 10 Flips

n=10, k=5, p=50% (fair coin)

1
C(10,5) = 252
2
P = 252 × 0.5⁵ × 0.5⁵ = 252 / 1024 ≈ 24.61%
P(exactly 5 heads) = 24.61%. P(at least 5) = 62.3%. Expected = 5 heads.
Try this example →

Example 2 — At Least 1 Head in 6 Flips

n=6, k=1, p=50%

1
P(no heads) = 0.5⁶ = 1/64 ≈ 1.5625%
2
P(at least 1) = 1 − 1/64 = 63/64 ≈ 98.44%
P(at least 1 head in 6 flips) = 98.44%. Almost certain.
Try this example →

Example 3 — Streak of 4 Heads in 15 Flips

n=15, streak=4, p=50%

1
Use dynamic programming to compute P(at least one run of 4 consecutive heads in 15 flips).
2
Result ≈ 31.8% — much higher than most people guess for just 15 flips.
P(streak ≥ 4 in 15 flips) ≈ 31.8%. Random streaks are common.
Try this example →

Example 4 — Biased Coin (70% Heads), 8 Flips, Exactly 6 Heads

n=8, k=6, p=70%

1
C(8,6) = 28
2
P = 28 × 0.7⁶ × 0.3² = 28 × 0.117649 × 0.09 ≈ 29.65%
P(exactly 6 heads) = 29.65%. Expected heads = 8 × 0.7 = 5.6. This is close to the mode.
Try this example →

Frequently Asked Questions

What is the probability of getting heads 3 times in 5 flips?
P(X=3) = C(5,3) × 0.5³ × 0.5² = 10 × 0.125 × 0.25 = 10/32 = 31.25%. There are C(5,3)=10 ways to arrange 3 heads among 5 flips, each with probability 0.5⁵ = 1/32. Use the Exact mode of this calculator with n=5, k=3, p=50%.
What is the probability formula for coin flips?
The binomial probability formula is P(X=k) = C(n,k) × p^k × (1−p)^(n−k), where n = number of flips, k = desired number of heads, p = probability of heads per flip, and C(n,k) = n! / (k!(n−k)!) is the binomial coefficient (number of ways to choose k from n).
What is the probability of getting all heads in 10 flips?
P(all 10 heads) = 0.5^10 = 1/1024 ≈ 0.098%. There is only 1 way to get all heads, and each flip independently has probability 0.5. This is C(10,10) × 0.5^10 × 0.5^0 = 1 × (1/1024) × 1 = 1/1024.
How likely is a streak of 5 heads in a row in 20 flips?
Approximately 25.2%. This is higher than most people intuit. Streaks are common in practice — the probability of at least one run of 5 consecutive heads in 20 fair coin flips is about 25%. Use the Streak mode of this calculator with n=20, s=5, p=50%.
What is the expected number of heads in n coin flips?
Expected heads = n × p. For a fair coin (p=0.5) and n=20 flips: expected = 20 × 0.5 = 10 heads. For a biased coin with p=0.3 and n=50 flips: expected = 50 × 0.3 = 15 heads. The expected value is the long-run average over many repetitions of the experiment.
What is the difference between exact, at-least, and at-most probability?
Exact P(X=k): probability of getting exactly k heads. At-least P(X≥k) = Σ P(X=i) for i from k to n: probability of k or more heads. At-most P(X≤k) = Σ P(X=i) for i from 0 to k: probability of k or fewer heads. Note: P(X≥k) + P(X≤k−1) = 1 and P(X≥k) + P(X≤k) = 1 + P(X=k).
How does a biased coin affect the probability?
A biased coin has p ≠ 0.5. For p=0.7 (weighted toward heads): P(5 heads in 5 flips) = 0.7^5 ≈ 16.8% vs 3.125% for a fair coin. The formulas are identical — just replace 0.5 with your p value. Use this calculator to explore how bias affects every outcome probability.
What is the gambler's fallacy?
The gambler's fallacy is the mistaken belief that if heads has appeared many times in a row, tails is 'due.' In reality, each coin flip is independent — a fair coin has exactly 50% chance of heads on every flip, regardless of previous results. Past outcomes do not influence future independent flips. The probability of the next flip is always p, no matter what came before.
How do I find the probability of at least one head in n flips?
P(at least 1 head) = 1 − P(no heads) = 1 − (1−p)^n. For a fair coin: n=1: 50%; n=5: 1−0.5^5 = 96.875%; n=10: 1−0.5^10 = 99.9%. Use the at-least mode with k=1 in this calculator, or note that it equals 1 minus the probability of all tails.
What is the normal approximation for coin flip probability?
For large n, the binomial distribution is approximated by the normal distribution: X ~ N(np, np(1−p)). Example: n=100 fair flips — mean=50, SD=√25=5. P(45 ≤ X ≤ 55) ≈ P(−1 ≤ Z ≤ 1) ≈ 68.27%. The approximation is good when np ≥ 5 and n(1−p) ≥ 5. For exact small-n results, use the binomial formula in this calculator.