Binomial Distribution Calculator

Calculate binomial probabilities — exactly k, at most k, at least k — plus the mean, variance and standard deviation.

How to use this calculator

  1. 1Enter the number of trials and the probability of success on each one.
  2. 2Enter the number of successes you want the probability for.
  3. 3Read the cumulative figures too — "at least k" is usually what a real question is asking, not "exactly k".

How the calculation works

P(X = k) = C(n,k) · pᵏ · (1−p)ⁿ⁻ᵏ where C(n,k) = n! / (k!(n−k)!)
n
Number of independent trials
k
Number of successes you are asking about
p
Probability of success on any single trial
C(n,k)
Binomial coefficient — how many different ways k successes can occur among n trials

The formula has three parts that each do one job: pᵏ is the probability of k successes happening, (1−p)ⁿ⁻ᵏ is the probability of the remaining trials all failing, and C(n,k) counts how many different orderings produce that same total.

Mean = np and variance = np(1−p) follow directly from the fact that a binomial is the sum of n independent Bernoulli trials, each with mean p and variance p(1−p).

This calculator evaluates the coefficient in log space using the log-gamma function, so large values of n do not overflow — computing 1000! directly would exceed the range of a double, but its logarithm is perfectly manageable.

Worked example

Exactly 6 heads in 10 fair coin flips

  1. 1.C(10,6) = 10! ÷ (6! × 4!) = 210 — there are 210 different orderings that give 6 heads.
  2. 2.Each specific ordering has probability 0.5⁶ × 0.5⁴ = 0.5¹⁰ = 0.0009765625.
  3. 3.P(X = 6) = 210 × 0.0009765625 = 0.205078125, or about 20.5%.
  4. 4.Mean: 10 × 0.5 = 5 heads. Standard deviation: √(10 × 0.5 × 0.5) = √2.5 = 1.5811.
  5. 5.Note that 6 heads is more likely than any specific number other than 5 — but still only happens about one time in five.

Result: P(X = 6) = 0.205078, mean 5, SD 1.5811

When the binomial applies

A binomial distribution describes the number of successes in a fixed number of independent trials, where each trial has exactly two outcomes and the same probability of success every time. Those four conditions — fixed n, two outcomes, constant p, independence — are what make the formula valid, and violating any of them breaks it.

The independence condition is the one most often broken quietly. Drawing cards without replacement changes p after each draw, so card problems are hypergeometric rather than binomial. Sampling people from a small population has the same issue, though the effect is negligible when the sample is a small fraction of the whole.

Reading the three probabilities

Most practical questions are not about an exact count, and choosing the wrong one of these is a common mistake.

  • Exactly k — P(X = k)the single-point probability. Useful for "what are the chances of precisely this outcome", but often surprisingly small even for the most likely value.
  • At most k — P(X ≤ k)the cumulative probability up to and including k. This is what "no more than" and "k or fewer" mean.
  • At least k — P(X ≥ k)one minus the probability of fewer than k. This is usually what quality-control and hypothesis questions actually want: how surprising is it to see this many or more.

Why the most likely outcome is still unlikely

In ten fair coin flips, five heads is the most probable single result — and it only happens about 24.6% of the time. Six heads happens 20.5% of the time. This surprises people, but it follows from there being eleven possible outcomes sharing all the probability between them. As n grows the effect intensifies: the distribution spreads over more values, so the probability of any one exact count shrinks even as the distribution becomes more tightly concentrated in relative terms.

This is precisely why cumulative probabilities matter more than point probabilities for most real questions. "At least 8 heads in 10 flips" is a meaningful question with a meaningful answer; "exactly 500 heads in 1,000 flips" has an answer near 2.5% despite 500 being exactly what you expect.

The normal approximation, and when to trust it

For large n the binomial distribution becomes approximately normal with mean np and standard deviation √(np(1−p)) — a result that predates the general central limit theorem and is known as the de Moivre–Laplace theorem. The usual working rule is that the approximation is adequate when both np and n(1−p) are at least 5; some texts use 10 for more accuracy.

When p is very close to 0 or 1 the distribution stays skewed even for fairly large n, and the normal approximation misbehaves in the tails — exactly where it usually matters. In those cases the Poisson approximation (for small p and large n) is generally better, or simply compute the binomial exactly, which is what this calculator does regardless of n.

What this assumes, and where it stops

Assumptions

  • Trials are independent, with the same probability of success each time.
  • Each trial has exactly two possible outcomes, counted as success or failure.
  • The number of trials is fixed in advance, not determined by the results.

Limitations

  • Sampling without replacement from a small population is hypergeometric, not binomial — p changes after each draw, and this calculator will overstate or understate accordingly.
  • Capped at 1,000 trials. Beyond that the exact cumulative sum becomes slow, and a normal approximation is entirely adequate anyway.
  • Reports probabilities only; it does not perform a hypothesis test or produce a confidence interval for p.

Common questions

Why is exactly 5 heads in 10 flips only about 25% likely?

Because there are eleven possible outcomes (0 through 10 heads) sharing all the probability. Five is the most likely single value, but "most likely" does not mean "likely" — it only means no other exact count beats it. Cumulative questions like "between 4 and 6 heads" give much larger and usually more useful probabilities.

When can I use a normal approximation instead?

The usual rule is when both np and n(1−p) are at least 5. Below that the distribution is too skewed for the approximation to be reliable, particularly in the tails. This calculator computes the exact binomial either way, so the approximation is never actually necessary here — the note simply tells you whether it would have been safe.

Does this work for drawing cards from a deck?

Not correctly, unless you replace and reshuffle after each draw. Without replacement the probability changes with every card removed, which violates the constant-p assumption — that situation follows the hypergeometric distribution instead.

Formula and content last reviewed on .

Results are estimates for information only, not professional advice.

Report an error

Tools people commonly use alongside the binomial distribution calculator.

See all statistics calculators →