Coin Flip Probability Calculator

Coin flip probability calculator for any number of flips up to 10,000.

Science n up to 10,000 Log-gamma PMF
Rate this calculator · 3.0 (1)

Coin Flip Probability Calculator

binomial distribution · fair or biased · P(=k), P(≥k), P(≤k) · mean & SD

Instructions — Coin Flip Probability Calculator

1

Set the number of flips

Type the total number of flips (n) in the first field. The calculator handles n from 1 up to 10,000 using a log-space binomial probability function (Lanczos log-gamma), so the answers stay accurate when direct factorial arithmetic would overflow.

2

Enter the desired heads count

The second field is k, the number of heads you care about. k must sit between 0 and n. For n = 10 and k = 5 (the classic example) the result is 24.61% — the most likely single outcome on a fair coin, but only one of eleven possible head counts.

3

Switch to a biased coin if needed

The default is a fair coin with P(heads) = 0.5. Toggle "Biased" to enter a custom probability between 0 and 1. The same binomial machinery applies; only the per-flip probability changes. A coin with p = 0.6 over 100 flips has an expected value of 60 heads and a standard deviation of about 4.9.

P(X = k) is just one value; the cumulative P(X ≤ k) and P(X ≥ k) are usually what you want for "is this result unusual?" questions.
The standard deviation for n flips of a fair coin is √(n/4). For n = 100 that is 5, so the typical range is 40 to 60 heads (± 2 SD covers about 95% of outcomes).

Formulas

Coin flips are the canonical Bernoulli process: each flip is independent and either succeeds (heads) or fails (tails) with fixed probability p. The number of heads in n flips follows the binomial distribution.

Binomial PMF
$$ P(X = k) = \binom{n}{k} p^k (1-p)^{n-k} $$
The probability of exactly k heads in n independent flips with per-flip probability p. The binomial coefficient counts the number of orderings; the powers give the probability of any one ordering.
Binomial coefficient
$$ \binom{n}{k} = \frac{n!}{k!\,(n-k)!} $$
For n = 10 and k = 5, that is 252 orderings. The calculator computes this through log-gamma to avoid overflow at large n.
Cumulative (at most k)
$$ P(X \leq k) = \sum_{i=0}^{k} \binom{n}{i} p^i (1-p)^{n-i} $$
Add up the PMF for 0, 1, …, k. The complement gives P(X > k); subtract from one to get P(X ≥ k+1).
Expected value
$$ E[X] = np $$
Mean number of heads. For a fair coin (p = 0.5), this is n/2. The law of large numbers says the proportion of heads converges to p as n grows.
Variance and SD
$$ \mathrm{Var}(X) = np(1-p), \quad \sigma = \sqrt{np(1-p)} $$
SD shrinks like √n. Doubling the flip count from 100 to 200 only multiplies the SD by √2, so the relative SD (SD over mean) shrinks as 1/√n — the basis of the law of large numbers.
Normal approximation
$$ X \stackrel{\text{approx}}{\sim} \mathcal{N}\!\bigl(np,\, np(1-p)\bigr) $$
For large n with np > 5 and n(1−p) > 5 (rule of thumb), the binomial is well approximated by a normal distribution with the same mean and variance. The 68-95-99.7 rule then applies.

Reference

Fair coin: 10 flips, probability of each head count
k headsP(X = k)P(X ≥ k)P(X ≤ k)
00.10%100.00%0.10%
10.98%99.90%1.07%
24.39%98.93%5.47%
311.72%94.53%17.19%
420.51%82.81%37.70%
524.61%62.30%62.30%
620.51%37.70%82.81%
711.72%17.19%94.53%
84.39%5.47%98.93%
90.98%1.07%99.90%
100.10%0.10%100.00%

Fair coin streak odds

Probability of getting all heads (or all tails) in a row. Each flip multiplies by 0.5, so the probability halves with each extra flip.

k heads in a row
kProbability
225.00%
312.50%
53.125%
70.781%
100.098%
150.00305%
209.5e-7
SD for n fair flips
n flipsσ = √(n/4)
41.00
162.00
1005.00
40010.00
1,00015.81
10,00050.00

Karl Pearson flipped a coin 24,000 times in 1900 and recorded 12,012 heads (50.05%). The deviation of 12 heads from the expected 12,000 is well within one standard deviation (SD = 77.5 for n = 24,000), exactly as the binomial model predicts.

Article — Coin Flip Probability Calculator

Coin flip probability: a practical guide to the binomial distribution

