Skip to content

Binomial Distribution Calculator

Exact binomial probabilities P(X = k), P(X ≤ k), P(X ≥ k) and P(a ≤ X ≤ b), with mean, variance, mode and chart.

Your details

As a decimal between 0 and 1: 0.25 means 25 %.

Probability of

Results update as you type

P(X = k) — exactly k

0.24609375

P(X < k) — fewer than k
0.37695313
P(X ≤ k) — at most k
0.62304688
P(X > k) — more than k
0.37695313
P(X ≥ k) — at least k
0.62304688
Mean μ = np
5
Variance σ² = np(1 − p)
2.5
Standard deviation σ
1.581139
Mode (most likely k)
5
Skewness (1 − 2p)/σ
0

Normal approximation not shown: np = 5 and n(1 − p) = 5 must both be at least 10.

Step-by-step solution
  1. P(X = 5) = C(10, 5) × 0.5^5 × 0.5^5 = 0.24609375
  2. P(X ≤ 5) = Σ P(X = i), i = 0…5 = 0.62304688
  3. P(X ≥ 5) = 1 − P(X ≤ 4) = 0.62304688
  4. μ = n·p = 5 ; σ² = n·p·(1 − p) = 2.5 ; σ = 1.581139

Probability of each number of successes

The binomial distribution describes the number of successes XX in a fixed number nn of independent trials that each succeed with the same probability pp: heads in ten coin tosses, correct guesses on a multiple-choice quiz, defective parts in a sample of 50, patients who respond to a treatment. Write it X∼B(n,p)X \sim \mathcal{B}(n, p).

This calculator gives the whole distribution, not just one number. Enter nn and pp, then either a single number of successes kk or an interval from aa to bb. You get the exact probabilities P(X=k)P(X = k), P(X<k)P(X < k), P(X≤k)P(X \le k), P(X>k)P(X > k) and P(X≥k)P(X \ge k) — the values a calculator's binompdf and binomcdf functions return — or P(a≤X≤b)P(a \le X \le b), together with the mean, variance, standard deviation, mode and skewness. A bar chart and a table list the probability of every value of kk around the mean with its cumulative probabilities, so you can read off any tail without a printed table.

When the distribution is wide enough (np≥10np \ge 10 and n(1−p)≥10n(1-p) \ge 10), the calculator also shows the normal approximation with continuity correction, so you can check a textbook answer worked by hand. The exact values never rely on that approximation: they are computed in log space and with the regularized incomplete beta function, which stays accurate up to a million trials.

For questions about two events, conditional probability or "at least one success", the probability calculator is the better starting point; this page is for studying the binomial law itself.

How to use this calculator

  1. Enter the number of trials nn (a whole number).
  2. Enter the probability of success pp on each trial as a decimal (0.25 for one chance in four).
  3. Choose k successes to get exact and cumulative probabilities around a single value, or Between a and b for an interval; both bounds are included.
  4. Read the headline probability, the other tails, the mean and standard deviation, then scroll the chart and table to see how the probability spreads over all values of kk.

Check the binomial conditions before you trust the answer: a fixed number of trials, only two outcomes per trial, the same pp every time and independent trials. Drawing without replacement from a small population breaks independence — the hypergeometric distribution applies there.

The formula

For X∼B(n,p)X \sim \mathcal{B}(n, p) and k=0,1,…,nk = 0, 1, \dots, n (NIST e-Handbook §1.3.6.6.18):

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)!}
P(X≤k)=∑i=0k(ni)pi(1−p)n−i=I1−p(n−k, k+1)P(X \le k) = \sum_{i=0}^{k} \binom{n}{i} p^i (1-p)^{n-i} = I_{1-p}(n-k,\ k+1)
μ=npσ2=np(1−p)mode=⌊(n+1)p⌋γ1=1−2pnp(1−p)\mu = np \qquad \sigma^2 = np(1-p) \qquad \text{mode} = \lfloor (n+1)p \rfloor \qquad \gamma_1 = \frac{1-2p}{\sqrt{np(1-p)}}

Ix(a,b)I_x(a, b) is the regularized incomplete beta function (DLMF 8.17.5); it gives the cumulative sum directly, without adding thousands of terms. When (n+1)p(n+1)p is a whole number, the distribution has two modes, (n+1)p−1(n+1)p - 1 and (n+1)p(n+1)p.

