Binomial Distribution Calculator

Every binomial probability for k successes in n trials at once, with the steps, a table and a chart.

Inputs

These are example values. Change any of them to calculate your own.

Try:

For example 24 seeds planted.

Like 0.85, 85% or 17/20.

A whole number, for example 20.

Results

Probability of at least 20 successes

0.713382

P(X ≥ 20) with n = 24 and p = 0.85: about 71.34%

Mean (expected successes)
20.4np = 24 × 0.85
Standard deviation
1.7493Variance np(1 − p) = 3.06
Most likely count
21P(X = 21) = 0.225051
Every way to ask about k = 20 (n = 24 and p = 0.85)
Probability ofProbabilityPercentCounts includedNotation
Exactly 200.20850420.85%20P(X = 20)
At most 200.49512149.51%0 to 20P(X ≤ 20)
Fewer than 200.28661828.66%0 to 19P(X < 20)
At least 200.71338271.34%20 to 24P(X ≥ 20)
More than 200.50487950.49%21 to 24P(X > 20)

Note: Accuracy

Computed exactly: each probability is an exact fraction, rounded once for display to 6 significant digits. Probabilities below 1E-300 are reported as “< 1E-300”, never rounded to 0.

How this was calculated

  1. Chance of success on each trial: p = 0.85, so the chance of failure is 1 − p = 0.15.
  2. Exactly 20: P(X = 20) = C(24, 20) × 0.8520 × 0.154 = 10,626 × 0.0387595 × 0.00050625 = 0.208504.
  3. At least 20 means 20 or more, so it is everything except 19 or fewer: P(X ≥ 20) = 1 − P(X ≤ 19) = 1 − 0.286618 = 0.713382. The same as adding P(X = 20) through P(X = 24): 0.208504 + 0.225051 + 0.173903 + 0.0856915 + 0.0202327.
  4. Mean: μ = np = 24 × 0.85 = 20.4.
  5. Variance: σ2 = np(1 − p) = 24 × 0.85 × 0.15 = 3.06; standard deviation σ = √3.06 = 1.7493.
Same answer on a TI-84 or in Excel
ProbabilityTI-84 (2nd DISTR)ExcelResult
P(X = 20)binompdf(24, 0.85, 20)=BINOM.DIST(20, 24, 0.85, FALSE)0.208504
P(X ≤ 20)binomcdf(24, 0.85, 20)=BINOM.DIST(20, 24, 0.85, TRUE)0.495121
P(X < 20)binomcdf(24, 0.85, 19)=BINOM.DIST(19, 24, 0.85, TRUE)0.286618
P(X ≥ 20)1 − binomcdf(24, 0.85, 19)=1-BINOM.DIST(19, 24, 0.85, TRUE)0.713382
P(X > 20)1 − binomcdf(24, 0.85, 20)=1-BINOM.DIST(20, 24, 0.85, TRUE)0.504879
Distribution of X for n = 24 and p = 0.85
00.10.20.3131415161718192021222324
  • Counted in P(X ≥ 20)
  • Other values of k
Chart data: Distribution of X for n = 24 and p = 0.85
Distribution of X for n = 24 and p = 0.85
k (successes)Counted in P(X ≥ 20)Other values of k
1300.000261
1400.001162
1500.004391
1600.014
1700.03732
1800.08225
1900.1472
200.20850
210.22510
220.17390
230.085690
240.020230
Binomial distribution table for n = 24 and p = 0.85
kP(X = k)P(X ≤ k)P(X ≥ k)
01.68341E-201.68341E-201
12.28944E-182.30627E-18> 0.999999
21.49195E-161.51501E-16> 0.999999
36.19989E-156.35139E-15> 0.999999
41.84447E-131.90798E-13> 0.999999
54.18079E-124.37159E-12> 0.999999
67.5022E-117.93935E-11> 0.999999
71.09318E-91.17257E-9> 0.999999
81.31637E-81.43362E-8> 0.999999
91.32612E-71.46948E-7> 0.999999
100.00000112720.00000127415> 0.999999
110.000008129510.000009403660.999999
120.00004990610.00005930980.999991
130.0002610470.0003203570.999941
140.001162280.001482640.99968
150.004390850.005873490.998517
160.01399580.01986930.994127
170.03732220.05719150.980131
180.08224710.1394390.942808
190.1471790.2866180.860561
200.2085040.4951210.713382
210.2250510.7201720.504879
220.1739030.8940760.279828
230.08569150.9797670.105924
240.020232710.0202327

Normal approximation, for comparison

  • With the continuity correction, P(X ≥ 20) ≈ P(Y > 19.5), where Y follows a with mean 20.4 and standard deviation 1.7493: 0.696547. The exact value is 0.713382, a difference of 0.0168.
  • Rule of thumb: np = 20.4 and n(1 − p) = 3.6. At least one is 5 or less, so the approximation is not reliable here; use the exact value.

When the binomial model fits

  • A fixed number of trials, n, set in advance.
  • Each trial has two outcomes, success or failure.
  • The trials are independent: one trial's result doesn't change the chance of another.
  • The chance of success, p, is the same on every trial.
  • If any of these fails, the count doesn't follow a . Drawing without replacement from a small group (cards from one deck, parts from a small lot) breaks the last two; that calls for the hypergeometric distribution, and the binomial is close only when the sample is under about 5% of the group.

Assumptions

  • Probabilities are rounded to 6 significant digits for display; the CSV files keep every digit the calculation has.
  • A count above n is allowed as k: it can’t happen, so its probability is 0.
  • The table lists every k from 0 to n and is built from one directly computed value with the ratio between neighboring rows, P(X = k + 1) ÷ P(X = k) = (n − k)p ÷ ((k + 1)(1 − p)); its entries agree with the direct calculation to about 12 significant digits.

Calculated in your browser. This site doesn't send the numbers you enter anywhere. “Continue in” links pass them to the next calculator within this browser tab only.

Continue in the Normal Distribution and Z-Score Calculator

Updated Report a problem with this calculator

What this calculator answers

Given n independent trials that each succeed with the same probability p, it gives the chance of exactly k successes and of every “at most”, “fewer than”, “at least” and “more than” version of that question at once, or the chance of a range from k₁ to k₂. It also shows the mean, standard deviation and most likely count, the whole distribution as a table and chart, and the matching TI-84 and Excel calls. Two more questions use the same model: how many trials you need to reach a target chance, and the smallest k whose cumulative probability reaches a given level.

How to find binomial probabilities: exactly, at most, at least

  • Number of trials (n): how many times the trial is repeated, a whole number up to 100,000.
  • Probability of success (p): the chance of success on one trial. Type it as a decimal (0.85), a percent (85%) or a fraction (17/20, 1/6). A line under the field shows how it was read. On a phone, the / and % keys sit under the field.
  • Probability of: the question in words. Pick exactly, at most, fewer than, at least, more than, or between k₁ and k₂.
  • Number of successes (k): the count the question is about. A k above n is allowed; its probability is simply 0.

Results update as you type. The headline answers the question you picked, and the table below it answers the other four versions for the same k and lists the counts each one includes, so you can check that you picked the right one. The Try buttons load the examples on this page: two 6s in 12 dice rolls, fewer than 10 survey replies, a range of defects, the rolls needed for a 6, and a defect limit. Switch Find to “Trials needed to reach a chance” or “k at a cumulative probability” for the reverse questions.

Binomial probability formula

The chance of exactly k successes multiplies the number of ways to place k successes among n trials by the chance of any one such arrangement:

P(X=k)=(nk) pk(1−p)n−k,(nk)=n!k! (n−k)!P(X = k) = \binom{n}{k}\, p^{k} (1 - p)^{n-k}, \qquad \binom{n}{k} = \frac{n!}{k!\,(n-k)!}

The cumulative probability adds these terms from 0 up to k:

P(X≤k)=∑i=0k(ni) pi(1−p)n−iP(X \le k) = \sum_{i=0}^{k} \binom{n}{i}\, p^{i} (1 - p)^{n-i}
  • nn is the number of trials and kk the number of successes.
  • pp is the chance of success on each trial, and 1−p1 - p the chance of failure.
  • (nk)\binom{n}{k}, read “n choose k”, counts the ways to choose which k trials succeed.

