Binomial Distribution Calculator
Binomial Distribution Calculator
Find the exact chance of exactly, at most, at least or between k successes in n independent trials, with the mean, standard deviation and mode, the whole distribution charted, and the normal and Poisson approximations beside the exact answer.
Distribution
P(X = j) = C(n, j) × p^j × (1 − p)^(n − j). Cumulative answers add these terms from the smallest up, each found from logarithms, so a million trials work without overflow or rounding loss. Mean = np, variance = np(1 − p), mode = the whole part of (n + 1)p. The normal approximation widens the range by 0.5 at each end; the Poisson uses λ = np, or n(1 − p) on the failures when p is above 0.5. Trials are assumed independent with the same p. The CSV, image and printed report contain the values you entered, nothing preloaded.
How to use this tool
Enter the number of trials, the chance of success on each one and the count you care about. Type the chance as a decimal (0.25), a percentage (25%) or a fraction (1/6), then pick exactly, at most, fewer than, at least, more than, or a range between two counts. The answer comes as a percentage, a decimal, odds and, when p is a simple fraction, the exact fraction, and the cards below give all five one sided versions at once.
The input people most often get wrong is the condition. “At least 7” includes 7 and “more than 7” does not; for 10 coin flips that is 17.19% against 5.47%. The other trap is what counts as a success. It is whatever you are counting, not what you hope for: in a defect check a defective part is the success, and p is the defect rate.
What the calculation is doing
One particular sequence of n trials with k successes has probability p^k × (1 − p)^(n − k), and C(n, k) = n! ÷ (k! (n − k)!) counts the sequences, so P(X = k) = C(n, k) × p^k × (1 − p)^(n − k). Cumulative answers add these terms. The mean is np, the variance np(1 − p), and the mode is the whole part of (n + 1)p, with two equally likely counts when (n + 1)p is a whole number.
Done naively, the formula fails twice. Factorials overflow: 171! is about 1.24 × 10^309, past the largest number a browser can hold, so each term is worked out from logarithms with the saddle point method that R uses for its binomial function. And subtraction loses tails: P(X ≥ 6,000) in 10,000 flips is about 8.7 × 10^−88 percent, but 1 − P(X ≤ 5,999) comes out as exactly zero because the answer sits below the 16th digit. The calculator adds each tail directly, smallest terms first, and never subtracts from 1.