Normal approximation with continuity correction, used when np≥10np \ge 10 and n(1−p)≥10n(1-p) \ge 10:

P(a≤X≤b)≈Φ ⁣(b+0.5−μσ)−Φ ⁣(a−0.5−μσ)P(a \le X \le b) \approx \Phi\!\left(\frac{b + 0.5 - \mu}{\sigma}\right) - \Phi\!\left(\frac{a - 0.5 - \mu}{\sigma}\right)

Worked example

Ten coin tosses. n=10n = 10, p=0.5p = 0.5, k=5k = 5: P(X=5)=(105)/210=252/1024=P(X = 5) = \binom{10}{5}/2^{10} = 252/1024 = 0.24609375. Exactly five heads happens in fewer than one try in four. The probability of at most five heads is 638/1024≈638/1024 \approx 0.623.

Guessing on a quiz. Ten questions with four choices each, answered at random: n=10n = 10, p=0.25p = 0.25. The chance of exactly 3 correct answers is 0.2503 (25 %), and the chance of passing with at least 6 correct is only 0.0197 (1.97 %). The mean is np=2.5np = 2.5 correct answers with a standard deviation of 1.369.

Normal approximation. n=50n = 50, p=0.3p = 0.3, so μ=15\mu = 15 and σ=10.5≈\sigma = \sqrt{10.5} \approx 3.24. Both np=15np = 15 and n(1−p)=35n(1-p) = 35 exceed 10. The exact probability of 10 to 20 successes is 0.912; the approximation Φ(5.5/3.240)−Φ(−5.5/3.240)\Phi(5.5/3.240) - \Phi(-5.5/3.240) gives 0.9104 — close, but the exact value is the one to report.

Reading the shape of the distribution

With p=0.5p = 0.5 the binomial distribution is perfectly symmetric around n/2n/2. When pp is small the bars pile up near zero and the distribution has a long right tail (positive skewness); when pp is close to 1 it leans the other way. As nn grows, the shape becomes more and more bell-like, which is why the normal approximation works for large samples.

The standard deviation np(1−p)\sqrt{np(1-p)} is largest at p=0.5p = 0.5. About 95 % of the probability lies within two standard deviations of the mean once the distribution looks roughly normal — compare with the empirical rule.

Exactly, at most, at least: choosing the right tail

Word problems translate into one of five probabilities:

Phrase Probability
exactly kk P(X=k)P(X = k)
at most kk, no more than kk P(X≤k)P(X \le k)
fewer than kk P(X≤k−1)P(X \le k - 1)
at least kk, kk or more P(X≥k)=1−P(X≤k−1)P(X \ge k) = 1 - P(X \le k - 1)
more than kk P(X≥k+1)P(X \ge k + 1)

Because XX only takes whole values, "fewer than 5" and "at most 4" are the same event. Most mistakes on exams come from that off-by-one step.

Frequently asked questions

What is the difference between binompdf and binomcdf?

binompdf gives the probability of exactly k successes, P(X = k). binomcdf gives the cumulative probability of at most k successes, P(X ≤ k). This calculator shows both at once, plus the strict and upper tails.

When can I use the normal approximation?

A common rule is np ≥ 10 and n(1 − p) ≥ 10; some textbooks accept 5. Always add or subtract 0.5 (continuity correction), because a discrete count is being replaced by a continuous curve. With a computer, the exact binomial value is always preferable.

How do I find the expected value of a binomial distribution?

Multiply the number of trials by the probability of success: E(X) = np. With 50 trials and p = 0.3 you expect 15 successes on average. The variance is np(1 − p) and the standard deviation its square root.

Why can the distribution have two modes?

When (n + 1)p is a whole number, the values (n + 1)p − 1 and (n + 1)p have exactly the same probability. For example, with n = 9 and p = 0.5, both 4 and 5 successes have probability 126/512.

Can I use this when sampling without replacement?

Only if the sample is small compared with the population (under about 5 % of it). Otherwise the probability of success changes from draw to draw and the hypergeometric distribution is the correct model.

Sources

Last updated:

More Statistics calculators

People also use