Statistics
Coin flip probability calculator
Work out the chance of getting a given number of heads when you flip a coin n times. Pick exactly, at least, at most or a range, and set P(heads) if the coin is not fair.
0.5 for a fair coin. Decimal, fraction or percentage.
Show the working, step by step
The number of heads X in 10 independent flips is binomial with n = 10 and p = 0.5.
P(X = x) = C(10, x) × 0.5x × 0.510 − x
Add the probabilities of every head count in the event:
P(X ≥ 7) = Σ P(X = x) for x = 7 … 10 = 1 − P(X ≤ 6) = 0.171875
With a fair coin every one of the 210 = 1,024 sequences is equally likely, so this is also a count:
176 ÷ 1,024 = 0.171875
C(n, x) counts the orders in which x heads can appear among n flips.
The formula
The number of heads X in n independent flips, each landing heads with probability p, is binomial:
P(X = k) = C(n, k) × pᵏ × (1 − p)ⁿ⁻ᵏ, C(n, k) = n! ÷ (k! (n − k)!)
C(n, k) counts the sequences with exactly k heads, and pᵏ(1 − p)ⁿ⁻ᵏ is the probability of any one of them. “At least”, “at most” and “between” add these terms over the counts in the range. For a fair coin every sequence has probability (½)ⁿ, so the answer is simply the number of favourable sequences divided by 2ⁿ.
A worked example
The default asks for the chance of at least 7 heads in 10 flips of a fair coin. Add the counts of sequences with 7, 8, 9 and 10 heads:
C(10, 7) + C(10, 8) + C(10, 9) + C(10, 10) = 120 + 45 + 10 + 1 = 176
P(X ≥ 7) = 176 ÷ 1024 = 0.1719
So about 17% of the time, 10 fair flips give 7 or more heads. On its own, exactly 7 heads has probability 120 ÷ 1024 = 0.1172. By symmetry, at most 3 heads is also 176 ÷ 1024.
Now make the coin biased with P(heads) = 0.6. The same question gives 0.3823, more than double, because each extra head is now more likely than a tail. The expected number of heads moves from 5 to 6.
Interpreting the result
The chart shows every possible count of heads, with the bars in your event drawn solid. Its peak sits at n × p and its width is set by the standard deviation √(n p (1 − p)). A probability below about 0.05 means the outcome would be surprising for a coin with the p you entered; that is the logic of a one-sided binomial test. If you are checking whether a real coin is fair, 7 heads in 10 is nowhere near enough evidence: it happens one time in six.
For large n the binomial is close to a normal curve with the same mean and SD, but the calculator sums the exact binomial terms, so there is no continuity correction to worry about.
Mean and spread of the number of heads
The cells under the result give the expected number of heads, n × p, and its standard deviation, √(n p (1 − p)). For 10 fair flips that is 5 ± 1.58. For 100 fair flips it is 50 ± 5, so 60 or more heads is two standard deviations high and has probability 0.028. Scaling up makes the proportion of heads steadier while the count itself spreads out further, which is the law of large numbers at work.
Common mistakes
- Forgetting the C(n, k) term. The chance of 2 heads in 3 flips is 3 × ⅛ = ⅜, not ⅛, because HHT, HTH and THH all count.
- Mixing up “at least 7” and “more than 7”. At least 7 includes 7; more than 7 starts at 8.
- Adding probabilities across separate sets of flips as if they were one set. The chance of at least one head in two separate 3-flip rounds is not ⅞ + ⅞.
Common questions
What is the probability of getting exactly 5 heads in 10 flips?
C(10, 5) ÷ 2¹⁰ = 252 ÷ 1024 = 0.2461, about 24.6%. Even the single most likely outcome happens less than a quarter of the time, because the probability is spread over 11 possible counts.
What is the probability of getting at least one head?
Use the complement: P(at least one head) = 1 − P(no heads) = 1 − (½)ⁿ. For 3 flips that is 1 − 1/8 = 0.875; for 10 flips it is 1 − 1/1024 = 0.999. Choose “At least k heads” with k = 1 to get it from the calculator.
Does the order of heads and tails matter?
Not for these probabilities. The calculator counts heads regardless of order, which is why the C(n, k) term appears: it counts the orders. Any one particular sequence, such as HTHHT, has probability (½)⁵ = 1/32, the same as HHHHH.
How do I handle a biased coin?
Change P(heads). A coin that lands heads 60% of the time has p = 0.6, and the formula becomes C(n, k) × 0.6ᵏ × 0.4ⁿ⁻ᵏ. You can type the probability as 0.6, 60% or 3/5.
Can I use this for things other than coins?
Yes, for anything with two outcomes, a fixed chance of success and independent trials: free throws, defective parts, yes/no survey answers. The binomial distribution calculator covers the same maths with general labels.
Related calculators
-
Coin flipper
Flip real random coins and tally the result.
-
Coin toss streak calculator
The chance of k heads in a row somewhere in n tosses.
-
Binomial distribution
Mean, variance and probabilities for any binomial.