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.
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.
Related calculators
Continue with probability and counting.