What this calculator does
This tool computes the probability of obtaining exactly k heads in n coin flips. It uses the binomial probability distribution, which models the number of successes in a fixed number of independent yes/no trials. By default it assumes a fair coin (probability of heads p = 0.5), but you can enter any head probability between 0 and 1 to model a biased coin.
How to use it
Enter the total number of flips n, the target number of heads k (where k can be 0 up to n), and the probability of heads p on a single flip. The calculator returns the exact probability as both a decimal and a percentage, plus the number of distinct ways C(n,k) those heads can land.
The formula explained
The binomial probability of exactly k successes is:
$$P(X = k) = \binom{n}{k} \, p^{\,k} \left(1 - p\right)^{n - k}$$
Here \(C(n,k) = n! / (k!(n-k)!)\) is the binomial coefficient — the number of ways to choose which k of the n flips are heads. The term \(p^{k}\) is the chance those chosen flips are all heads, and \((1-p)^{n-k}\) is the chance the rest are tails. For a fair coin (p = 0.5) this reduces to \(P = C(n,k) \times 0.5^{n}\).
Worked example
What is the probability of getting exactly 5 heads in 10 fair coin flips? \(C(10,5) = 252\), and \(0.5^{10} = 1/1024 \approx 0.0009766\). So $$P = 252 \times 0.0009766 \approx 0.2461,$$ or about 24.6%. This is the single most likely outcome, yet it still happens less than a quarter of the time.
FAQ
Why is exactly half heads not 50%? Because all the other outcomes (4, 6, 7 heads, etc.) share the remaining probability. Getting precisely \(k = n/2\) is just the peak of a spread-out distribution.
Can k be larger than n? No. You cannot get more heads than the number of flips, so the probability is 0 whenever k exceeds n.
How do I model a biased coin? Set p to the true head probability — for example, 0.6 for a coin that lands heads 60% of the time.