Skip to content
DeviceCheckHub

Binomial Distribution Calculator

Find the probability of exactly, at most, at least or between a number of successes in n independent trials, with the mean, standard deviation, a chart, a full table and each step.

Your trials

The probability of at most 12 successes in 20 trials is 0.973785.

P(X ≤ 12) = 0.973785

About 97.38%, with n = 20 trials and p = 0.41.

05101520
P(X = 12)
0.041734
P(X ≤ 12)
0.973785
P(X < 12)
0.932051
P(X ≥ 12)
0.067949
P(X > 12)
0.0262151
Mean μ = np
8.2
Standard deviation σ
2.19955
Variance σ²
4.838
Most likely value
8

In Excel or Google Sheets: =BINOM.DIST(12, 20, 0.41, TRUE)

In R: pbinom(12, 20, 0.41)

Step by step

  1. X ~ B(20, 0.41): 20 independent trials, each a success with probability p = 0.41, so q = 1 − p = 0.59.
  2. P(X = 12) = C(20, 12) × p^12 × q^8 = 125,970 × 0.41¹² × 0.59⁸ = 0.041734.
  3. P(X ≤ 12) = P(X = 0) + P(X = 1) + … + P(X = 12) = 0.973785.
  4. Mean μ = np = 20 × 0.41 = 8.2; standard deviation σ = √(npq) = √(20 × 0.41 × 0.59) = 2.19955.

Probability table

Every possible number of successes, 0 to 20.

xP(X = x)P(X ≤ x)P(X ≥ x)
02.612 × 10⁻⁵2.612 × 10⁻⁵1
10.00036310.0003892> 0.9999
20.0023970.0027860.9996
30.0099940.012780.9972
40.029520.04230.9872
50.065640.10790.9577
60.1140.2220.8921
70.15850.38040.778
80.1790.55940.6196
90.16580.72520.4406
100.12680.8520.2748
110.080070.93210.148
120.041730.97380.06795
130.017850.99160.02622
140.0062010.99780.008368
150.0017240.99960.002167
160.00037430.99990.0004432
176.12 × 10⁻⁵> 0.99996.883 × 10⁻⁵
187.089 × 10⁻⁶> 0.99997.625 × 10⁻⁶
195.185 × 10⁻⁷> 0.99995.365 × 10⁻⁷
201.802 × 10⁻⁸11.802 × 10⁻⁸

How to use the binomial distribution calculator

  1. Enter the number of trials n and the probability of success on each trial p, as a decimal, a percent or a fraction.
  2. Choose what you want: exactly x successes, at most x, fewer than x, at least x, more than x, or between x₁ and x₂.
  3. Enter x. The probability, the other probabilities for the same x, the mean and standard deviation, the chart and the table update as you type.

What the binomial distribution is

The NIST/SEMATECH e-Handbook of Statistical Methods puts it simply: “The binomial distribution is used when there are exactly two mutually exclusive outcomes of a trial. These outcomes are appropriately labeled ‘success’ and ‘failure’.” The random variable X counts the successes in n trials.

OpenStax lists three characteristics of a binomial experiment: “There are a fixed number of trials,” there are “only two possible outcomes, called ‘success’ and ‘failure,’ for each trial,” and “the n trials are independent and are repeated using identical conditions.” So the probability of success, p, stays the same from trial to trial, and the probability of failure is q = 1 − p. Flipping a coin 10 times, guessing on 20 true-or-false questions, or checking 50 parts from a production line where each is defective with the same probability are all binomial.

The binomial formula

The probability of exactly x successes is P(X = x) = C(n, x) × pˣ × qⁿ⁻ˣ, where C(n, x) = n! / (x!(n − x)!) is the number of ways to choose which x of the n trials are the successes. Each such arrangement has probability pˣqⁿ⁻ˣ, and there are C(n, x) of them.

For example, with n = 20 and p = 0.41, the probability of exactly 12 successes uses C(20, 12) = 125,970 arrangements, each with probability 0.41¹² × 0.59⁸, so P(X = 12) = 0.041734. Twelve successes is quite possible, but it is well above the mean of np = 8.2.

At most, at least and the other cumulative probabilities

Most real questions ask about a range: at most 12, at least 3, fewer than 5. These add up the single probabilities. “At most x” is P(X ≤ x) = P(X = 0) + P(X = 1) + … + P(X = x), the cumulative probability. The others follow from it:

