Binomial Distribution Calculator
How likely are exactly 5 heads in 10 coin tosses — or at least 8? A binomial distribution answers questions like that: a fixed number of trials, two outcomes each time, the same chance of success on every trial. This calculator gives the exact probability, all four cumulative probabilities, the mean and variance, and the full probability table.
Enter the number of trials, the probability of success and the number of successes, and get every binomial probability instantly.
Result
How It Works
A binomial experiment has a fixed number of trials (n), each with two outcomes — success or failure — the same success probability (p) every time, and independent trials. The probability of exactly k successes is P(X = k) = C(n, k) × pk × (1 − p)n−k, where C(n, k) = n! ÷ (k! × (n − k)!) counts the ways to choose which k trials succeed. The cumulative probabilities are sums of these single values: P(X ≤ k) adds up P(X = 0) through P(X = k), and the other tails follow the same way. The mean is np, the variance is np(1 − p), and the standard deviation is its square root. When n is large, the binomial shape is close to a normal distribution — the bell curve.
Computing factorials directly overflows quickly — 171! is already beyond what a double can hold — so this calculator works with logarithms instead: ln C(n, k) = ln Γ(n+1) − ln Γ(k+1) − ln Γ(n−k+1), evaluated with the Lanczos log-gamma function, and the probability is the exponential of the log result. That keeps n up to 1,000 accurate. The edge cases p = 0 and p = 1 are handled exactly: with p = 0 every trial fails, so P(X = 0) = 1 and everything else is 0; with p = 1 every trial succeeds. For small factorials worked out step by step, use the factorial calculator.
Worked Example
Toss a fair coin 10 times (n = 10, p = 0.5): P(X = 5) = 0.2461, P(X ≤ 3) = 0.1719 and P(X ≥ 8) = 0.0547. The chance of 5 or fewer heads is P(X ≤ 5) = 0.6230. With n = 20 and p = 0.3: P(X = 2) = 0.0278, the mean is 6, the variance is 4.2 and the standard deviation is 2.0494. And with n = 1,000 fair tosses, the chance of exactly 500 heads is 0.0252.
Assumptions
- Fixed number of trials. n is decided in advance — you can’t keep tossing until you like the result and still use this distribution.
- Two outcomes per trial. Each trial is success or failure only. Three or more outcomes need the multinomial distribution instead.
- Constant p. The success probability is the same on every trial. Drawing without replacement (cards from a deck, balls from an urn) changes p each time — that is the hypergeometric distribution.
- Independent trials. Each trial’s outcome must not affect the next. If trials influence each other, the binomial model does not apply.
- Whole numbers only. n and k are counts, so they must be whole numbers: n from 1 to 1,000, k from 0 to n.
- Education and quick checks. Results are computed from the numbers you enter and are not a substitute for professional statistical advice.
Last reviewed: 15 November 2026.
Built and tested by SumKitTool — see how we check our numbers.
How to Use This Calculator
Enter n, p and k, and the result updates live as you type.
- Enter the number of trials (n) — a whole number from 1 to 1,000 — and the probability of success on each trial (p), between 0 and 1.
- Enter the number of successes (k) you care about — a whole number from 0 to n.
- Read the answer — the exact probability P(X = k), all four cumulative probabilities, the mean, variance and standard deviation, and the full probability table when n is 30 or less.
The Reset button restores the worked example (n = 10, p = 0.5, k = 5 — P(X = 5) = 0.2461).
Tips and Practical Advice
- “At least” and “at most” are the useful questions. P(X = k) answers “exactly k”; most real questions are “at least k” (P(X ≥ k)) or “at most k” (P(X ≤ k)) — both are in the table.
- Watch the ≤ vs < boundary. P(X ≤ 5) and P(X < 5) differ by P(X = 5) — a 0.2461 gap in the coin example. Say which one you mean before you read the number.
- Use the table to spot the most likely outcome. When n ≤ 30 the table shows every P(X = k) — the peak sits near the mean np, and the shape shows how spread out the results are.
- For large n, the normal approximation is close. With n = 1,000 and p = 0.5 the distribution is nearly bell-shaped with mean 500 and SD 15.81 — but this calculator gives you the exact binomial values, so you don’t need the approximation.
Frequently Asked Questions
What is a binomial distribution?
A binomial distribution describes the number of successes in a fixed number of independent trials, where each trial has just two outcomes — success or failure — and the same success probability p every time. Coin tosses, free throws and pass/fail quality checks are classic examples. It needs exactly three numbers: n (trials), p (probability of success) and k (the number of successes you care about).
How do you calculate P(X = k)?
Use the binomial probability formula: P(X = k) = C(n, k) × p^k × (1 − p)^(n − k), where C(n, k) is the number of ways to choose k successes from n trials. For example, with n = 10 fair coin tosses (p = 0.5), P(X = 5) = 252 × 0.5^5 × 0.5^5 = 0.2461. This calculator evaluates the formula with the log-gamma function, so it stays accurate even for n up to 1,000.
What is the difference between P(X ≤ k) and P(X < k)?
P(X ≤ k) includes the case X = k; P(X < k) stops just before it. The two differ by exactly P(X = k). With n = 10 and p = 0.5, P(X ≤ 5) = 0.6230 and P(X < 5) = 0.3770 — the gap is P(X = 5) = 0.2461. The same applies to the upper tail: P(X ≥ k) includes k, P(X > k) does not.
What are the mean and variance of a binomial distribution?
The mean is n × p and the variance is n × p × (1 − p); the standard deviation is the square root of the variance. For example, with n = 20 trials and p = 0.3, the mean is 6, the variance is 4.2 and the standard deviation is 2.0494. The variance is largest when p = 0.5 and shrinks towards zero as p approaches 0 or 1.
Last updated: