331+ free tools. No sign-up. No hidden fees. Explore the toolkit

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.

A whole number from 1 to 1,000.

Between 0 and 1 — for example 0.5 for a fair coin.

A whole number from 0 to n.

Result

Save to Pinterest
Note: Probabilities are computed with the log-gamma function, so large n (up to 1,000) stays accurate — factorials are never computed directly, which would overflow. The cases p = 0 and p = 1 are handled exactly. All figures are cross-checked against SciPy 1.11.4. This calculator is for education and quick checks — it is not a substitute for professional statistical advice.

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

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.

  1. 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.
  2. Enter the number of successes (k) you care about — a whole number from 0 to n.
  3. 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

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: