Audited 27 Jul 2026·Last updated 27 Jul 2026·3 citations·Tier 2·0 uses

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

Non-negative integer.
Between 0 and 1.
Non-negative integer, no larger than n.
What do you want?
Result
0.2668
The requested probability, per the selected mode.
P(X = k)
0.2668
P(X ≤ k)
0.6496
P(X ≥ k)
0.6172
Expected value (n·p)
3

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.

  1. Enter the number of trials (n), a non-negative integer.
  2. Enter the probability of success on a single trial (p), between 0 and 1.
  3. Enter the target number of successes (k), a non-negative integer no larger than n.
  4. 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.
  5. 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.
  6. 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.

P(X=k) = C(n,k)·pᵏ·(1−p)ⁿ⁻ᵏ

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.

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.

modeexact
p0.3
k3
n10

Frequently asked questions.

What is the binomial distribution used for?
The binomial distribution models the number of successes in a fixed number of independent trials, each with the same success probability — coin flips, pass/fail quality inspections, yes/no survey responses, and any other scenario with a fixed number of repeated, independent, two-outcome trials. It answers questions like 'what's the probability of exactly 3 heads in 10 coin flips' or 'what's the probability that no more than 2 units in a batch of 50 are defective, given a 5% defect rate.'
What is the difference between exact and cumulative binomial probability?
The exact probability P(X=k) is the chance of observing precisely k successes — no more, no less. The cumulative probability P(X≤k) is the chance of observing k or fewer successes, summing the exact probabilities for every value from 0 up to k. The complementary cumulative probability P(X≥k) is the chance of observing k or more successes. Cumulative probabilities answer 'at least' or 'at most' questions, which come up far more often in practice than the exact single-value question — for example, 'what's the probability of at least 3 defective units' rather than 'exactly 3.'
Why doesn't this calculator just compute n! and C(n,k) directly?
Because factorials overflow standard double-precision arithmetic very quickly — 170! already exceeds the largest number a computer can represent, so any n beyond about 170 would produce Infinity or NaN if computed the naive way. This calculator instead uses a ratio recurrence that walks from P(X=0) up to P(X=k) one step at a time, multiplying by (n−i)/(i+1)·p/(1−p) at each step. Every intermediate value stays a bounded probability between 0 and 1, so the calculation remains accurate and overflow-free even for n in the tens of thousands — exactly the sample sizes common in manufacturing quality control and large-scale A/B testing.
What conditions must hold for the binomial distribution to apply?
Three conditions: a fixed, known number of trials (n); each trial is independent of the others; and every trial has the same probability of success (p). If the success probability changes between trials, or the number of trials isn't fixed in advance, or trials aren't independent (for example, sampling without replacement from a small population), the plain binomial model no longer applies exactly — sampling without replacement instead follows the hypergeometric distribution.
What is the expected value (mean) of a binomial distribution?
The mean, or expected number of successes, is n·p — the number of trials multiplied by the per-trial success probability. For 10 trials at a 30% success probability, the expected number of successes is 10 × 0.3 = 3. The variance of the distribution is n·p·(1−p), which is largest when p = 0.5 (maximum uncertainty about each trial's outcome) and shrinks toward zero as p approaches either 0 or 1 (near-certain outcomes).
How does the binomial distribution relate to the normal distribution?
For large n, the shape of the binomial distribution approaches a normal distribution with mean μ = n·p and standard deviation σ = √(n·p·(1−p)) — a consequence of the Central Limit Theorem known as the normal approximation to the binomial. This approximation is convenient for very large n where computing the exact binomial sum becomes unwieldy by hand, but it is only an approximation; Quanta's normal distribution calculator can compute the approximate probabilities directly from μ and σ, while this binomial calculator computes the exact discrete probabilities correctly at any n.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 313 calculators remain free
  • No billing is enabled
Coming soon