When the normal and Poisson shortcuts are good enough
Before computers nobody added a thousand terms by hand, so two shortcuts took over. The normal approximation swaps the bars for a bell curve with the same mean and standard deviation. Each bar is one unit wide, so P(X ≥ 7) is the area from 6.5 upward; that half step is the continuity correction. For 7 or more heads in 10 flips it gives 17.14% against an exact 17.19%. Without it the answer is 10.30%.
How many trials is enough depends on the shape. Penn State’s probability course accepts np and n(1 − p) of at least 5; its applied course asks for 10, because a small expected count makes the distribution lopsided. Guessing on 20 four choice questions has np = 5, and the chance of at least 10 right is 1.39% exactly but 1.01% by the curve, 27% too low. Tails are where the curve is weakest even with plenty of trials: for 6,000 or more heads in 10,000 flips the normal answer is about four times the exact one.
The Poisson approximation, with λ = np, suits many trials and a rare success. Penn State’s rule of thumb is n ≥ 20 with p ≤ 0.05, or n ≥ 100 with p ≤ 0.10. In the NIST acceptance sampling example, a lot that is 3% defective passes when a sample of 52 holds at most 3 defectives: 92.95% exactly, 92.66% by Poisson and 94.26% by the normal curve.
Cumulative probabilities for 20 trials
P(X ≤ k) for 20 trials, rounded to four decimals in the style of a printed table. For “at least k”, take 1 minus the entry for k − 1, or open the calculator for the unrounded figure.
| k | p = 0.05 | p = 0.1 | p = 0.25 | p = 0.5 | p = 0.75 | p = 0.9 |
|---|---|---|---|---|---|---|
| 0 | 0.3585 | 0.1216 | 0.0032 | 0.0000 | 0.0000 | 0.0000 |
| 1 | 0.7358 | 0.3917 | 0.0243 | 0.0000 | 0.0000 | 0.0000 |
| 2 | 0.9245 | 0.6769 | 0.0913 | 0.0002 | 0.0000 | 0.0000 |
| 3 | 0.9841 | 0.8670 | 0.2252 | 0.0013 | 0.0000 | 0.0000 |
| 4 | 0.9974 | 0.9568 | 0.4148 | 0.0059 | 0.0000 | 0.0000 |
| 5 | 0.9997 | 0.9887 | 0.6172 | 0.0207 | 0.0000 | 0.0000 |
| 6 | 1.0000 | 0.9976 | 0.7858 | 0.0577 | 0.0000 | 0.0000 |
| 7 | 1.0000 | 0.9996 | 0.8982 | 0.1316 | 0.0002 | 0.0000 |
| 8 | 1.0000 | 0.9999 | 0.9591 | 0.2517 | 0.0009 | 0.0000 |
| 9 | 1.0000 | 1.0000 | 0.9861 | 0.4119 | 0.0039 | 0.0000 |
| 10 | 1.0000 | 1.0000 | 0.9961 | 0.5881 | 0.0139 | 0.0000 |
| 11 | 1.0000 | 1.0000 | 0.9991 | 0.7483 | 0.0409 | 0.0001 |
| 12 | 1.0000 | 1.0000 | 0.9998 | 0.8684 | 0.1018 | 0.0004 |
| 13 | 1.0000 | 1.0000 | 1.0000 | 0.9423 | 0.2142 | 0.0024 |
| 14 | 1.0000 | 1.0000 | 1.0000 | 0.9793 | 0.3828 | 0.0113 |
| 15 | 1.0000 | 1.0000 | 1.0000 | 0.9941 | 0.5852 | 0.0432 |
| 16 | 1.0000 | 1.0000 | 1.0000 | 0.9987 | 0.7748 | 0.1330 |
| 17 | 1.0000 | 1.0000 | 1.0000 | 0.9998 | 0.9087 | 0.3231 |
| 18 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 0.9757 | 0.6083 |
| 19 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 0.9968 | 0.8784 |
| 20 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
A worked example you can check on paper
The calculator opens on 10 flips of a fair coin and the chance of at least 7 heads. Each sequence of 10 flips has probability 0.5 to the power 10 = 1/1,024. The number of sequences with exactly 7 heads is C(10, 7) = 10 × 9 × 8 ÷ (3 × 2 × 1) = 120; with 8 heads there are 45, with 9 there are 10 and with 10 there is 1. That makes 176 sequences, and 176 ÷ 1,024 = 11/64 = 0.171875, or 17.19%.
The mean is np = 10 × 0.5 = 5 and the standard deviation is √(10 × 0.5 × 0.5) = √2.5 = 1.5811. With the continuity correction the normal approximation is P(Z ≥ (6.5 − 5) ÷ 1.5811) = P(Z ≥ 0.9487) = 17.14%, close because p = 0.5 keeps the bars symmetric. The Poisson approximation with λ = 5 gives 23.78%, well off, because a 50% chance is anything but rare.
Mistakes that catch people out
Mixing up “at least” and “more than”. P(X ≥ 7) includes 7 and P(X > 7) starts at 8. For 10 fair flips they are 17.19% and 5.47%.
Using the binomial when p changes. Drawing parts from a small batch without putting them back changes the defect rate after every draw. When the sample is a large share of the lot, use the hypergeometric distribution.
Leaving out the continuity correction. Measuring the normal area from 7 rather than 6.5 turns 17.14% into 10.30% for the coin example, against an exact 17.19%.
Trusting a rule of thumb in the tails. Meeting np ≥ 10 says the middle of the distribution is bell shaped. It says little about a 1% tail.
Reading a rounded table for a rare event. An entry of 1.0000 is not certainty, and 1 minus it is not zero. Use the exact figure for anything below about 1%.
Popular calculations
Each opens the calculator with those numbers filled in, and they can be changed once it is open.
Coin flips
Guessing on a multiple choice test
Defects and acceptance sampling
Foul shots in basketball
100 trials and more
How this was checked
A separate program added the terms as exact fractions with big integers for 1,500 random cases with up to 300 trials, eleven simple values of p and all six conditions; the largest relative difference was 5 parts in ten million million, for answers as small as 10^−692. The same exact method at 10,000 trials, p = 1/2 and 3/10, agreed to 9 parts in ten million million, down to P(X ≥ 9,000) = 4.924 × 10^−1601. For 110 combinations of n and p up to 100,000 trials the terms add to 1 within 3.2 × 10^−15, and at a million trials the results match a separate incomplete beta calculation to about 2 parts in a billion.
All 59 entries taken from the University of Houston cumulative binomial table match to four decimals. The NIST/SEMATECH operating characteristic table for a sample of 52 with acceptance number 3 lists 12 values: 10 match to three decimals, and at 4% and 5% defective the handbook prints 0.845 and 0.739 where exact arithmetic gives 0.8460 and 0.7383. Penn State STAT 414 examples are reproduced: 0.246 for 5 heads in 10 flips, 0.0537 for 8 or 9 heads, and 0.258 exact against 0.265 Poisson for the bulbs. Its normal figures of 0.251, 0.0549 and 0.1575 come out exactly when z is rounded to two decimals, as with a printed z table; unrounded they are 0.2482, 0.0547 and 0.1580. Every address listed above was opened and checked for a distinct title, the right answer and clean exports at desktop and phone widths.
Common questions
What is the probability of getting exactly 5 heads in 10 coin flips?
252 out of 1,024, or 24.61%. There are C(10, 5) = 252 orders in which 5 heads and 5 tails can fall, and each order has a chance of 1 in 1,024. Five heads is the most likely result, yet it happens less than a quarter of the time.
How do you work out the probability of at least k successes?
Add P(X = j) for every j from k to n. For at least 7 heads in 10 flips that is 120 + 45 + 10 + 1 = 176 orders out of 1,024, or 17.19%. The shortcut 1 − P(X ≤ k − 1) works for large answers, but for very small tails the subtraction loses the digits that matter.
What are the mean and standard deviation of a binomial distribution?
The mean is np and the standard deviation is the square root of np(1 − p). For 100 fair coin flips that is 50 heads, give or take 5, and the chance of landing between 40 and 60 heads inclusive is 96.48%.
When can you use the normal approximation to the binomial?
When np and n(1 − p) are both at least 10, the safer rule, or at least 5, the looser one, and with the continuity correction: move each boundary half a step outward. Even then it is weakest for small tail chances.
What are the chances of passing a multiple choice test by guessing?
With 20 questions of 4 choices each, guessing at least 10 right has a chance of 1.39%, about 1 in 72, and at least 12, a 60% pass mark, 0.0935%, about 1 in 1,069. The expected score from guessing is 5.
What is the difference between the binomial and the Poisson distribution?
The binomial counts successes in a fixed number of trials, so it never exceeds n. The Poisson counts events with no upper limit. With many trials and a small p they nearly agree with λ = np: for 100 bulbs at 5% defective, at most 3 defective is 25.78% exactly and 26.50% by Poisson.
Related Calculators and Reference
- Dice Probability Calculator: the binomial applied to dice, such as the chance of at least one six in four rolls.
- Permutation and Combination Calculator: the C(n, k) that counts the orders behind every term.
- Z Score Calculator: normal curve areas, the basis of the normal approximation.
- Confidence Interval Calculator: turn an observed count of successes into a range for the true p.
- Sample Size Calculator: how many trials a survey or inspection needs for a given margin of error.
- Poisson Distribution Calculator: the count model when events arrive at a steady average rate and there is no fixed number of trials.
- Probability of Two Events Calculator: combine two different events instead of repeated trials of one.
- NIST/SEMATECH Handbook of Statistical Methods: Binomial Distribution: the formulas for the probability, cumulative distribution, mean, standard deviation and mode.