Every other version follows from these two: P(X<k)=P(X≤k−1)P(X < k) = P(X \le k - 1), P(X≥k)=1−P(X≤k−1)P(X \ge k) = 1 - P(X \le k - 1) and P(X>k)=1−P(X≤k)P(X > k) = 1 - P(X \le k).

Worked example: at least 20 of 24 seeds sprout

A seed packet says 85% of its seeds germinate. You plant 24. What is the chance that at least 20 sprout?

  1. Here n = 24 and p = 0.85, so 1 − p = 0.15. “At least 20” means 20, 21, 22, 23 or 24 sprout.
  2. Exactly 20: P(X = 20) = C(24, 20) × 0.85²⁰ × 0.15⁴ = 10,626 × 0.0387595 × 0.00050625 = 0.208504.
  3. The same formula gives P(X = 21) = 0.225051, P(X = 22) = 0.173903, P(X = 23) = 0.0856915 and P(X = 24) = 0.0202327.
  4. Add them: P(X ≥ 20) = 0.713382, about 71.34%. The shortcut gives the same: 1 − P(X ≤ 19) = 1 − 0.286618 = 0.713382.

The mean is 24 × 0.85 = 20.4 seedlings, with a standard deviation of 1.7493, and the most likely count is 21. The chance that between 18 and 22 sprout, inclusive, is 0.836884.

“At least” vs. “more than”: picking the right inequality

“At least 20” includes 20; “more than 20” starts at 21. In the seed example, at least 20 has probability 0.713382 while more than 20 has only 0.504879. The gap, 0.208504, is exactly P(X = 20). The same trap applies to “at most” (includes k) and “fewer than” (stops at k − 1).

In wordsSymbolIncludes k?Calculate as
exactly kX = kyesP(X = k)
at most k, no more than kX ≤ kyesP(X ≤ k)
fewer than k, less than kX < knoP(X ≤ k − 1)
at least k, no fewer than kX ≥ kyes1 − P(X ≤ k − 1)
more than k, greater than kX > kno1 − P(X ≤ k)

“Between” is ambiguous in everyday speech, so the range option shows both readings: including k₁ and k₂, and strictly between them.

Survey example. If each of 40 invited people replies with probability 30%, the chance of fewer than 10 replies is P(X ≤ 9) = 0.195925, not P(X ≤ 10) = 0.308743.

Dice example. The chance of exactly two 6s in 12 rolls is C(12, 2) × (1/6)² × (5/6)¹⁰ = 66 × 0.0277778 × 0.161506 = 0.296094.

Range example. If 1.5% of parts are defective, the chance that a sample of 200 holds 2 to 5 defective parts is P(X ≤ 5) − P(X ≤ 1) = 0.917608 − 0.196897 = 0.720712.

Binomial distribution table and chart

For up to 200 trials the table lists every k from 0 to n with P(X = k), P(X ≤ k) and P(X ≥ k), and the bar chart draws P(X = k), highlighting the bars your question counts. Bars too small to see are left off the chart, and its Chart data table lists every value drawn. With more than 200 trials the table shows the 201 values of k nearest the mean. Download CSV saves either table with full precision.

Mean, variance and standard deviation of a binomial distribution

The mean is μ=np\mu = np, the variance σ2=np(1−p)\sigma^2 = np(1 - p) and the standard deviation σ=np(1−p)\sigma = \sqrt{np(1 - p)}. The mean is the long-run average count, not necessarily a count that can happen: 24 seeds at 85% average 20.4 seedlings. The most likely count, the mode, is the whole number between (n + 1)p − 1 and (n + 1)p: for the seeds, 25 × 0.85 = 21.25, so the mode is 21. When (n + 1)p is a whole number, that count and the one just below it tie: 5 rolls of a die give (5 + 1) × 1/6 = 1, and 0 sixes and 1 six are equally likely.

When the binomial model applies (and when it doesn’t)

