Statistics & Probability

Binomial Distribution Calculator

This binomial probability calculator finds the chance of exactly k successes in n independent trials, or of at most, at least, fewer than, more than, or between two numbers of successes.

Try

A whole number from 0 to 1,000,000.

Between 0 and 1, for example 0.25 or 1/4.

Result

P(X ≥ 8): 0.1018118569

P(X ≥ 8)

0.1018118569

10.181186%

As a percentage
10.181186%
P(X = 8)
0.06088668922
P(X < 8)
0.8981881431
P(X ≤ 8)
0.9590748323
P(X > 8)
0.04092516771
Mean μ = np
5
Variance σ² = np(1 − p)
3.75
Standard deviation σ
1.936491673
How often
About 1 in 10

In 20 independent trials with success probability 0.25, the chance of at least 8 successes is 0.101812 (10.18%). On average you would expect 5 successes, give or take about 1.936.

Binomial distribution, n = 20, p = 0.25
00.050.10.150.2Number of successes kP(X = k)0: 0.0031712101: 0.02114142: 0.066947823: 0.1338964: 0.18968545: 0.2023316: 0.16860967: 0.1124068: 0.060886789: 0.027060810: 0.009922281011: 0.0030067512: 0.0007516881213: 0.00015419214: 0.00002569871415: 0.000003426516: 3.56927×10⁻⁷1617: 2.79942×10⁻⁸18: 1.55524×10⁻⁹1819: 5.45697×10⁻¹¹20: 9.09495×10⁻¹³20
Binomial distribution table, n = 20, p = 0.25
kP(X = k)P(X ≤ k)P(X ≥ k)
00.0031712119390.0031712119391
10.021141412930.024312624870.9968287881
20.06694780760.091260432460.9756873751
30.13389561520.22515604770.9087395675
40.18968545490.41484150250.7748439523
50.20233115190.61717265440.5851584975
60.16860929320.78578194760.3828273456
70.11240619550.89818814310.2142180524
80.060886689220.95907483230.1018118569
90.027060750760.98613558310.04092516771
100.009922275280.99605785830.01386441694
110.0030067500850.99906460840.003942141664
120.00075168752120.99981629590.0009353915793
130.0001541923120.99997048830.0001837040581
140.000025698718670.9999961870.00002951174611
150.0000034264958230.99999961350.000003813027433
163.569266482×10⁻⁷0.99999997043.865316103×10⁻⁷
172.799424692×10⁻⁸0.99999999842.960496204×10⁻⁸
181.55523594×10⁻⁹0.99999999991.610715117×10⁻⁹
195.456968211×10⁻¹¹15.547917681×10⁻¹¹
209.094947018×10⁻¹³19.094947018×10⁻¹³
Step-by-step working (3 steps)
  1. Probability of exactly 8 successes

    Choose which 8 of the 20 trials succeed (C(20, 8) = 125,970 ways), then multiply by the probability of 8 successes and 12 failures.

    P(X=8)=(208)(0.25)8(0.75)12=125970⋅0.258⋅0.7512=0.06088668922P(X = 8) = \binom{20}{8} (0.25)^{8} (0.75)^{12} = 125970 \cdot 0.25^{8} \cdot 0.75^{12} = 0.06088668922
  2. Add the probabilities of the outcomes you want

    The calculator adds the terms starting from the boundary and moving away from the peak, so even tiny tail probabilities keep their accuracy.

    P(X≥8)=∑i=820P(X=i)=1−P(X≤7)=0.1018118569P(X \ge 8) = \sum_{i=8}^{20} P(X = i) = 1 - P(X \le 7) = 0.1018118569
  3. Mean and standard deviation

    μ=np=20⋅0.25=5,σ=np(1−p)=1.936491673\mu = np = 20 \cdot 0.25 = 5, \quad \sigma = \sqrt{np(1 - p)} = 1.936491673

It uses P(X=k)=(nk)pk(1−p)n−kP(X = k) = \binom{n}{k} p^k (1 - p)^{n - k}, shows every step, and lists a table and graph of the distribution.

By Hira Noor, mathematicianLast reviewed Free, no sign-up, runs in your browserReport a problem

How to use this calculator

  1. Enter n, the number of independent trials (0 to 1,000,000), and p, the probability of success on each trial (a decimal or a fraction such as 1/6).
  2. Choose the probability to find. "At least 8" is P(X ≥ 8); "more than 8" is P(X > 8), which starts at 9.
  3. Enter k, or a and b for a range between two numbers. Both ends of a range are included.
  4. Read the probability at the top. The other four probabilities for the same k, the mean, variance and standard deviation, the steps, a distribution table and a graph follow underneath.

Formulas

Binomial probability

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)!}

Plain-text formula: P(X = k) = (C(n, k))p^k(1 − p)^(n − k), (C(n, k)) = (n!)/(k! (n − k)!)

nn
number of trials
pp
probability of success on each trial
kk
number of successes

The number of ways to place k successes among n trials, times the probability of any one such sequence.

Cumulative probabilities

P(X≤k)=∑i=0kP(X=i),P(X≥k)=1−P(X≤k−1)P(X \le k) = \sum_{i=0}^{k} P(X = i), \qquad P(X \ge k) = 1 - P(X \le k - 1)

Plain-text formula: P(X ≤ k) = ∑_{i = 0}^k P(X = i), P(X ≥ k) = 1 − P(X ≤ k − 1)

Every other question (fewer than, more than, between) is a sum of individual terms. The calculator sums from the boundary outward, which keeps small tail probabilities accurate to full precision.

Mean, variance and standard deviation

μ=np,σ2=np(1−p),σ=np(1−p)\mu = np, \qquad \sigma^2 = np(1 - p), \qquad \sigma = \sqrt{np(1 - p)}

Plain-text formula: μ = np, σ^2 = np(1 − p), σ = √(np(1 − p))

The expected number of successes and the typical distance from it.

Reading the result

The result is the probability of the event across the whole set of n trials. A value of 0.1018 means the event happens in about 10% of repetitions of the full experiment.

Watch the wording. "At least k" includes k (≥), "more than k" does not (>). Likewise "at most k" is ≤ and "fewer than k" is <. The list under the main answer shows all five versions, so you can pick the one your question needs.

The table lists the exact probability P(X = k), the cumulative binomial probability P(X ≤ k) (the binomial CDF) and P(X ≥ k) for every outcome with a noticeable probability, so you can read off several answers at once or copy them into a report.

How to calculate binomial probability by hand

1. Check the setting: a fixed number of trials n, two outcomes per trial, the same p each time, and independent trials.

2. Count the arrangements with the binomial coefficient: (nk)=n!k!(n−k)!\binom{n}{k} = \frac{n!}{k!(n - k)!}.

3. Multiply by pkp^k for the successes and (1−p)n−k(1 - p)^{n - k} for the failures. For 3 successes in 5 fair coin flips: (53)(0.5)3(0.5)2=10×0.03125=0.3125\binom{5}{3}(0.5)^3(0.5)^2 = 10 \times 0.03125 = 0.3125.

4. For "at most", "at least" or "between", add the single probabilities for each k in the range, or use the complement: P(X≥k)=1−P(X≤k−1)P(X \ge k) = 1 - P(X \le k - 1).

Is it a binomial experiment? The four conditions

The binomial model fits only when all four conditions hold. If one fails, another distribution is the right model.

ConditionWhat to checkIf it fails
Fixed number of trialsn is set before you startCounting trials until the r-th success: negative binomial (geometric when r = 1)
Two outcomesEach trial is a success or a failureThree or more categories: multinomial
Same probabilityp does not change from trial to trialDrawing without replacement from a small group: hypergeometric
Independent trialsOne outcome does not affect the nextClustered or dependent data: binomial results will be too optimistic

Turning words into binomial probabilities

Most mistakes come from the wording. This table converts each phrase into the probability to compute, with the matching TI-84 and Excel formula.

Question saysProbabilityTI-84Excel
exactly kP(X = k)binompdf(n, p, k)=BINOM.DIST(k, n, p, FALSE)
at most k, no more than kP(X ≤ k)binomcdf(n, p, k)=BINOM.DIST(k, n, p, TRUE)
fewer than k, less than kP(X ≤ k − 1)binomcdf(n, p, k − 1)=BINOM.DIST(k − 1, n, p, TRUE)
at least k, no fewer than k1 − P(X ≤ k − 1)1 − binomcdf(n, p, k − 1)=1 − BINOM.DIST(k − 1, n, p, TRUE)
more than k, greater than k1 − P(X ≤ k)1 − binomcdf(n, p, k)=1 − BINOM.DIST(k, n, p, TRUE)
between a and b (inclusive)P(X ≤ b) − P(X ≤ a − 1)binomcdf(n, p, b) − binomcdf(n, p, a − 1)=BINOM.DIST.RANGE(n, p, a, b)

Binomial probability in R, Python, Desmos and Casio

To check a result or run it in bulk, these are the equivalent commands for P(X = k), P(X ≤ k) and P(X ≥ k).

ToolP(X = k)P(X ≤ k)P(X ≥ k)
Rdbinom(k, n, p)pbinom(k, n, p)pbinom(k - 1, n, p, lower.tail = FALSE)
Python (SciPy)binom.pmf(k, n, p)binom.cdf(k, n, p)binom.sf(k - 1, n, p)
Desmosbinomialdist(n, p).pdf(k)binomialdist(n, p).cdf(k)1 − binomialdist(n, p).cdf(k − 1)
Casio fx-991EX / fx-CG50Distribution → Binomial PDDistribution → Binomial CD1 − Binomial CD at k − 1

Common mistakes

Mixing up ≥ and >. "At least 3" includes 3; "more than 3" starts at 4. The complement of P(X ≥ 3) is P(X ≤ 2), not P(X ≤ 3).

Using binomcdf for "at least". binomcdf always adds from 0 upward. For at least k, take 1 − binomcdf(n, p, k − 1).

Entering a percentage as p. Use 0.35, not 35.

Ignoring sampling without replacement. Drawing 10 cards from a 52-card deck changes p after each draw; use the hypergeometric distribution instead. With a population at least 20 times the sample, the binomial is a close approximation.

Reaching for the normal approximation when it is not needed. The approximation needs np ≥ 10 and n(1 − p) ≥ 10 and a continuity correction; the exact binomial is available here for any n up to a million.

Using the binomial for a hypothesis test

The exact binomial test asks how surprising an observed count is if p takes a claimed value. Suppose a coin lands heads 16 times in 20 flips. Under a fair coin, set n = 20, p = 0.5 and choose P(X ≥ 16): the result is 0.005909, the one-sided p-value. The Binomial test: 16 heads in 20 flips example above loads these inputs.

Because p = 0.5 makes the distribution symmetric, the two-sided p-value is twice that, 0.01182, which is below 0.05, so the data are evidence the coin is not fair. When p ≠ 0.5 the two tails are not mirror images; R's binom.test adds every outcome no more likely than the one observed.

Binomial, Poisson and normal: when to use which

Use a binomial calculator when you count successes in a known number of trials. When n is large and p is small (for example n ≥ 20 and p ≤ 0.05), the Poisson distribution calculator with λ = np gives nearly the same answer. When np and n(1 − p) are both at least 10, the normal distribution calculator with μ = np and σ = √(np(1 − p)) is a reasonable approximation, using a continuity correction of 0.5.

A Bernoulli trial is one trial with outcome 1 (success) or 0 (failure). The binomial distribution counts the successes in n such trials, so a Bernoulli distribution is the binomial with n = 1.

How the calculator stays accurate for large n

Factorials of large numbers overflow any calculator, so each term is computed with Loader’s saddle-point formula, the method R uses for its binomial functions. It writes ln P(X = k) with Stirling-series corrections and a deviance term that avoids cancellation, giving about 15 correct digits even for n = 1,000,000.