The calculator shows all five single-x probabilities at once, so you don’t have to work out which one a word problem means before you start.

Worked examples

In OpenStax’s Example 4.13, about 41% of adult workers have a high school diploma but don’t pursue further education. If 20 workers are chosen at random, the probability that at most 12 of them are in that group is P(X ≤ 12) = 0.973785, which matches OpenStax’s 0.9738. You would expect np = 20 × 0.41 = 8.2 of them.

In Example 4.14, a catalog has 560 pages, 8 of which feature signature artists, and 100 pages are sampled. Entering p as the fraction 8/560, the probability that more than three sampled pages feature signature artists is P(X > 3) = 0.055681, which OpenStax rounds to 0.0557.

In Example 4.15, the lifetime risk of developing cancer is about 1.5%, and 200 people are sampled. The mean is 3, the standard deviation is 1.71901, and P(X ≤ 8) = 0.996496. Is it more likely that five or six people develop cancer? P(X = 5) = 0.101067 and P(X = 6) = 0.0500206, so five is about twice as likely as six.

Mean, standard deviation and the most likely value

For the binomial distribution, OpenStax gives the mean and variance as “μ = np and σ² = npq,” so the standard deviation is σ = √(npq). The mean is the long-run average number of successes, and σ measures how far a typical result falls from it. NIST gives the mode, the most likely number of successes, as the whole number between p(n + 1) − 1 and p(n + 1). When p(n + 1) is a whole number, p(n + 1) − 1 and p(n + 1) are equally likely, and the calculator shows both.

The shape of the distribution

When p = 0.5 the distribution is symmetric about n/2. When p is small, it is bunched near 0 with a long tail to the right, and when p is close to 1 it is bunched near n. As n grows, the bars form the familiar bell shape around np. The chart above shows the part of the distribution where nearly all of the probability lies, with the bars for your question highlighted.

When it isn’t binomial

The independence condition is the one most often broken. OpenStax’s Example 4.16 chooses a chairperson and a recorder from a committee of ten staff members and six students by drawing names without replacement. The chance that the second name is a student depends on the first, so the trials aren’t independent and the problem isn’t binomial. Drawing without replacement from a small group calls for the hypergeometric distribution instead.

In Excel, Google Sheets or R

Excel’s BINOM.DIST(number_s, trials, probability_s, cumulative) gives either probability. In Microsoft’s words, “If cumulative is TRUE, then BINOM.DIST returns the cumulative distribution function, which is the probability that there are at most number_s successes; if FALSE, it returns the probability mass function.” BINOM.DIST.RANGE(trials, probability_s, number_s, number_s2) gives the probability of a range of successes directly. In R, dbinom gives P(X = x) and pbinom gives P(X ≤ x). The calculator writes the exact formula for your question in both.

Accuracy for large n

Adding up thousands of tiny probabilities, or using a normal approximation, can lose accuracy for large n or far out in the tails. The calculator instead works out each single probability with Loader’s saddle-point method and each cumulative probability from the incomplete beta function, so results stay accurate for up to a billion trials. Results are kept as logarithms as well, so probabilities far smaller than 10⁻³⁰⁰ are shown in powers of ten instead of being rounded to 0.

Your data stays on your device

Everything is worked out in your browser. Nothing you type is sent anywhere or stored.

Frequently asked questions

What is the difference between “at most” and “fewer than”?

“At most 12” includes 12: P(X ≤ 12). “Fewer than 12” stops at 11: P(X < 12) = P(X ≤ 11). In the same way, “at least 3” includes 3, while “more than 3” starts at 4.

Can I enter p as a percent or a fraction?

Yes. Type 0.41, 41% or a fraction such as 8/560. The calculator uses the exact value of the fraction.

How large can n be?

Up to a billion trials. The probabilities are worked out exactly, not with a normal approximation, so they stay accurate even far out in the tails.

When is a problem not binomial?

When the number of trials isn’t fixed, when there are more than two outcomes, or when the trials aren’t independent, such as drawing without replacement from a small group. Then another distribution, such as the hypergeometric, fits better.

How do I do this in Excel or Google Sheets?

BINOM.DIST(x, n, p, FALSE) gives P(X = x), and BINOM.DIST(x, n, p, TRUE) gives P(X ≤ x). The calculator shows the exact formula for your question under the result.

Is my data uploaded?

No. Everything is worked out in your browser and nothing you type is sent anywhere or stored.

Last updated · About DeviceCheckHub