Skip to content

Binomial Distribution Calculator - Free Probability Tool

Calculate binomial distribution probabilities instantly. Free online calculator for statistics, data science, and probability theory with step-by-step results.

Binomial Distribution Calculator

Probability
0.246094

Binomial Distribution Visualization

Binomial Distribution Chart
Chart showing the binomial distribution for 10 trials with 0.5 probability of success0.00000.05000.10000.15000.20000.2500Probability012345678910Number of Successes (k)0.00100.00980.04390.11720.20510.24610.20510.11720.04390.00980.0010
Loading calculator...
📚

Documentation

What is a binomial distribution calculator?

A binomial distribution calculator finds the probability of getting an exact number of successes in a fixed number of independent trials, when each trial has the same chance of success. It is used in statistics, quality control, medicine, and any field that studies repeated yes-or-no events.

The underlying idea is the binomial distribution, a probability model for counting successes in repeated trials that each have only two outcomes, usually called success and failure.

Binomial distribution formula

The probability of getting exactly k successes in n trials is:

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

Each symbol means:

  • n — the number of trials.
  • k — the number of successes to find the probability for.
  • p — the probability of success on a single trial, a number between 0 and 1.
  • (nk)\binom{n}{k} — the binomial coefficient, the number of different ways to choose k successes out of n trials. It equals n!k!(n−k)!\frac{n!}{k!(n-k)!}.

Every trial must be independent, meaning the outcome of one trial does not change the odds of another, and the success probability p must stay the same across all trials. A single trial with two possible outcomes, like one coin flip, is called a Bernoulli trial. A binomial distribution is what you get by adding up n Bernoulli trials.

How to calculate binomial probability

  1. Write down n, k, and p.
  2. Work out the binomial coefficient (nk)\binom{n}{k}, the number of ways to arrange k successes among n trials.
  3. Raise p to the power of k.
  4. Raise (1 − p) to the power of (n − k).
  5. Multiply the three numbers together.

The calculator on this page does these steps automatically. Enter n, p, and k, and it returns P(X = k) as a decimal rounded to six places, along with a bar chart showing the probability of every possible outcome from 0 to n successes. The number of trials n must be at least 1, and k must be between 0 and n.

Worked examples

Example 1: coin flips

Flip a fair coin 10 times. What is the probability of getting exactly 3 heads?

  • n = 10, p = 0.5, k = 3
  • (103)=120\binom{10}{3} = 120
  • 0.53=0.1250.5^3 = 0.125
  • 0.57=0.00781250.5^{7} = 0.0078125
  • Result: 120 × 0.125 × 0.0078125 ≈ 0.1172, or about 11.72%

Example 2: quality control

A factory inspects 100 items. Each item has a 2% chance of being defective. What is the probability that none of the 100 items are defective?

  • n = 100, p = 0.02, k = 0
  • Since k = 0, the formula reduces to (1−p)n=0.98100(1-p)^n = 0.98^{100}
  • Result: ≈ 0.1326, or about 13.26%

Example 3: disease testing

A city tests 1,000 people for a disease that infects 0.1% of the population (p = 0.001). What is the probability that exactly 5 of the 1,000 people are infected?

  • n = 1000, p = 0.001, k = 5
  • (10005)=8,250,291,250,200\binom{1000}{5} = 8{,}250{,}291{,}250{,}200
  • 0.0015=1×10−150.001^5 = 1 \times 10^{-15}
  • 0.999995≈0.36950.999^{995} \approx 0.3695
  • Result: 8,250,291,250,200 × 1e-15 × 0.3695 ≈ 0.00305, or about 0.30% (precise value 0.0030488, i.e. 0.30488%)

Mean and variance

For a binomial distribution with parameters n and p:

  • Mean (expected value): E(X) = np
  • Variance: Var(X) = np(1 − p)
  • Standard deviation: σ = √[np(1 − p)]

The mean tells you the average number of successes expected over many repeats. In Example 1, the mean is 10 × 0.5 = 5 heads.

When the binomial distribution applies

The binomial distribution only fits a situation when all four conditions hold:

  1. The number of trials, n, is fixed in advance.
  2. Each trial has only two outcomes: success or failure.
  3. The probability of success, p, is the same on every trial.
  4. The trials are independent of one another.

Drawing cards from a deck without replacement breaks the independence condition, because removing a card changes the odds for the next draw. That situation calls for the hypergeometric distribution instead.

Related distributions

  • Poisson distribution: used to approximate the binomial distribution. The approximation can be used when the number of trials is large and the probability of success is small. It is common for modeling rare events like the disease case in Example 3.
  • Normal distribution: for large n, the binomial distribution looks roughly bell-shaped and can be approximated by a normal distribution with mean np and variance np(1 − p). A common rule is that np and n(1 − p) must both be greater than 5; the approximation is better when both are at least 10.
  • Hypergeometric distribution: used instead of the binomial distribution when sampling is done without replacement from a finite population.

Frequently asked questions

What does a binomial distribution calculator do?

It calculates the probability of getting exactly k successes in n independent trials, each with success probability p, using the formula P(X = k) = C(n, k) × p^k × (1 − p)^(n − k).

What is the difference between binomial and normal distribution?

The binomial distribution is discrete, meaning it only produces whole-number counts of successes. The normal distribution is continuous. For large n, a binomial distribution can be approximated by a normal curve with mean np and variance np(1 − p).

Can p be 0 or 1?

Yes. If p = 0, no trial can succeed, so P(X = 0) = 1. If p = 1, every trial succeeds, so P(X = n) = 1. All other values of k have probability 0 in those cases.

What is the relationship between the binomial and Bernoulli distributions?

A Bernoulli distribution describes a single trial with two outcomes (n = 1). A binomial distribution is the sum of n independent Bernoulli trials, so a Bernoulli distribution is just a binomial distribution with n = 1.

Can the calculator handle a large number of trials?

Yes. The calculator uses standard double-precision numbers. For small n it multiplies the binomial coefficient by the powers of p and 1 − p directly. When the coefficient grows too large for the number format, or a power becomes too small, it switches to adding logarithms and converts the sum back at the end. The result stays a finite probability. For example, with n = 5,000, p = 0.5 and k = 2,500, it returns about 0.011283. For very large n, a normal or Poisson approximation is also common.

How is the binomial coefficient calculated?

The binomial coefficient C(n, k) counts the number of ways to choose k items from n items, regardless of order. It equals n! / (k! × (n − k)!), and can also be built up step by step by multiplying and dividing running totals, which avoids handling extremely large factorials directly.

References

  1. NIST/SEMATECH. e-Handbook of Statistical Methods, 1.3.6.6.18 Binomial Distribution. Binomial distribution — the probability mass function C(n, x) pˣ (1 − p)ⁿ⁻ˣ, with mean np and standard deviation √(np(1 − p)).
  2. OpenStax. Introductory Statistics 2e, 4.6 Poisson Distribution. Poisson distribution — the Poisson distribution may be used to approximate the binomial when p is small and n is large.
  3. OpenStax. Introductory Statistics 2e, 7.3 Using the Central Limit Theorem. Normal approximation to the binomial — np > 5 and nq > 5 for the normal approximation, better when both are at least 10; mean np.