Binomial Distribution Calculator
Free binomial distribution calculator: find the exact P(X=k) or cumulative P(X≤k)/P(X≥k) probability from n trials, success probability p, and k successes.
Binomial Distribution Calculator
Background.
The Quanta binomial distribution calculator answers the classic 'exactly how many successes' question for any process made up of independent, identical trials with a fixed success probability: flip a coin n times, ship n units off a production line, send n emails, run n clinical trials — anything with exactly two possible outcomes per trial (success or failure) and a constant probability p of success. Give it the number of trials n, the per-trial success probability p, and a target count k, and it returns the exact probability of getting precisely k successes, along with the cumulative probability of getting k or fewer, and the cumulative probability of getting k or more, all in one calculation.
The binomial distribution is discrete — unlike the normal distribution, which describes a continuous range of possible values, the binomial distribution only ever produces whole-number outcomes (0 successes, 1 success, 2 successes, and so on up to n), each with its own distinct probability. This distinction matters practically: while a continuous distribution has a cumulative distribution function that can be integrated in principle, the binomial's probability mass function (PMF) has no such continuous structure, so its cumulative distribution function (CDF) is computed as a running sum of individual term probabilities, and — as the NIST/SEMATECH e-Handbook of Statistical Methods notes explicitly — 'the binomial percent point function does not exist in simple closed form' and must be evaluated numerically, term by term.
Computing those individual terms directly from the textbook formula, C(n,k)·pᵏ·(1−p)ⁿ⁻ᵏ, runs into a real numerical problem for anything beyond fairly small n: the factorial in the binomial coefficient C(n,k) = n!/(k!(n−k)!) overflows a standard double-precision number once n exceeds about 170 (170! is already larger than the largest number a computer can represent), long before you reach the sample sizes common in quality control (thousands of manufactured units) or clinical trials (thousands of patients). This calculator avoids that problem entirely by walking the probabilities forward one step at a time using a ratio recurrence — starting from P(X=0) = (1−p)ⁿ and stepping to each next term by multiplying by (n−i)/(i+1)·p/(1−p) — so every intermediate value stays a bounded probability between 0 and 1, with no factorial ever computed directly and no overflow risk even at n in the tens of thousands.
Use this calculator for quality control (what's the probability that at most 2 units in a batch of 50 are defective, given a known 5% defect rate), for basic probability homework (what's the probability of getting exactly 3 heads in 10 coin flips), for A/B testing sanity checks (what's the probability of seeing at least 60 conversions out of 100 visitors if the true conversion rate is 50%), or for any other fixed-trials, fixed-probability, two-outcome scenario. For large n, the binomial distribution's shape converges toward a normal distribution — Quanta's normal distribution calculator can approximate these same probabilities quickly using μ = np and σ = √(np(1−p)), though this calculator's exact computation remains correct at any n and is the right tool whenever precision matters.
What is binomial distribution calculator?
The binomial distribution models the number of successes in a fixed number of independent trials, each with the same probability of success. Formally, if X is the number of successes in n independent trials, each succeeding with probability p, then X follows a binomial distribution, written X ~ B(n, p). The probability of observing exactly k successes is given by the probability mass function P(X=k) = C(n,k)·pᵏ·(1−p)ⁿ⁻ᵏ, where C(n,k) = n!/(k!(n−k)!) is the binomial coefficient counting the number of distinct ways to choose which k of the n trials succeed. The cumulative distribution function, P(X≤k), sums this PMF over every value from 0 up to k, and its complement, P(X≥k), captures the probability of at least k successes. Unlike a continuous distribution, the binomial distribution assigns positive probability only to whole-number outcomes — you cannot observe 2.5 successes — and its CDF has no closed algebraic form, so it must be evaluated as a running numerical sum. Three conditions must hold for the binomial model to apply: a fixed number of trials n, each trial independent of the others, and the same success probability p on every trial. The expected number of successes is n·p, and the variance is n·p·(1−p).
How to use this calculator.
- Enter the number of trials (n), a non-negative integer.
- Enter the probability of success on a single trial (p), between 0 and 1.
- Enter the target number of successes (k), a non-negative integer no larger than n.
- Choose a mode: 'Exact' for P(X=k), 'Cumulative P(X≤k)' for the probability of k or fewer successes, or 'Cumulative P(X≥k)' for the probability of k or more.
- Read the primary result, and check the exact/cumulative breakdown shown alongside it — all three are always computed together regardless of which mode you chose.
- Compare the mean (n·p) against your target k to get a quick sense of whether k is above, below, or close to the expected outcome.
The formula.
The binomial probability mass function is P(X=k) = C(n,k)·pᵏ·(1−p)ⁿ⁻ᵏ, where C(n,k) = n!/(k!(n−k)!) counts the number of ways to arrange k successes among n trials. Computing C(n,k) via raw factorials overflows for n beyond about 170, so this calculator instead walks the probabilities forward with the equivalent ratio recurrence: starting from P(X=0) = (1−p)ⁿ, each next term is P(X=i+1) = P(X=i)·(n−i)/(i+1)·p/(1−p). This produces exactly the same numbers as the textbook formula (verified by direct cross-check) while keeping every intermediate value a bounded probability, with no overflow even for n in the tens of thousands. The cumulative probability P(X≤k) is the running sum of these terms from i=0 through i=k; the complementary cumulative probability P(X≥k) = 1 − P(X≤k−1) = 1 − P(X≤k) + P(X=k), avoiding a second full summation. The mean of the distribution is n·p, the expected number of successes.
A worked example.
Ten independent trials, each with a 30% chance of success (n=10, p=0.3), asking for the probability of exactly 3 successes (k=3). The binomial coefficient C(10,3) = 10!/(3!·7!) = 120. Plugging into the PMF: P(X=3) = 120 × 0.3³ × 0.7⁷ = 120 × 0.027 × 0.0823543 ≈ 0.26683 — about a 26.7% chance of exactly 3 successes. The cumulative probability of 3 or fewer successes, P(X≤3), sums the terms for k=0,1,2,3 and comes to approximately 0.64961, or about 65%. The complementary cumulative probability of 3 or more successes, P(X≥3), is approximately 0.61722, or about 61.7% (notice this overlaps with the P(X≤3) figure at exactly the k=3 term, which is why the two cumulative figures don't sum to exactly 100%). The expected value, or mean, is n×p = 10×0.3 = 3 — exactly the target k in this example, which is why P(X=3) is close to (though not exactly) the single largest individual probability in the whole distribution.
Frequently asked questions.
What is the binomial distribution used for?
What is the difference between exact and cumulative binomial probability?
Why doesn't this calculator just compute n! and C(n,k) directly?
What conditions must hold for the binomial distribution to apply?
What is the expected value (mean) of a binomial distribution?
How does the binomial distribution relate to the normal distribution?
References& sources.
- [1]NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.18 — Binomial Distribution. Defines the PMF and CDF and notes the binomial percent point function has no closed form.
- [2]NIST Digital Library of Mathematical Functions, Chapter 26 — Combinatorial Analysis. Background reference for binomial coefficients.
- [3]Casella, G., & Berger, R. L. (2002). Statistical Inference (2nd ed., Duxbury). Chapter 3 covers the binomial distribution family rigorously, including its mean and variance.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 313 calculators remain free
- No billing is enabled