A coin flip probability calculator applies the binomial distribution to count outcomes across n independent flips. For a fair coin and 10 flips, the probability of exactly 5 heads is 24.61 percent — the most likely single outcome, but only one of eleven possible head counts. The calculator above uses a log-gamma implementation of the binomial PMF (the same approach used by R's dbinom and Python's scipy.stats.binom) so it stays accurate from n equals 1 up to n equals 10,000.

The coin flip is the simplest example of a Bernoulli process: independent trials, two outcomes, fixed per-trial probability. Everything statistical about coin flips generalises to A/B tests, manufacturing defect counts, medical-trial responder rates and binary survey outcomes. Understanding the binomial here means understanding the binomial everywhere.

What the coin flip probability calculator does

Enter the number of flips (n) and the desired heads count (k). The calculator returns three probabilities: P(X equals k) for exactly k heads, P(X at least k) for k or more, and P(X at most k) for k or fewer. It also returns the expected value (n times p), the variance and the standard deviation, plus the equivalent odds expression for the exact-k probability.

The fair coin toggle assumes p equals 0.5. The biased toggle takes a custom per-flip probability between 0 and 1. The same binomial formula applies; only p changes. For n equals 100 and p equals 0.6, the expected number of heads is 60 and the standard deviation is approximately 4.9, so the typical range is roughly 50 to 70 heads.

The math, in one line
P(X = k) = C(n,k) * p^k * (1-p)^(n-k)
E[X] = n*p Var(X) = n*p*(1-p)
SD = sqrt(n*p*(1-p))

How to compute coin flip probability by hand

For 10 fair flips and k equals 5: C(10, 5) equals 252 (the number of ways to arrange 5 heads among 10 positions). Each specific arrangement has probability 0.5 to the tenth, which is 1 divided by 1,024. So P(X equals 5) equals 252 divided by 1,024, which is approximately 0.2461 or 24.61 percent. The same arithmetic works for any k: C(10, 0) equals 1 (only one way to get all tails) so P(X equals 0) equals 1 divided by 1,024 equals 0.098 percent.

For larger n the binomial coefficient grows fast. C(100, 50) is approximately 1.0 times 10 to the 29th — too large for direct factorial computation in standard floating point. The calculator computes everything in log space using a Lanczos approximation to the log-gamma function. This is the standard numerical approach in R, SciPy and Numerical Recipes; it keeps the answers accurate to about 12 significant digits up to n equals 10,000.

Did you know

The statistician Karl Pearson flipped a coin 24,000 times in 1900 and recorded 12,012 heads (50.05 percent). The deviation from the expected 12,000 was 12 heads. The standard deviation for n equals 24,000 fair flips is the square root of 6,000, approximately 77.5, so 12 is well within one standard deviation. Pearson's data is still used in introductory statistics courses to illustrate the law of large numbers. He also coined the term "histogram" and founded the Biometrika journal.

Fair versus biased coin

A fair coin has p equals 0.5. A real coin is close but not exactly. A 2007 paper by Diaconis, Holmes and Montgomery showed that a vigorously tossed coin caught in the hand has a small bias toward landing on the same side it started, around 51 to 49. The bias vanishes when the coin bounces. For practical purposes, a household coin is fair.

Truly biased coins are easier to find in casinos than in pockets. Weighted dice, loaded roulette wheels and rigged slot machines all behave like biased Bernoulli trials with p far from 0.5. The same binomial formula applies; only the input p changes.

Coin flip probability and the law of large numbers

The law of large numbers says the observed proportion of heads converges to the true p as n grows. Convergence is slow: the standard deviation of the proportion shrinks like one over the square root of n. Going from 100 to 10,000 flips reduces the standard error tenfold, not a hundredfold. To pin the proportion within 0.1 percentage points at 95 percent confidence, you need about a million flips.

This is why polling research uses sample sizes around 1,000: that gives a margin of error around 3 percent. To halve the error you need 4 times the sample. The same calculus governs A/B testing.

Tip

For a fair coin the SD of the number of heads is √(n/4). For n = 100 that is 5, so 95 percent of trials land between 40 and 60 heads. For n = 10,000 the SD is 50; 95 percent of trials are between 9,900 and 10,100. The variance grows with n, but the proportion converges — the law of large numbers in one line.

Cumulative binomial probability

P(X equals k) is one number; the cumulative versions are usually more interesting. P(X at least 7) in 10 fair flips is about 17.19 percent. P(X at most 3) is also 17.19 percent (the distribution is symmetric for a fair coin).

Hypothesis tests on coin flips use the same machinery. If you flip 100 times and get 60 heads, is the coin biased? P(X at least 60 given p equals 0.5) is approximately 2.84 percent. At alpha equals 0.05 you reject the null of fairness; at alpha equals 0.01 you do not.

Expected value and standard deviation of coin flips

Expected number of heads is n times p. For 100 fair flips that is 50. Variance is n times p times one minus p, which is 25; SD is 5. The empirical rule applies approximately as n grows: plus or minus one SD covers about 68 percent of trials, plus or minus two SD covers 95 percent.

Real-world uses of the binomial model

A/B testing uses the binomial directly. Each visitor is a Bernoulli trial; conversion is heads, no-conversion tails. Clinical trials, manufacturing quality control and reliability engineering all run on the same machinery — binary outcomes accumulated across independent trials.

Genetics uses it for Mendelian inheritance — each child is a Bernoulli trial on each gene. Cryptography uses fair-coin assumptions to bound brute-force attack success. Anywhere you have independent trials with fixed binary outcomes, the binomial is the right model.

Common coin flip probability mistakes

The most common mistake is the gambler's fallacy: thinking past flips affect future ones. They do not. After five heads in a row, the next flip is still 50/50. The 1913 Monte Carlo Casino night when black hit 26 times consecutively at roulette is the canonical example — bettors lost millions on the false belief that red was due. The second common mistake is confusing P(X equals k) with P(X at least k); the cumulative versions are what most questions actually ask about. The third is using normal-distribution approximations for small n with p far from 0.5; the rule of thumb is np greater than 5 and n times one minus p greater than 5 before trusting the normal approximation.

FAQ

For a fair coin, P(X = 5) = 24.61%. The formula is C(10, 5) × 0.5⁵ × 0.5⁵ = 252 × (1÷1024) ≈ 0.2461. This is the most likely outcome — getting exactly five heads happens about one time in four. The 11 other possible head counts share the remaining 75.39%.
About 37.70%. Add the PMF for k = 6, 7, 8, 9, 10: roughly 20.51% + 11.72% + 4.39% + 0.98% + 0.10%. The distribution is symmetric for a fair coin, so P(X ≥ 6) equals P(X ≤ 4); both are 1 − P(X = 5) divided by two, plus the boundary.
Use the same binomial formula but substitute your p. For p = 0.6 and (n, k) = (10, 7), the probability is C(10, 7) × 0.6⁷ × 0.4³ = 120 × 0.02799 × 0.064 ≈ 21.50%. Toggle the calculator to "Biased" and enter your p; the answer updates as you type.
E[X] = np. For a fair coin and 100 flips that is 50 heads. For a biased coin with p = 0.7 and 50 flips, 35 heads. Expected value is the long-run average, not a guarantee for any single trial.
The mistaken belief that past coin flips affect future ones. If a fair coin lands heads five times in a row, the next flip still has P(heads) = 0.5. The coin has no memory. The fallacy is named after the 1913 Monte Carlo Casino night when black came up 26 times in a row at roulette — bettors lost millions betting that red was "overdue".
As the number of flips grows, the observed proportion of heads converges to the true probability. With 10 flips you might see 30% or 70% heads; with 1,000 flips you will be close to 50%; with 100,000 flips, very close. Karl Pearson's 24,000-flip experiment in 1900 produced 50.05% heads, almost exactly as predicted.
For a fair coin, (0.5)¹⁰ = 1/1,024 ≈ 0.0977%. The odds are 1 to 1,023. Rare on any given attempt, but if you ran 1,024 trials of 10 flips each, you would expect to see one all-heads run on average — the binomial distribution exactly predicts this.
A common rule of thumb is np ≥ 5 and n(1−p) ≥ 5. For a fair coin, that means n ≥ 10. The approximation gets better as n grows; for n = 1,000 the binomial is indistinguishable from the matching normal in most plots.
Direct factorial arithmetic overflows above n = 170 in standard floating point. The calculator computes the PMF in log space using a Lanczos approximation to the log-gamma function, the standard approach in R, SciPy and Numerical Recipes. The result is accurate to roughly 12 significant digits for n up to 10,000.
Probability is a fraction of all outcomes: P(heads) = 0.5 means 50% of trials. Odds compare favourable to unfavourable: odds of heads on a fair coin are 1 to 1 (equally likely). For P = 0.25, odds are 1 to 3. The formula is odds = P ÷ (1 − P). Betting markets typically quote odds; statistics quotes probability.