Binomial Distribution Calculator
The chance of k successes in n independent trials, exactly or cumulatively.
Last updated
Your details
As a decimal between 0 and 1.
Result
- P(X = 6)
- 20.5078%
- P(X = 6) exactly
- 20.5078%
- Expected successes
- 5
- Standard deviation
- 1.5811
- Normal approximation valid?
- Yes
As a decimal, 0.20507813
n × p
√(n × p × (1 − p))
Needs np and n(1−p) both at least 5
6 successes in 10 trials at p = 0.5…
P(X = k) = C(n,k) × pᵏ × (1−p)ⁿ⁻ᵏ
C(10,6) = 210
0.5^6 × 0.5^4
P(X = 6) = 20.5078%
Formula — written step by step
Exactly 6 heads in 10 fair coin tosses…
P(X = k) = C(n,k) × pᵏ × (1−p)ⁿ⁻ᵏ
C(10,6) = 210
0.5⁶ = 0.015625
0.5⁴ = 0.0625
210 × 0.015625 × 0.0625
P(X = 6) = 20.5078%
n is the number of trials, p the chance of success on each, and k the successes you are asking about. C(n,k) counts how many different orders produce that many successes.
A worked example
Quality control on a production run
- Batch size
- 20 items
- Defect rate
- 5% — p = 0.05
- Question
- chance of 2 or more defects
- P(0 defects) = 0.95²⁰ = 0.358486
- P(1 defect) = 20 × 0.05 × 0.95¹⁹ = 0.377354
- P(0 or 1) = 0.735840
- P(2 or more) = 1 − 0.735840
26.42% — about one batch in four
The expected number of defects is only 1, yet more than a quarter of batches contain at least two. Averages hide variability: a process running exactly to specification still produces batches that look alarming, and reacting to each one is how stable processes get destabilised.
How to use this calculator
- Enter the number of independent trials and the probability of success on any single one.
- Enter the number of successes you are asking about, and choose whether you want exactly that many or a cumulative range.
- The table lists every outcome with its individual and cumulative probability.
- Check the normal-approximation row before using a z-test on this data — it needs both np and n(1−p) to be at least 5.
Counting successes
The binomial distribution answers one question: in n independent attempts, each succeeding with probability p, what is the chance of exactly k successes? It applies to coin tosses, defect rates, conversion rates and any other yes-or-no trial repeated a fixed number of times.
The formula has two parts. The probability of one particular sequence with k successes is pᵏ(1−p)ⁿ⁻ᵏ. The binomial coefficient C(n,k) counts how many different sequences have that many successes. Multiply them and you have the total.
Mean and spread
The expected number of successes is np, which matches intuition: twenty trials at a 5% rate average one success. The standard deviation is √(np(1−p)), and it grows only as the square root of n.
That square root has a practical consequence. As trials multiply, the absolute spread widens while the proportion of successes tightens around p. A hundred tosses vary more in raw count than ten do, but the percentage of heads is far more predictable.
The normal approximation
Where n is large and p is not too close to either extreme, the binomial is well approximated by a normal distribution with mean np and standard deviation √(np(1−p)). This is what makes z-tests on proportions valid.
The usual condition is that np and n(1−p) both reach at least 5, and the calculator reports whether yours do. With a small n or a very rare event the approximation fails in exactly the tail you were interested in, and the exact binomial — or the Poisson, for rare events — is the right tool.
Formula & methodology
What this calculator assumes
- Requires a fixed number of independent trials, two outcomes, and a probability that does not change between them. Sampling without replacement violates the last of these; below about 10% of the population the error is negligible.
- Probabilities are computed in logarithms so that large n does not overflow, and the cumulative form uses the incomplete beta identity so it stays exact where summing would not.
- The normal approximation is only reported as valid when np and n(1−p) both reach 5.
Sources
When the binomial applies
| Requirement | What it means | Where it fails |
|---|---|---|
| Fixed n | The number of trials is decided in advance | Sampling until you get a success |
| Two outcomes | Each trial is a success or a failure | Three or more categories |
| Constant p | The probability does not change between trials | Dealing cards without replacement |
| Independence | One result does not affect another | Contagion, or clustered defects |
Sampling without replacement breaks the constant-p requirement. When the sample is under about 10% of the population the error is small enough to ignore; beyond that, the hypergeometric distribution is the correct one.
Frequently asked questions
What does C(n,k) mean?
The number of ways to choose k items from n without regard to order — "n choose k". C(10,6) is 210, meaning 210 different orderings of ten tosses give exactly six heads.
When should I not use the binomial?
When trials are not independent, when the probability changes between them, or when there are more than two outcomes. Sampling without replacement from a small population is the most common violation.
What is the difference between "exactly" and "at most"?
"Exactly k" is a single outcome. "At most k" adds up every outcome from 0 to k, which is the cumulative probability and is usually the figure a decision rests on.
Can p be zero or one?
Yes, though the result is then trivially certain. The calculator handles both without dividing by zero.
Probability of each outcome
| k | P(X = k) | P(X ≤ k) |
|---|---|---|
| 0 | 0.0977% | 0.0977% |
| 1 | 0.9766% | 1.0742% |
| 2 | 4.3945% | 5.4687% |
| 3 | 11.7187% | 17.1875% |
| 4 | 20.5078% | 37.6953% |
| 5 | 24.6094% | 62.3047% |
| 6 | 20.5078% | 82.8125% |
| 7 | 11.7187% | 94.5313% |
| 8 | 4.3945% | 98.9258% |
| 9 | 0.9766% | 99.9023% |
| 10 | 0.0977% | 100% |