Successes in a fixed number of trials — exactly, and the four conditions that have to hold.
Successes in a fixed number of trials
Works up to n in the thousands: the arithmetic runs in log space, so it does not overflow where a factorial would.
n = 20, p = 0.3000, k = 6
0.191639
P(exactly 6) in 20 trials. The distribution has mean np = 6.000 and standard deviation 2.0494.
Probability
0.191639
exactly 6
Mean
6.0000
np
Standard deviation
2.0494
sqrt(np(1−p))
C(20, 6)
3.8760e+4
ways to choose k from n
The normal approximation, and whether it is allowed here
The same question answered exactly and by the normal approximation with a continuity correction.
Method
Probability
Difference
Exact binomial
0.191639
—
Normal approximation
0.192750
0.58% off
np = 6.00 and n(1−p) = 14.00. The usual condition is that BOTH are at least 10, and here they are not — yet the approximation happens to land within 0.58% anyway. That is luck rather than a guarantee: the condition is about the worst case, and moving k into the tail will pull the two apart.
What this tool shows
Exact throughout, in log space, so n = 5000 works where a factorial overflows at about 170. The normal approximation is printed beside the exact answer with its condition evaluated — and it is 0.6% off at the centre of the default case and 261% off in the tail of the same one.
Exactly k, at most, fewer than, at least, more than
Exact arithmetic at n in the thousands
The distribution drawn, with your outcomes shaded
Mean, standard deviation and the binomial coefficient
The normal approximation and its np ≥ 10 condition
How far off the approximation actually is
Exact, not approximated Outcomes shaded Approximation error shown Conditions stated
Sampling without replacement is a different distribution.
Updated 8 September 2026 · Works in any browser, no installation
P(X = k) = C(n, k) · pᵏ · (1−p)ⁿ⁻ᵏ. The coefficient counts how many orderings give k successes, and the two powers give the probability of any one of those orderings. Everything else on this page is about when that formula is the right one.
At a glance
Formula shown
P(X = k) = C(n,k)·pᵏ·(1−p)ⁿ⁻ᵏ, with mean np and variance np(1−p). Cumulative probabilities use the regularised incomplete beta identity rather than a sum, which stays exact at large n. The coefficient is computed through log-gamma, so n is not limited by factorial overflow.
Scenario support
Quality control on a batch; the chance of at least so many conversions from a fixed number of visitors; coin and dice problems; the number of defective items in a shipment; any fixed number of independent yes/no trials.
Educational estimate
Planning support from the values you enter — not professional advice.
The four conditions, and the one that fails
The binomial applies only when four things are true. Three are usually obvious and one is routinely violated without anyone noticing.
A fixed number of trials. n is decided in advance. If you keep going until something happens, that is a different distribution — geometric or negative binomial depending on the stopping rule.
Two outcomes per trial. Success or failure, however you define them. More than two categories needs the multinomial.
Constant probability. p is the same on every trial. A machine that wears as it runs, or a person who improves with practice, breaks this.
Independence — and this is the one that fails. Each trial must not affect the others. The usual culprit is sampling without replacement: draw 5 cards from a deck and the second draw depends on the first, so the count of aces is not binomial. It is hypergeometric.
The saving grace is that when the population is large relative to the sample, the dependence is negligible. The usual rule is that the sample can be treated as independent if it is under about 10% of the population — which is why polling 1,000 people from millions is safely binomial, and why inspecting 20 items from a box of 50 is not.
The other common violation is clustering. Testing 100 plants from 10 pots is not 100 independent trials if plants in a pot share conditions, and treating it as such makes every interval too narrow.
The normal approximation, and where it collapses
Courses teach the normal approximation because computing exact binomials by hand at n = 500 was impossible. It is no longer necessary, and it is worth seeing how wrong it can be.
The usual condition is np ≥ 10 and n(1−p) ≥ 10. Both, not either — a large n with a tiny p fails it just as surely as a small n.
But the condition is about the distribution as a whole, and the error is not spread evenly across it. Take the tool’s default: n = 20, p = 0.3.
At k = 6, right at the mean, the approximation is 0.6% off. Perfectly usable, even though np = 6 fails the condition.
At k = 0, in the tail, it is 261% off. The exact probability is 0.000798 and the approximation says 0.002883 — more than three times too large, on the same distribution with the same condition.
That is the pattern generally: approximations to a discrete distribution are best near the centre and worst in the tails, and the tails are usually the part you care about. “What is the chance of zero failures” and “what is the chance of at least fifteen” are exactly the questions where it misleads.
The continuity correction — using k ± 0.5 rather than k — helps and is applied in the comparison above. It does not rescue the tail.
The practical position: there is no longer a reason to approximate. The exact calculation is instant at any n a browser will be given, and this page reports it.
Why n = 5000 does not break this
A detail that decides whether a calculator works at realistic sizes.
The obvious way to compute C(n, k) is n! / (k!(n−k)!). The problem is that 171! exceeds the largest number a double can hold. Compute C(1000, 500) that way and every term overflows to infinity, leaving infinity divided by infinity, which is NaN.
This is not hypothetical. Plenty of online binomial calculators fail silently somewhere past n = 170, returning NaN, zero, or an error, and a user with a realistic sample size gets no answer.
The fix is to work in logarithms. ln C(n, k) = lnΓ(n+1) − lnΓ(k+1) − lnΓ(n−k+1), and the log-gamma function has no overflow problem at these sizes. The final probability is exponentiated only once, at the end, when it is back in a representable range.
The cumulative probabilities use a second trick: rather than summing k+1 individual terms, they use the identity that relates the binomial CDF to the regularised incomplete beta function. That is one evaluation instead of thousands, and it does not accumulate rounding error across a long sum.
The suite asserts both: that C(1000, 500) is finite through logs, that the PMF is still sensible at n = 5000, and that the closed-form CDF matches a literal sum of the PMF term by term across several n and p — which is the check that the shortcut is genuinely equivalent rather than merely fast.
What p does to the shape
The distribution’s appearance is governed almost entirely by p, and the tool redraws it as you change the value.
At p = 0.5 it is exactly symmetric, for any n. Successes and failures are interchangeable, so the picture is a mirror about n/2.
At small p it is right-skewed, bunched near zero with a tail stretching up. At large p it is the mirror image. The skewness is (1−2p)/√(np(1−p)), which is zero exactly at p = 0.5 and grows as p moves away.
Larger n pushes it toward symmetry whatever p is, because that skewness shrinks with √n. This is the same mechanism as the central limit theorem — a binomial count is a sum of n independent trials — and it is why the normal approximation improves with n.
Two more properties worth having. The variance np(1−p) is maximised at p = 0.5, which is why that value is the conservative default in a sample size calculation. And the most likely single outcome is ⌊(n+1)p⌋, which is usually but not always the integer nearest the mean.
Getting "at least" right
The commonest arithmetic error with the binomial is an off-by-one at the boundary, and it comes from the fact that discrete distributions distinguish < from ≤ while continuous ones do not.
P(X ≥ k) = 1 − P(X ≤ k−1), not 1 − P(X ≤ k). The value k itself belongs to the “at least” side, so it must not be subtracted away.
P(X > k) = 1 − P(X ≤ k), where k does get excluded.
For a continuous distribution the distinction is irrelevant, because a single point has zero probability. For a discrete one it is a whole term, and at small n that term can be a large share of the answer. This is why the tool offers all five phrasings as separate buttons rather than making you subtract.
A related trap in wording: “at least one” is almost always best computed as 1 − P(none), which is a single term rather than a long sum. The chance of at least one six in four rolls is 1 − (5/6)⁴ = 0.5177 — one line, and the historical problem that started probability theory.
The distributions on either side of it
The binomial sits in a family, and knowing which neighbour you actually need saves the wrong answer.
Without replacement: hypergeometric. Drawing from a finite population changes the composition as you go. Cards from a deck, defective items from a box, a committee from a group.
Waiting for the first success: geometric. The number of trials is not fixed — you stop when it happens.
Waiting for the r-th success: negative binomial. The generalisation of the geometric, and also the standard fix for count data that is more variable than a Poisson allows.
Rare events over an interval: Poisson. When n is large and p is small, the binomial converges on the Poisson with λ = np. This is a genuinely useful limit — it replaces two parameters with one, and it applies when you do not know n at all, which is typical of arrivals and defects.
Large n, moderate p: normal. The approximation discussed above, and the one with the least reason to be used now.
Where it applies, and one place it does not
The binomial is the right model wherever a fixed number of independent yes/no trials share a probability.
Quality control. Defects in a production run, when the run is large relative to the sample.
Conversion. Sign-ups from a fixed number of visitors. This is also the model behind the two-proportion test used for A/B tests.
Diagnostics. The number of true positives from a fixed number of tests at a known sensitivity.
Genetics. Offspring inheriting a trait, where Mendelian ratios give p directly.
And a case where it looks right and is not: a run of results from a sports team or a trader. Wins are not independent trials with a constant probability — form, injuries, opponents and confidence all violate both conditions. The binomial will produce a number, and the number will describe a process that does not exist.
Sources and methodology
References for the exact computation and the approximation conditions.
Method. Everything is computed exactly. The binomial coefficient goes through log-gamma rather than factorials, so C(1000, 500) is finite where the direct form overflows a double past 170 — the suite asserts that, and that the PMF is still sensible at n = 5000. Cumulative probabilities use the regularised incomplete beta identity rather than summing terms, and the suite asserts that the closed form matches a literal term-by-term sum of the PMF across three combinations of n and p, worst case under 1e-11, which is the check that the shortcut is equivalent rather than merely fast. The normal approximation shown for comparison includes a continuity correction, and its error against the exact value is computed live rather than described. That engine is verified on every change against 88 assertions. The count and the per-case breakdown are published on the formula verification page.
Related calculators
Where this goes next:
Poisson DistributionPoisson probabilities with a dispersion test against your own variance — because a Poisson forces variance to equal the mean, and real count data usually does not, which is exactly where the tail goes wrong.
Hypergeometric DistributionExact probabilities for drawing without replacement, with the binomial answer beside them and the 10% rule evaluated — at a 40% sampling fraction the binomial is 22% wrong, at 0.2% it is 0.06% wrong.
Normal DistributionProbabilities under a normal curve in all four directions with the region shaded — and the empirical rule given exactly, because two standard deviations is 95.45% and the 95% everyone quotes sits at 1.96σ.
z-testOne-proportion, two-proportion and known-sigma mean z-tests — with the t-test computed beside the mean case, because for a mean the z-test needs a σ almost nobody actually has.
Sample SizeResponses needed for a target margin of error, with the finite-population correction and a table of the whole cost curve — because n scales with 1/margin², so the last point of precision costs more than the first ten.
p-valueA p-value from a t or z statistic, one- or two-tailed — with a panel that holds an effect fixed and grows the sample, so you can watch significance appear from nothing but n.
An educational tool. The binomial requires independent trials with a constant probability; sampling without replacement from a small population, or clustered observations, break that and need a different distribution.
Published an exact binomial calculator that works at n in the thousands, because the coefficient runs through log-gamma rather than factorials — the direct form overflows a double past n = 170 and many calculators fail silently there.
Prints the normal approximation beside the exact answer with its np ≥ 10 condition evaluated. On the default case it is 0.6% off at the centre and 261% off in the tail — same n, same p, same condition.
Names independence as the condition that actually fails, almost always because the sampling was done without replacement, which is a different distribution rather than a small error.
Add this calculator to your site
Responsive embed — and private: nothing your visitors type leaves their browser.