Binomial Probability Calculator
Find the exact probability of k successes in n independent trials — P(X = k), P(X ≤ k), P(X < k), P(X ≥ k) and P(X > k) — with the mean, variance and shape of the distribution, a probability histogram and every step of the working.
Written by Suhaib Hassan. The formula and every worked example are re-derived by hand. Our methodology.
It evaluates C(n, k) · pᵏ · qⁿ⁻ᵏ using logarithms of factorials, so large n does not overflow, and adds terms for the cumulative results.
Textbook tables stop at small n and round heavily. This calculator gives every tail in one place and shows the arithmetic behind the answer.
—
—
—
—
—
—
—
—
—
—
—
—
—
Probability mass function
The chance of each possible number of successes. Bars in the event you asked for are dark; the dashed line marks the mean.
Step-by-step working
—
Governing equations and conditions
The equations
Four conditions for a binomial model
- Fixed number of trials. n is set in advance.
- Two outcomes. Each trial is a success or a failure.
- Constant probability. p is the same on every trial.
- Independence. One trial’s outcome does not affect another’s.
Worked examples
Each uses exact binomial sums, checked by hand and reproducible with the presets and inputs above.
Lot inspection
A batch has a 2% defect rate. An inspector tests 50 units and rejects the batch if more than 2 are defective.
= 0.36417 + 0.37160 + 0.18580 = 0.92157
P(reject) = P(X > 2) = 0.0784
Clinical response
A treatment works for 70% of patients. Among 30 patients, what is the chance that at least 25 respond?
P(X ≥ 25) = 0.0766 (about 7.7%)
Mean = 21 responders
Packet loss
Each of 64 packets is lost independently with probability 0.05. What is the chance more than 5 are lost?
P(X ≤ 5) = 0.89990
P(X > 5) = 0.1001 (about 10.0%)
What is the binomial distribution?
The binomial distribution gives the probability of getting exactly k successes in n independent trials when each trial succeeds with the same probability p. Typical examples are the number of heads in coin tosses, defective items in a sample, or patients who respond to a treatment.
How to calculate a binomial probability
- Work out the binomial coefficient C(n, k) = n! ÷ (k!(n − k)!), the number of ways to choose which trials succeed.
- Multiply by pᵏ, the probability that those k trials all succeed.
- Multiply by (1 − p)ⁿ⁻ᵏ, the probability that the other trials all fail.
- For a cumulative probability, add the terms over the range of k values you need.
By Suhaib Hassan · Reviewed 28 September 2026 · How CalculatePilot verifies formulas →
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods — 1.3.6.6.18 Binomial distribution
- Feller, W. (1968). An Introduction to Probability Theory and Its Applications, Vol. 1, 3rd ed. Wiley.
- ISO 3534-1:2006, Statistics — Vocabulary and symbols — Part 1: General statistical terms and terms used in probability.
Binomial probability table: n = 10, p = 0.5
| k | P(X = k) | P(X ≤ k) |
|---|---|---|
| 0 | 0.000977 | 0.000977 |
| 1 | 0.009766 | 0.010742 |
| 2 | 0.043945 | 0.054688 |
| 3 | 0.117188 | 0.171875 |
| 4 | 0.205078 | 0.376953 |
| 5 | 0.246094 | 0.623047 |
| 6 | 0.205078 | 0.828125 |
| 7 | 0.117188 | 0.945313 |
| 8 | 0.043945 | 0.989258 |
| 9 | 0.009766 | 0.999023 |
| 10 | 0.000977 | 1.000000 |
This is the fair-coin case: the number of heads in 10 flips. Choose any other n and p in the calculator to get its own table, and use Export CSV for every value of k.
Probability between two values
To find P(a ≤ X ≤ b), subtract two cumulative results: P(X ≤ b) − P(X ≤ a − 1). For 4 to 6 heads in 10 flips: 0.828125 − 0.171875 = 0.65625. Adding the three terms 0.205078 + 0.246094 + 0.205078 gives the same answer.
The same calculation in a calculator, spreadsheet or code
| Tool | P(X = k) | P(X ≤ k) |
|---|---|---|
| TI-83 / TI-84 | binompdf(n, p, k) | binomcdf(n, p, k) |
| Excel, Google Sheets | =BINOM.DIST(k, n, p, FALSE) | =BINOM.DIST(k, n, p, TRUE) |
| R | dbinom(k, n, p) | pbinom(k, n, p) |
| Python (SciPy) | binom.pmf(k, n, p) | binom.cdf(k, n, p) |
For n = 10, p = 0.5, k = 3 every one of these returns 0.117188 for the exact value and 0.171875 for the cumulative value.
When an approximation is close enough
| Case | Exact | Approximation |
|---|---|---|
| n = 100, p = 0.5, P(X ≤ 55) | 0.864373 | Normal with continuity correction: 0.864334 |
| n = 100, p = 0.5, P(X ≤ 55) | 0.864373 | Normal without correction: 0.841345 |
| n = 50, p = 0.02, P(X ≤ 2) | 0.921572 | Poisson with λ = np = 1: 0.919699 |
The normal approximation here uses mean 50 and standard deviation 5, and the continuity correction means using 55.5 instead of 55. The Poisson approximation suits large n with small p. With this calculator you can usually skip approximations, since it is exact for n up to 1,000.
Frequently asked questions
What is the difference between the binomial and hypergeometric distributions?
The binomial model assumes independent trials with a constant probability, as with sampling with replacement or from a very large population. The hypergeometric distribution models sampling without replacement from a finite population, where each draw changes the odds of the next. When the sample is a small fraction of the population (commonly under 5%), the binomial is a good approximation.
When can I use a normal approximation?
A common rule of thumb is that both np and n(1 − p) should be at least 5 (some texts use 10). Then X is approximately normal with mean np and standard deviation √(npq), usually with a continuity correction of ±0.5. This calculator gives the exact answer, so no approximation is needed.
How does the calculator avoid overflow for large n?
Instead of multiplying huge factorials, it works with the logarithm of the binomial coefficient (using the log-gamma function) and exponentiates at the end. The exact coefficient shown in the steps is computed separately with integer arithmetic.
What happens when p is 0 or 1?
The outcome is certain: if p = 0 every trial fails, so P(X = 0) = 1; if p = 1 every trial succeeds, so P(X = n) = 1. The variance is zero and the distribution is a single point.
How do I find the probability of at least one success?
Use the complement: P(X ≥ 1) = 1 − P(X = 0) = 1 − (1 − p)ⁿ. Set k = 1 and choose P(X ≥ k) to see it directly.
What if my trials are not independent?
Then the binomial model does not apply exactly. Depending on the situation, a hypergeometric or other model may be more suitable. Independence and a constant probability are essential assumptions.
How do I find the probability between two values, P(a ≤ X ≤ b)?
Subtract two cumulative results: P(X ≤ b) − P(X ≤ a − 1). For n = 10, p = 0.5 and 4 to 6 successes that is 0.828125 − 0.171875 = 0.65625.
What are binompdf and binomcdf, and how do they match this calculator?
On a TI-83 or TI-84, binompdf(n, p, k) is the exact probability P(X = k) and binomcdf(n, p, k) is the cumulative probability P(X ≤ k). Enter the same n, p and k here and read P(X = k) and P(X ≤ k).
How do I calculate a binomial probability in Excel or Google Sheets?
Use =BINOM.DIST(k, n, p, FALSE) for the exact probability and =BINOM.DIST(k, n, p, TRUE) for the cumulative probability. For n = 10, p = 0.5, k = 3 they return 0.117188 and 0.171875.
When should I use the Poisson approximation instead of the normal?
Use Poisson when n is large and p is small, with λ = np. For n = 50 and p = 0.02, the exact P(X ≤ 2) is 0.921572 and the Poisson value with λ = 1 is 0.919699. The normal approximation works better when p is near 0.5.
Can the variance of a binomial distribution be larger than its mean?
No. The variance npq is never more than the mean np, because q is at most 1. They are nearly equal when p is very small, and the variance is largest relative to n when p = 0.5.
Related calculators
Continue with probability and counting.