The count of successes is binomial only when all four hold:

  1. The number of trials is fixed in advance.
  2. Each trial has two outcomes, success or failure.
  3. The trials are independent.
  4. The chance of success is the same on every trial.

Drawing without replacement breaks the last two: after a red card leaves the deck, the next card is less likely to be red. That setting is the hypergeometric distribution. When the sample is a small share of the group, under about 5%, the binomial is a close stand-in.

Matching binompdf, binomcdf and BINOM.DIST

binompdf gives the chance of exactly k; binomcdf gives the cumulative chance of k or fewer. The calculator lists the matching calls for your inputs:

QuestionTI-84 (2nd DISTR)Excel
exactly kbinompdf(n, p, k)=BINOM.DIST(k, n, p, FALSE)
at most kbinomcdf(n, p, k)=BINOM.DIST(k, n, p, TRUE)
fewer than kbinomcdf(n, p, k − 1)=BINOM.DIST(k − 1, n, p, TRUE)
at least k1 − binomcdf(n, p, k − 1)=1-BINOM.DIST(k − 1, n, p, TRUE)
more than k1 − binomcdf(n, p, k)=1-BINOM.DIST(k, n, p, TRUE)
k₁ to k₂binomcdf(n, p, k₂) − binomcdf(n, p, k₁ − 1)=BINOM.DIST.RANGE(n, p, k₁, k₂)

Excel’s BINOM.DIST puts the successes first and returns #NUM! when k is more than n. For the seeds, =1-BINOM.DIST(19, 24, 0.85, TRUE) returns 0.713382.

How many trials do you need?

You need the smallest n for which P(X ≥ k), the chance of at least k successes, reaches the chance you want. Choose Trials needed to reach a chance and enter p, the number of successes you need and that chance; the calculator finds n and shows the chance one trial earlier. To be 90% sure of at least 20 seedlings from the 85% packet, plant 26 seeds: the chance is 0.916673 with 26 and 0.838485 with 25.

For at least one success there is a shortcut, n≥ln⁡(1−target)÷ln⁡(1−p)n \ge \ln(1 - \text{target}) \div \ln(1 - p). To have a 95% chance of rolling at least one 6, ln(0.05) ÷ ln(5/6) = 16.431, so you need 17 rolls, with a chance of 0.954927 (16 rolls give 0.945912). A table repeats the search for targets from 50% to 99.9%.

Finding k for a cumulative probability (BINOM.INV)

Choose k at a cumulative probability to find the smallest k with P(X ≤ k) at or above a level, which is what Excel’s BINOM.INV returns. Quality checks use it to set a limit: if 2% of parts are defective, a sample of 500 has 15 or fewer defective parts with probability 0.953003, while 14 or fewer has only 0.918643, so 15 is the 95th percentile, and more than 15 happens with probability 0.0469971. Because the count jumps in whole numbers, P(X ≤ k) usually passes the level rather than landing on it.

Normal approximation to the binomial

When np and n(1 − p) are both large, a normal distribution with mean np and standard deviation √(np(1 − p)) is close to the binomial. Treat each whole number k as the interval from k − 0.5 to k + 0.5 (the continuity correction). The usual rule asks for np and n(1 − p) both above 5, and the match is better when both are 10 or more. The calculator shows this estimate next to the exact value so you can see the difference:

  • Survey: np = 12 and n(1 − p) = 28, so fewer than 10 replies is P(Y < 9.5) = 0.194184, close to the exact 0.195925.
  • Seeds: n(1 − p) = 3.6, below 5, and P(Y > 19.5) = 0.696547 misses the exact 0.713382 by 0.0168.

With the exact value available, use the approximation only to check your intuition or to follow a textbook method. Continue in the Normal Distribution and Z-Score Calculator carries np, √(np(1 − p)) and the corrected cut-off over, so you can see the same approximation on a bell curve.

Very large n and very small probabilities

