Binomial Distribution Calculator
Find the probability of exactly, at most, fewer than, at least or more than k successes in n independent yes/no trials, or of any range of counts, with the mean, variance and standard deviation, a bar chart and a table of the probabilities around k.
Not sure this is the right model? See binomial vs Poisson vs hypergeometric: three questions that decide.
A decimal from 0 to 1, so 5% is 0.05
Related Calculators
Poisson Distribution Calculator
Turn an average event rate into exact, cumulative and range Poisson probabilities, with a bar chart and a probability table.
Hypergeometric Distribution Calculator
Exact probabilities for sampling without replacement: exactly, at most, at least and between k successes from a finite population.
Coin Flip Probability Calculator
Find the probability of any number of heads in a series of fair or biased coin flips.
Learn More
Probability Distributions
Compare the binomial, Poisson, normal, uniform, and exponential distributions and learn how to choose the right model for counts, measurements, and waiting times.
Binomial vs Poisson vs Hypergeometric
Three questions decide the right counting distribution (fixed trials, independence, replacement) with one inspection scenario computed all three ways.
Before you calculate
- Count the total number of trials n: the items inspected, customers contacted or attempts made.
- Write the success probability p as a decimal between 0 and 1, so a 5% defect rate is 0.05.
- Check that every trial is independent and has the same p. Sampling without replacement from a small batch calls for the hypergeometric distribution instead.
When to use the binomial distribution
The binomial model applies when a random process satisfies four conditions, remembered as BINS:
- Binary outcomes: each trial ends in one of two states: defective or acceptable, click or no click, cured or not cured.
- Independence: the outcome of one trial does not change the probability of another.
- Number fixed in advance: you decide n before collecting data instead of sampling until a success appears. Waiting for the first success is the geometric distribution; waiting for the r-th is the negative binomial distribution.
- Same probability: p stays constant from the first trial to the last.
If the observation window is fixed but the number of trials is not, for example arrivals per hour, the Poisson distribution is usually the better model.
The binomial probability formula
P(X = k) = C(n, k) × p^k × (1 − p)^(n − k)
C(n, k) = n! / (k! × (n − k)!)
P(X ≤ k) = P(X = 0) + P(X = 1) + … + P(X = k)
Mean = np Variance = np(1 − p) Skewness = (1 − 2p) / √(np(1 − p))
Here n is the number of trials, k the number of successes you ask about, p the probability of success on one trial, and C(n, k) the number of ways to choose which k trials succeed. Every card is computed from its own side of the distribution: “at least” and “more than” come from the upper tail directly, not as 1 minus the lower tail, so a probability such as 10−12 is printed with its own digits instead of being rounded away. The bars, the table and the steps use the same values.
Worked example: defects in a quality sample
A quality inspector samples 10 items from a line where each item is independently defective with probability 0.05. What is the probability of finding exactly 1 defect?
- Count the arrangements: C(10, 1) = 10, because the single defect could be any of the ten items.
- Probability of one such pattern: one defect contributes 0.05 and the nine good items contribute 0.959 ≈ 0.630249.
- Multiply: P(X = 1) = 10 × 0.05 × 0.630249 ≈ 0.315125, about a 31.5% chance.
The other cards follow. A clean sample has P(X = 0) = 0.9510 ≈ 0.598737 (the “fewer than 1” card), so at least one defect has probability 0.401263. At most one defect is 0.913862, leaving 0.086138 for two or more. The summary reads mean np = 0.5, variance np(1 − p) = 0.475 and standard deviation ≈ 0.6892. Load example fills in n = 10, p = 0.05 and k = 1 and reproduces every number.
Now a range. On a 20-question quiz with four answers each, a pure guesser has p = 0.25. Choose Between two values with n = 20, p = 0.25, a = 10 and b = 20: the chance of guessing at least half the questions right is 0.013864, about 1 in 72.
Normal and Poisson approximations
Before software made exact computation easy, statisticians replaced the binomial with simpler distributions. The approximations still matter for intuition, and you can see how good they are by comparing them with the exact answer this calculator gives.
Normal approximation: when np ≥ 10 and n(1 − p) ≥ 10 the binomial is close to a normal distribution with mean np and standard deviation √(np(1 − p)). A continuity correction, using the area below k + 0.5 for P(X ≤ k), improves it.
Poisson approximation: when n is large and p is small (a common rule is n ≥ 100 and np ≤ 10) the binomial is close to a Poisson distribution with rate λ = np.
| n = 100, p = 0.03, P(X ≤ 2) | Value |
|---|---|
| Exact binomial | 0.419775 |
| Poisson approximation, λ = 3 | 0.42319 |
| Normal approximation with continuity correction | 0.384721 |
Here np = 3 is far below 10, so the normal approximation is off by about 3.5 percentage points while the Poisson is within 0.4. The exact value costs nothing to compute, which is why it is worth using directly.
Excel, R, Python and TI-84
| Software | P(X = k) | P(X ≤ 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) | scipy.stats.binom.pmf(k, n, p) | scipy.stats.binom.cdf(k, n, p) |
| TI-84 | binompdf(n, p, k) | binomcdf(n, p, k) |
For P(X ≥ k) use 1 − the cumulative value at k − 1, or pbinom(k - 1, n, p, lower.tail = FALSE) in R and binom.sf(k - 1, n, p) in SciPy, which keep the digits of a small upper tail. The binompdf and binomcdf calculator works like the TI-84 functions.
Real applications
- Quality control: how likely an inspection lot is to pass when each unit has a known defect rate, and how to set acceptance sampling plans.
- Marketing and A/B testing: the number of conversions among n visitors when each converts with probability p.
- Medicine: how many patients in a trial cohort will respond to a treatment with a known response rate.
- Education: the chance of passing a multiple-choice exam by guessing, which sets a floor for reading test scores.
Related guides and calculators
The coin flip probability calculator applies the binomial distribution to heads and tails, the at least one probability calculator gives the chance of one or more successes in n tries, and the probability of multiple events calculator combines events with different probabilities. To count the arrangements behind C(n, k) use the combination calculator. To test whether an observed count of successes is unusual, see the one-proportion z-test, and read probability distributions for the whole family.
Frequently Asked Questions
What is the difference between the binomial and Poisson distributions?
The binomial counts successes in a fixed number of trials n, each with probability p, so the count can never exceed n. The Poisson counts events in a fixed interval of time or space with no upper limit, governed by a single rate. When n is large and p is small the two nearly coincide with lambda = np, which is why rare defects can be modeled either way.
When does the normal approximation to the binomial work?
A common rule requires np >= 10 and n(1 - p) >= 10, which keeps the distribution far enough from the 0 and n boundaries to look symmetric. Then a normal curve with mean np and standard deviation sqrt(np(1 - p)) gives good estimates, especially with a continuity correction of 0.5. Because this calculator gives the exact answer even for millions of trials, you only need the approximation to check your intuition.
What is the difference between P(X = k) and P(X <= k)?
P(X = k) is the probability of exactly k successes, computed from the binomial formula. P(X <= k) is cumulative: it adds P(X = 0) through P(X = k). Use the exact form for 'exactly one defect' and the cumulative form for 'no more than one defect'. The calculator also gives fewer than, at least and more than k.
How do I get the probability of at least k successes?
Read the 'at least' card: P(X >= k) = 1 - P(X <= k - 1), computed from the upper tail so that very small values keep their digits. For a range such as 8 to 12 successes, switch to 'Between two values' and enter both limits; both limits are included.
Can I use a sample proportion as the probability p?
Yes, and it is standard practice: estimate p from historical data, such as 37 defects in 1000 units giving p = 0.037. The result is then conditional on that estimate being accurate, so small historical samples make the computed probabilities less trustworthy.
What happens if the trials are not independent?
The binomial formula no longer holds. Positive dependence, such as defects clustering within a machine run, makes extreme counts more likely than the binomial predicts, while sampling without replacement from a small lot calls for the hypergeometric distribution. Check how the data was generated before trusting the model.
How many trials can the calculator handle?
Up to 10,000,000 trials. Within that range the probabilities have been checked against high-precision arithmetic to at least nine significant digits, including very small tail probabilities. Larger values of n are refused with a message rather than answered with a less accurate number.
Embed This Calculator
Add this free calculator to your course page or LMS.
Adjust the height value to fit your page.