Binomial Distribution Calculator

StatisticsLast updated: August 22, 2026

The binomial distribution is the discrete probability distribution that models the number of successes in n independent trials. Every trial has only two outcomes (success/failure) and the success probability p stays the same throughout: how many of 20 products come out defective, how many heads appear in 10 tosses, and how many of 50 patients respond to treatment are all computed with this distribution.

After giving P(X = k) for a single value of k, this calculator returns the cumulative probabilities (P(X ≤ k), P(X < k), P(X ≥ k), P(X > k)), the probability of any range [a, b] you choose, and the mean (n·p), variance (n·p·(1−p)), standard deviation, and mode of the distribution. It also checks the np ≥ 5 and n(1−p) ≥ 5 criterion and tells you whether the normal approximation may be used with these parameters.

How many independent repetitions there are. It must be an integer.
Enter a value between 0 and 1 (0.3 for 30 percent). A decimal comma is also accepted.
The number of successes whose probability is computed. It must be an integer between 0 and n.
The lower bound for P(a ≤ X ≤ b). If left empty, 0 is assumed.
The upper bound for P(a ≤ X ≤ b). If left empty, n is assumed.

Binomial Distribution Formulas

Mass function:   P(X = k) = C(n, k) · pᵏ · (1 − p)ⁿ⁻ᵏ,  k = 0, 1, …, n
Combination:     C(n, k) = n! / [k! · (n − k)!]
Cumulative:      P(X ≤ k) = Σᵢ₌₀ᵏ C(n, i) · pⁱ · (1 − p)ⁿ⁻ⁱ
Upper tail:      P(X ≥ k) = 1 − P(X ≤ k − 1)
Range:           P(a ≤ X ≤ b) = P(X ≤ b) − P(X ≤ a − 1)
Mean:            μ = n · p
Variance:        σ² = n · p · (1 − p)
Standard dev.:   σ = √[n · p · (1 − p)]
Mode:            ⌊(n + 1) · p⌋
Normal approx.:  if n·p ≥ 5 and n·(1 − p) ≥ 5 then X ≈ N(n·p, n·p·(1 − p))

Cumulative probabilities are evaluated with the regularized incomplete beta function (I₁₋ₚ(n − k, k + 1)) rather than a summation loop, which keeps the result exact and fast even for very large n. The normal approximation is only for hand calculation — this calculator always returns the exact binomial value.

How to Calculate

  1. Enter the number of trials (n): how many independent repetitions were made.
  2. Enter the success probability of a single trial (p) between 0 and 1; write 0.3 for 30 percent.
  3. Enter the number of successes (k) whose probability you are interested in.
  4. If you like, set the range bounds (a and b); the calculator also returns P(a ≤ X ≤ b).
  5. Read the exact, cumulative, and tail probabilities on the result card, then the mean, variance, standard deviation, and mode.
  6. Check the normal approximation criterion and the mass chart to judge the shape and symmetry of the distribution.

Worked Examples

6 successes in 20 trials

With n = 20 and p = 0.3, the probability of exactly 6 successes is P(X = 6) = 0.1916. The probability of at most 6 successes is 0.6080 and of at least 6 successes 0.5836. The mean is 6 successes, the standard deviation is 2.0494, and P(4 ≤ X ≤ 8) = 0.7796. Since n·p = 6 and n·(1−p) = 14, the normal approximation is also suitable.

Exactly 6 successes — P(X = 6): 0.1916 · At most 6 successes — P(X ≤ 6): 0.6080 · Fewer than 6 — P(X < 6): 0.4164

Quality control: no defects among 50 products

When 50 products are drawn from a line with a 2% defect rate, the probability of finding no defective item is P(X = 0) = 0.3642. The probability of finding at least one defect is P(X > 0) = 0.6358, and the probability of at most one defect is P(0 ≤ X ≤ 1) = 0.7358. On average 1 defective product is expected; because n·p = 1 < 5 the normal approximation is not suitable and the calculator issues a warning.

Exactly 0 successes — P(X = 0): 0.3642 · At most 0 successes — P(X ≤ 0): 0.3642 · Fewer than 0 — P(X < 0): 0

Number of heads in 10 tosses

With a fair coin, the probability of exactly 5 heads in 10 tosses is P(X = 5) = 0.2461. The probability of getting between 4 and 6 heads is P(4 ≤ X ≤ 6) = 0.6562. At p = 0.5 the distribution is symmetric: the mean is 5, the standard deviation is 1.5811, and the mode is 5.

Exactly 5 successes — P(X = 5): 0.2461 · At most 5 successes — P(X ≤ 5): 0.6230 · Fewer than 5 — P(X < 5): 0.3770

Frequently Asked Questions

Under what conditions is the binomial distribution used?
Four conditions must hold together: the number of trials (n) is fixed, each trial has only two outcomes, the trials are independent of one another, and the success probability (p) is the same in every trial. If one of them breaks, the distribution changes: sampling without replacement calls for the hypergeometric distribution, and an unfixed number of trials for the negative binomial.
Why is P(X ≥ k) found as 1 − P(X ≤ k − 1) rather than 1 − P(X ≤ k)?
The binomial is a discrete distribution, so the value k itself carries probability mass. Because P(X ≥ k) includes k, its complement is P(X ≤ k − 1), which excludes k. This is the most common mistake in binomial problems, and it throws the answer off by exactly P(X = k).
How do I get the same result in Excel, SPSS, and R?
In Excel use =BINOM.DIST(k, n, p, FALSE) for the exact probability and =BINOM.DIST(k, n, p, TRUE) for the cumulative one. In R, dbinom(k, n, p) and pbinom(k, n, p) give the same values, as do scipy.stats.binom.pmf/cdf in Python. In SPSS the functions are PDF.BINOM(k, n, p) and CDF.BINOM(k, n, p).
When can the normal approximation be used?
The common criterion is that n·p ≥ 5 and n·(1−p) ≥ 5 hold together; some sources set the bound at 10. When the condition holds you may write X ≈ N(n·p, n·p·(1−p)), but since you are representing a discrete distribution with a continuous one, the continuity correction (±0.5) should be applied. This calculator always computes the exact value, so you never need the approximation here.
What should I do when p is very small and n is very large?
When n ≥ 20 and p ≤ 0.05 (or n ≥ 100 and n·p ≤ 10), the binomial distribution is approximated very well by a Poisson distribution with λ = n·p. For rare events (accident counts, failure counts, rare diseases) it is more practical to model with Poisson directly. Because this calculator returns the exact binomial value without approximating, you can also use it to check the comparison.
Why do the mode and the mean differ?
The mean n·p is an expected value and need not be an integer; the mode is the integer value with the highest probability and is found as ⌊(n+1)p⌋. When (n+1)·p is an integer the distribution has two modes: (n+1)p − 1 and (n+1)p. For any p other than 0.5 the distribution is skewed, so the mean and the mode separate.
The result came out as 0 — is the calculation wrong?
No. Very small probabilities (for instance 90 successes out of 100 trials with p = 0.1) can fall below the limits of double-precision arithmetic. The calculator writes values below 0.0001 in scientific notation (such as 3.214e-8); if you see exactly 0, the probability really is extremely close to zero, or k is outside the support.