For up to 1,000 trials the calculator normally computes each probability as an exact fraction and rounds it once. Above that, it switches to a log-space saddle-point method that stays accurate to about 12 significant digits for up to 100,000 trials. The accuracy note under the results says which method was used. Probabilities below 1E-300 are reported as ”< 1E-300” rather than as 0: with n = 200 and p = 0.01, the chance that all 200 trials succeed is 0.01²⁰⁰ = 10⁻⁴⁰⁰, tiny but not impossible. A probability shown as ”> 0.999999” is below 1 but rounds to 1 at six digits; its complement in the table shows how much is left.

Common mistakes

  • Reading “at least” as “more than”. At least 20 includes 20. In the seed example the two differ by 0.208504.
  • Using binomcdf for “at least”. binomcdf(n, p, k) is P(X ≤ k). At least k is 1 − binomcdf(n, p, k − 1), with k − 1, not k.
  • Typing a percent as a whole number. p = 85 is not a probability. Type 85% or 0.85.
  • Swapping n and k in BINOM.DIST. Excel wants the successes first: BINOM.DIST(k, n, p, …).
  • Using the binomial for draws without replacement from a small group. Five cards from one deck are not independent trials; the hypergeometric distribution fits.
  • Rounding p early. Using 0.17 for 1/6 turns the chance of two 6s in 12 rolls from 0.296094 into 0.295953. Type 1/6.

Questions

How do I find the probability of at least one success?

Take 1 minus the chance of no successes: 1 − (1 − p)^n. For at least one 6 in 12 rolls of a die that is 1 − (5/6)^12 = 0.887843. In this calculator, choose At least k with k = 1. The probability calculator also covers “at least one” for events that are not identical trials.

Why does my textbook’s binomial table give a slightly different answer?

A table that prints three or four decimals rounds every entry, so a sum of several entries can be off in the last digit, and a table that lists only some values of p forces you to round p first. Rounding p moves the answer more. The calculator keeps p as you typed it and rounds only the final probability.

What is a Bernoulli trial?

One trial with two outcomes and a fixed chance of success, such as one coin toss or one inspected part. A binomial count is the number of successes in n independent Bernoulli trials, so a binomial distribution with n = 1 is a single Bernoulli trial.

Sources

  1. 1.3.6.6.18 Binomial Distribution NIST/SEMATECH e-Handbook of Statistical Methods The probability mass and cumulative distribution formulas, the mean np, the standard deviation √(np(1 − p)), the mode between p(n + 1) − 1 and p(n + 1), and that the percent point function is computed numerically.
  2. Introductory Statistics 2e, 4.3 Binomial Distribution OpenStax (Rice University) The conditions (fixed n, two outcomes, independent trials with the same p), μ = np and σ² = npq, the TI-83/84 binompdf and binomcdf syntax, and P(X > x) = 1 − binomcdf(n, p, x).
  3. Introductory Statistics 2e, 4.5 Hypergeometric Distribution OpenStax (Rice University) Sampling without replacement makes the picks dependent, which is the hypergeometric setting rather than Bernoulli trials.
  4. Introductory Business Statistics 2e, 6.3 Estimating the Binomial with the Normal Distribution OpenStax (Rice University) Drawing less than 5% of the objects without replacement lets the binomial stand in for the hypergeometric; the normal estimate needs both np and n(1 − p) above 5.
  5. Introductory Statistics 2e, 7.3 Using the Central Limit Theorem OpenStax (Rice University) The normal approximation to the binomial with mean np and standard deviation √(npq), the 0.5 continuity correction, and the rule that np and nq should exceed 5 (better, both 10 or more).
  6. BINOM.DIST function Microsoft Support BINOM.DIST(number_s, trials, probability_s, cumulative), FALSE for exactly and TRUE for at most, and the
  7. BINOM.DIST.RANGE function Microsoft Support BINOM.DIST.RANGE(trials, probability_s, number_s, number_s2) for the probability of a range of successes.
  8. BINOM.INV function Microsoft Support BINOM.INV returns the smallest value whose cumulative binomial probability is at least the criterion.
  9. Fast and Accurate Computation of Binomial Probabilities Catherine Loader (R Project technical report, 2002) The saddle-point method used for more than 1,000 trials, and why the common log-gamma formula loses accuracy for large n.