Binomial Distribution Calculator
Type the number of trials, the chance of success and k. Get P(X = k), at most, at least, fewer and more than k, the mean and SD, a bar chart and the working, up to 10,000 trials.
Type p as a decimal (0.5), a percent (50%), a fraction (1/2) or “1 in 6”.
Like 0.9, 90% or 9/10. You get the smallest k with P(X ≤ k) at or above it (like Excel BINOM.INV).
Full table of P(X = k) and the running totals
How your binomial probability is worked out
Count the ways to get k successes, work out the chance of one way, multiply, then add up the bars you need.
- 1
Count the ways
C(10, 5)
= 252 - 2
Chance of one way
0.5⁵ × 0.5⁵
= 0.0009766 - 3
Multiply: P(X = 5)
252 × 0.0009766
= 0.24609 - 4
Add up the bars
P(X ≤ 5)
= 0.62305
Read more: the formula, a worked example, approximations and when to use them
The binomial distribution counts the successes in a fixed number of tries when each try has only two outcomes (success or failure), the same chance of success every time, and the tries don’t affect each other. Coin flips, free throws, faulty parts in a batch, people who answer “yes” in a survey and passengers who don’t turn up for a flight all follow it.
The formula
P(X = k) = C(n, k) × pᵏ × (1 − p)ⁿ⁻ᵏ
C(n, k) = n! ÷ (k! × (n − k)!), the ways to pick which k tries succeed
P(X ≤ k) = P(X = 0) + P(X = 1) + … + P(X = k)
P(X < k) = P(X ≤ k − 1)
P(X ≥ k) = 1 − P(X < k)
P(X > k) = 1 − P(X ≤ k)
mean = n × p, variance = n × p × (1 − p), SD = √variance
at least one success = 1 − (1 − p)ⁿ
normal approximation: P(X ≤ k) ≈ Φ((k + 0.5 − np) ÷ SD)
Poisson approximation: P(X = k) ≈ e^(−λ) × λᵏ ÷ k!, with λ = n × p
Worked example
Flip a fair coin 10 times (n = 10, p = 0.5). What is the chance of exactly 5 heads?
The number of ways to pick which 5 of the 10 flips are heads is C(10, 5) = 10! ÷ (5! × 5!) = 3,628,800 ÷ (120 × 120) = 3,628,800 ÷ 14,400 = 252. Each of those ways has chance 0.5⁵ × 0.5⁵ = 0.5¹⁰ = 1/1024 = 0.0009765625. So P(X = 5) = 252 × 0.0009765625 = 252/1024 = 0.24609375, about 24.61%.
For at most 5 heads, add the bars from 0 to 5. The ways are C(10, 0) to C(10, 5) = 1 + 10 + 45 + 120 + 210 + 252 = 638, so P(X ≤ 5) = 638/1024 = 0.623046875. Fewer than 5 heads leaves out the 252: P(X < 5) = 386/1024 = 0.376953125. Because a fair coin is symmetric, P(X ≥ 5) = 0.623046875 and P(X > 5) = 0.376953125 too.
The mean is 10 × 0.5 = 5 heads, the variance is 10 × 0.5 × 0.5 = 2.5 and the SD is √2.5 = 1.58114. The chance of at least one head is 1 − 0.5¹⁰ = 1 − 1/1024 = 1023/1024 = 0.9990234375.
The normal approximation with a continuity correction treats “exactly 5” as the strip from 4.5 to 5.5: z = (5.5 − 5) ÷ 1.58114 = 0.31623, so P(X = 5) ≈ Φ(0.31623) − Φ(−0.31623) = 0.62409 − 0.37591 = 0.24817, close to the exact 0.24609 even though np = 5 is below the usual rule of 10. The Poisson approximation with λ = 5 gives e⁻⁵ × 5⁵ ÷ 5! = 0.17547, which is far off, because p = 0.5 is not small.
Which approximation, and when
| Approximation | Common rule of thumb | How |
|---|---|---|
| Normal | n × p ≥ 10 and n × (1 − p) ≥ 10 (some books use 5) | Mean np, SD √(np(1 − p)), add or take 0.5 at each end |
| Poisson | n ≥ 20 and p ≤ 0.05 (or n ≥ 100 and np ≤ 10) | λ = n × p |
| Exact (this calculator) | Any n up to 10,000 | Every P(X = k) in log space, so nothing overflows |
Reading the words in a question
- Exactly k: P(X = k). At most k or no more than k: P(X ≤ k).
- Fewer than k or less than k: P(X < k). At least k or k or more: P(X ≥ k).
- More than k: P(X > k). Between a and b (inclusive): P(a ≤ X ≤ b), in Advanced.
Spreadsheets and notes
- Excel and Google Sheets give P(X = k) with BINOM.DIST(k, n, p, FALSE), P(X ≤ k) with BINOM.DIST(k, n, p, TRUE), a range with BINOM.DIST.RANGE(n, p, a, b) and the inverse with BINOM.INV(n, p, target).
- Each P(X = k) is worked out with logarithms of factorials (ln n!), then added from the short end, so tiny tails such as 7.56 × 10⁻³¹ keep their accuracy. For n up to 170 the exact C(n, k) is used, and the working shows it in full when it has 40 digits or fewer.
- When p is a simple fraction or decimal and n is 200 or less, the fraction view gives the exact answer, like 63/256.
- If the chance changes from try to try (cards drawn without putting them back), the binomial is only an approximation. For dice, cards and Bayes’ theorem, use the probability calculator; for C(n, k) on its own, the permutation and combination calculator; and for areas under a bell curve, the z-score calculator.
Common questions
How do I work out a binomial probability?
Use P(X = k) = C(n, k) × pᵏ × (1 − p)ⁿ⁻ᵏ. For 5 heads in 10 fair coin flips: C(10, 5) = 252 ways, each with chance 0.5¹⁰ = 1/1024, so P(X = 5) = 252/1024 = 0.24609375, about 24.6%.
What is the difference between P(X ≤ k) and P(X < k)?
P(X ≤ k) includes k itself (at most k), while P(X < k) stops at k − 1 (fewer than k). For 10 coin flips, P(X ≤ 5) = 0.623046875 but P(X < 5) = 0.376953125. The gap between them is exactly P(X = 5).
What are the mean and standard deviation of a binomial distribution?
The mean is n × p and the variance is n × p × (1 − p), so the standard deviation is √(n × p × (1 − p)). For 10 flips of a fair coin the mean is 5 heads and the SD is √2.5 = 1.5811.
When can I use the normal approximation?
A common rule of thumb is when both n × p and n × (1 − p) are at least 10 (some books use 5). Use a continuity correction: P(X ≤ k) ≈ P(Y < k + 0.5), where Y is normal with mean np and SD √(np(1 − p)).
What is the chance of at least one success?
It is 1 − (1 − p)ⁿ: one minus the chance of failing every time. With a 1% chance each time and 100 tries, that is 1 − 0.99¹⁰⁰ = 0.634, about 63%, not 100%.
What does a binomial distribution need?
A fixed number of trials n, each with only two outcomes (success or failure), the same chance of success p every time, and trials that don’t affect each other. If the chance changes as you go, such as drawing cards without putting them back, use the hypergeometric distribution instead.
Related calculators
Made by Zulu Calculator, part of AlphaZulu LLC. Formulas are shown in full and rule figures are checked against official sources; see how we build calculators.