When there are more than 60 possible outcomes, the chart and table show a window around the mean (about ±4.5 standard deviations, widened to include your k). If the window still holds more than 60 outcomes, the chart groups neighboring outcomes into bars and the table is left out.

Worked example

Guessing on a multiple-choice quiz

A quiz has 20 questions with 4 options each. If you guess every answer, what is the probability of at least 8 correct?

  1. Each guess is a trial with p = 1/4 = 0.25, and n = 20.
  2. At least 8 means P(X ≥ 8) = 1 − P(X ≤ 7).
  3. Adding the terms for k = 0 to 7 gives P(X ≤ 7) ≈ 0.8981881431.
  4. So P(X ≥ 8) ≈ 1 − 0.8981881431 = 0.1018118569.
  5. The mean is np = 5 correct answers, with σ = √(20 × 0.25 × 0.75) ≈ 1.936.

Answer: P(X ≥ 8) ≈ 0.1018118569, about a 10.2% chance, or 1 in 10.

Frequently asked questions

What is the difference between binompdf and binomcdf?

binompdf gives P(X = k), the probability of exactly k successes. binomcdf gives P(X ≤ k), the probability of k or fewer. This calculator gives both, plus the at-least and more-than versions.

How do I calculate "at least one success"?

Use P(X ≥ 1), which equals 1 − (1 − p)ⁿ. For 10 trials with p = 0.1 that is 1 − 0.9¹⁰ ≈ 0.6513.

How do I find the probability between two numbers?

Choose "from a to b", then enter both ends. The calculator adds P(X = a) through P(X = b), so both ends are included. For 3 to 7 heads in 10 fair coin flips the answer is 0.890625.

What is the probability of 3 successes in 5 trials with p = 0.5?

P(X = 3) = C(5, 3) × 0.5³ × 0.5² = 10 × 0.03125 = 0.3125, or 31.25%.

Is the binomial distribution discrete or continuous?

Discrete. X can only take the whole numbers 0, 1, 2, …, n, so the distribution is a probability mass function shown as bars, not a smooth curve.

What is the difference between Bernoulli and binomial?

A Bernoulli variable describes one trial with outcome 1 or 0. A binomial variable counts the successes in n independent Bernoulli trials with the same p. A binomial with n = 1 is a Bernoulli variable.

When can I use the normal approximation instead?

A common rule of thumb is np ≥ 10 and n(1 − p) ≥ 10. You do not need it here: the calculator computes the exact binomial probabilities even for a million trials.

What if p is 0 or 1?

Then the outcome is certain: with p = 0 there are always 0 successes, and with p = 1 there are always n. The calculator returns probabilities of exactly 0 or 1 in those cases.

Can k be larger than n?

No. With n trials there can be at most n successes, so the calculator asks you to choose k between 0 and n.

Poisson Distribution Calculator

Exact and cumulative Poisson probabilities for any average rate λ, with steps, a table and a graph.

Statistics & Probability

Standard Deviation Calculator

Sample or population standard deviation and variance, with grouped data and a step-by-step deviation table.

Statistics & Probability

Statistics Calculator

Mean, median, mode, five-number summary, IQR, outliers and SD with steps, a histogram and a box plot.

Statistics & Probability

Sources and further reading

  1. Fast and Accurate Computation of Binomial Probabilities, technical report, Bell Laboratories, Lucent Technologies (Catherine Loader, 2000)
  2. Introductory Statistics 2e, Section 4.3: Binomial Distribution (opens in a new tab), OpenStax, Rice University
  3. NIST/SEMATECH e-Handbook of Statistical Methods, Binomial Distribution (opens in a new tab), National Institute of Standards and Technology
  4. The Binomial Distribution (dbinom, pbinom, qbinom, rbinom) (opens in a new tab), R Core Team, R documentation
  5. BINOM.DIST function (opens in a new tab), Microsoft Support

Results are calculated in your browser with methods checked by automated tests, and are intended for learning and general use. For engineering, medical, financial, legal or safety-critical decisions, verify important values independently and follow the rounding rules your work requires. How accurate are these results?