Quick answer: A binomial distribution counts successes in a fixed number of independent two-outcome trials with a constant success probability p. The probability of exactly x successes in n trials is C(n, x) × p^x × (1 − p)^(n − x), where C(n, x) is the binomial coefficient nCr. The mean is n × p and the standard deviation is the square root of n × p × (1 − p). Enter your n, p and x above and this binomial distribution calculator returns every one of those figures, plus the full distribution.
How to use this binomial distribution calculator
Step 1 — Count your trials. Enter n, the fixed number of times the experiment runs: 10 coin flips, 20 multiple-choice questions, 100 items off a production line. n must be a whole number. This page accepts n up to 500, for reasons explained honestly in the limits section below; the great majority of textbook, exam and quality-control problems sit far below that.
Step 2 — Enter the success probability as a decimal. p is the probability of success on a single trial, between 0 and 1. A fair coin gives p = 0.5, a one-in-six dice face gives p ≈ 0.1667, and a 3 percent defect rate gives p = 0.03. If your problem states a percentage, divide by 100 first: 25 percent becomes 0.25. Entering 25 instead of 0.25 is the single most common input error with any binomial probability calculator, so the field is checked and flagged rather than silently miscalculated.
Step 3 — Enter the successes you are asking about. x is the count in your question: exactly 5 heads, at most 3 defects, at least 2 correct guesses. x must be a whole number between 0 and n — you cannot succeed more times than you try.
Step 4 — Read the figure that matches your wording. The headline is P(X = x), exactly x successes. Around it sit the four cumulative answers: P(X ≤ x) for at most, P(X < x) for fewer than, P(X ≥ x) for at least, and P(X > x) for more than. Below them, the chart and table show the probability of every count from 0 to n with your x highlighted, so you can see whether your answer sits at the peak of the distribution or out in a tail. Save, copy or email the summary when you need the numbers elsewhere; everything is computed on your device and nothing is uploaded.
The four conditions: when a binomial model applies
In short: a binomial model applies when there is a fixed number of trials, each trial has exactly two outcomes, the trials are independent, and the probability of success is the same on every trial. If any one of the four fails, the binomial distribution formula gives the wrong answer, however carefully it is computed.
Fixed number of trials. You decide n before you start: flip the coin 10 times, sample 50 items. Flipping until the first head appears has no fixed n — the count of trials is itself the random thing — and that experiment follows a geometric distribution instead. The distinction matters because the binomial question is always how many successes in this many trials.
Two outcomes per trial. Every trial must resolve to success or failure, however you define them. A dice roll has six outcomes, but the question how many sixes in 20 rolls is still binomial, because each roll is scored as six (success) or not-six (failure). What breaks the condition is asking about several outcome types at once — the counts of ones, twos and threes together follow a multinomial distribution, not a binomial one.
Independence. One trial's result must not change another's chances. Coins, dice and roulette wheels satisfy this naturally. Drawing cards from a deck without replacement does not: once the ace of spades is drawn, it cannot be drawn again, so the deck — and every probability — changes. That setting belongs to the hypergeometric distribution. Sampling people works the same way in principle, though when the sample is a small fraction of a very large population the change is negligible and the binomial model is the standard practical approximation.
Constant p. The success probability must be identical on every trial. A quality-control line whose defect rate drifts during a shift, or a shooter who tires, breaks this condition even if everything else holds. When p genuinely varies trial by trial, no single binomial distribution describes the count, and results from this or any binomial calculator should be treated as an approximation whose quality depends on how much p moves.
The binomial distribution formula and nCr
The formula: P(X = x) = C(n, x) × p^x × (1 − p)^(n − x). Each of the three parts answers a different sub-question, and reading the formula as three parts is the surest way to set up a problem correctly by hand.
p^x is the probability that the x chosen trials all succeed. (1 − p)^(n − x) is the probability that the remaining n − x trials all fail — note that the failure probability is written 1 − p and is sometimes given the letter q. Multiply those two and you have the probability of one specific arrangement: say, successes on the first x trials and failures on the rest. But successes can occupy any x of the n positions, and every arrangement has that same probability, which is where the third part comes in.
C(n, x) — nCr — counts the arrangements. It is the binomial coefficient: the number of ways to choose which x of the n trials are the successes. Its own formula is n! / (x! × (n − x)!), factorials cancelling heavily in practice. For n = 10 and x = 5 it equals 252. This page displays nCr for your inputs alongside the probabilities, because it is also the number students most often need to show in their working — and the number whose size explains why naive factorial arithmetic overflows: 500! is astronomically larger than any ordinary calculator number, which is why this page computes with logarithms of factorials (the log-gamma method) instead of factorials themselves.
Two built-in checks follow from the formula. The probabilities of all counts from 0 to n must sum to exactly 1, and the table under the calculator lets you confirm that: its cumulative column ends at 1.0000. And swapping successes for failures mirrors the distribution — P(X = x) with probability p equals P(X = n − x) with probability 1 − p — because relabelling the outcomes cannot change the underlying chances.
Worked example: exactly 5 heads in 10 fair flips
Flip a fair coin 10 times and ask for exactly 5 heads. Here n = 10, p = 0.5 and x = 5 — the pre-filled values in the calculator above, chosen because every figure can be checked by hand. The binomial coefficient C(10, 5) is 252. Each specific order of 5 heads and 5 tails has probability 0.5^10, which is 1/1024. So P(X = 5) = 252/1024 = 0.2461 to four decimal places — the single most likely outcome, and still less than a 1 in 4 chance, because the probability is shared among 11 possible counts.
| k (heads) | P(X = k) | P(X ≤ k) |
|---|---|---|
| 0 | 0.0010 | 0.0010 |
| 1 | 0.0098 | 0.0107 |
| 2 | 0.0439 | 0.0547 |
| 3 | 0.1172 | 0.1719 |
| 4 | 0.2051 | 0.3770 |
| 5 | 0.2461 | 0.6230 |
| 6 | 0.2051 | 0.8281 |
| 7 | 0.1172 | 0.9453 |
| 8 | 0.0439 | 0.9893 |
| 9 | 0.0098 | 0.9990 |
| 10 | 0.0010 | 1.0000 |
Read two more figures off the same table. The probability of 3 or fewer heads, P(X ≤ 3), is 0.1719 — the cumulative column at k = 3, built from (1 + 10 + 45 + 120)/1024 = 176/1024. The probability of at least 5 heads, P(X ≥ 5), is 1 − P(X ≤ 4) = 1 − 0.3770 = 0.6230. Notice the perfect symmetry around 5: with p = 0.5 the distribution is a mirror image, so P(X = k) equals P(X = 10 − k) in every row. Run the pre-filled example in the calculator and every number in this table is reproduced, row for row.
Cumulative probabilities: at most, at least, fewer than, more than
Most real questions are not about exactly one count. A pass mark, a tolerance limit or a warranty threshold asks about a range of counts, and the cumulative probabilities on this page answer those questions directly. The whole skill is translating English into the right inequality — and the translation is where marks are lost, because ≤ and < differ by exactly one count.
At most x and no more than x both mean X ≤ x: x itself is included. Fewer than x and less than x mean X < x, which is the same as X ≤ x − 1. At least x means X ≥ x, x included. More than x and over x mean X > x, the same as X ≥ x + 1. This calculator shows all four at once precisely so the wording, not the arithmetic, is the only thing you have to get right.
The four figures are tied together by identities worth knowing. P(X < x) = P(X ≤ x) − P(X = x), because the two ranges differ only by the count x itself. P(X ≥ x) = 1 − P(X < x), and P(X > x) = 1 − P(X ≤ x), because each pair splits all outcomes into two complementary halves. These complements are also the practical way to compute tail probabilities by hand from printed tables, which typically tabulate only the left-hand cumulative P(X ≤ x).
A range with both ends, such as between 3 and 7 successes inclusive, is a difference of two cumulatives: P(3 ≤ X ≤ 7) = P(X ≤ 7) − P(X ≤ 2). Read both values from the table under the calculator and subtract. The inclusive/exclusive care applies at both ends — between 3 and 7 exclusive of 7 would subtract P(X ≤ 6) instead — so write the inequality symbols down before touching any numbers.
Mean, variance and standard deviation of a binomial distribution
Three summary numbers describe any binomial distribution completely, and all three are simple products. The mean (expected value) is n × p: the long-run average count of successes. The variance is n × p × (1 − p). The standard deviation is the square root of the variance. For the worked example, n = 10 and p = 0.5 give a mean of 5, a variance of 2.5 and a standard deviation of 1.5811 — a typical flip session lands within roughly 1.6 heads of 5.
The mean deserves one caution: it is an average over repetitions, not a prediction for one run, and it need not be an achievable count. Twenty questions guessed at random with four options each (p = 0.25) have a mean of exactly 5, but 100 items with a 3 percent defect rate have a mean of 3 while any single batch shows a whole number — and a mean like 3.5, from n = 10 and p = 0.35, can never occur in a single experiment at all. Report it as the centre of the distribution, which is what it is.
The variance formula carries a lesson about predictability. The factor p × (1 − p) is largest at p = 0.5 and falls towards both ends, so a binomial distribution is most spread out when success and failure are equally likely, and tightens as the outcome becomes a near-certainty either way. A process with p = 0.98 barely varies; a fair coin varies as much as a two-outcome trial can. If you need the standard deviation of measured data rather than of a trial count, that is a different calculation — see the Standard Deviation Calculator linked from the tool above — and for the plain mean of a list of numbers, the Average Calculator.
Together, mean and standard deviation power the normal approximation described next: for large n, the binomial count behaves like a normal random variable with that mean and that standard deviation, which is why these two figures appear on every binomial results panel, including this one.
Reading the table and chart: shape, large n and the normal approximation
The chart above the table draws one bar per count, its height the probability of that count. Three shapes cover almost everything you will meet. With p = 0.5 the chart is a symmetric hill centred on the mean. With p below 0.5 it leans right — a peak at low counts and a long tail of rarer high counts — and with p above 0.5 it mirrors, leaning left. As n grows, whatever the lean, the hill smooths out and the individual probabilities shrink, because the same total probability of 1 is shared among more counts.
Large n is where the log-gamma method earns its place. Computing C(200, 100) through factorials means handling 200!, a number with 375 digits, and then dividing two such giants; ordinary floating-point arithmetic overflows long before that, returning infinity or zero and silently corrupting every probability. This page instead adds and subtracts logarithms of factorials — computed by the Lanczos approximation to the gamma function — and exponentiates only the final, modest result. Try n = 200, p = 0.5, x = 100: the calculator returns P(X = 100) ≈ 0.0563 with a mean of 100 and a standard deviation of about 7.0711, no overflow anywhere. The full 201-row table is generated the same way.
For large n there is also a famous shortcut: the normal approximation to the binomial. When n × p and n × (1 − p) are both comfortably large — a common rule of thumb asks for at least 10 each — the binomial distribution is well approximated by a normal distribution with mean n × p and standard deviation √(n × p × (1 − p)), ideally with a continuity correction of 0.5 at each boundary. It exists because historically the binomial table for n = 200 was unprintable; with exact computation available on this page it is now mainly a check and a teaching bridge between discrete and continuous distributions.
One visual habit is worth building: before reading any single probability, look at where your x sits against the peak. An exactly-x probability near the peak of a wide distribution can still be small — 0.0563 for the single most likely count at n = 200 — not because the outcome is unlikely in any meaningful sense, but because its neighbours are nearly as likely. Cumulative probabilities, which pool the neighbourhood, are usually the figures that carry the real meaning.
Spreadsheets and code: BINOM.DIST, dbinom and scipy
Every serious tool implements the same distribution, under different names. In Excel and Google Sheets, BINOM.DIST(x, n, p, FALSE) returns P(X = x) and BINOM.DIST(x, n, p, TRUE) returns the cumulative P(X ≤ x); the older BINOMDIST has identical arguments. The other three figures on this page follow from those two by the complement identities in the cumulative section. In R, dbinom(x, n, p) is the exact probability and pbinom(x, n, p) the cumulative. In Python, scipy.stats.binom.pmf and scipy.stats.binom.cdf match them, and math.comb(n, x) returns nCr exactly, as an integer of arbitrary size.
Cross-checking is good practice, and small last-decimal differences between tools are normal rounding, not error: this page shows four decimal places, spreadsheets show more, and both are rounding the same exact value. A difference in the second decimal place, by contrast, almost always means a different quantity was computed — most often the cumulative where the exact was wanted, or p entered as a percentage. Match the function to the wording first, then compare digits.
Common mistakes
Entering p as a percentage. p = 25 instead of 0.25 is either rejected (as here) or, worse, silently produces nonsense elsewhere. Probabilities live between 0 and 1; percentages must be divided by 100.
Confusing ≤ with <. At most 3 includes 3; fewer than 3 stops at 2. The two answers differ by the whole of P(X = 3), which near the peak of a distribution can be a fifth of the total probability. Translate the words into a symbol before calculating.
Using the binomial where the conditions fail. Cards drawn without replacement, a drifting success rate, or trials that influence each other all break the model. The formula still returns a number — it always does — but the number no longer describes the experiment.
Reporting the mean as a guaranteed outcome. An expected value of 5 successes does not make 5 successes likely in any strong sense: in the worked example it happens only about 24.61 percent of the time. The mean is a centre, not a promise.
Expecting the exact probability to grow with n. The chance of hitting the single most likely count actually falls as n rises, because probability spreads over more counts. Judge outcomes by ranges and cumulative probabilities, not by the exact figure alone.
Honest limits: what this calculator does not do
This calculator computes the exact and cumulative probabilities, mean, variance and standard deviation of a single binomial distribution, for n up to 500, with the full table and chart. The cap is a display decision, stated plainly: a table of more than 500 rows is unusable on a phone, and the probabilities for large n concentrate so tightly near the mean that the normal approximation — covered above, and available in any spreadsheet for any n — is the practical tool beyond that point. The underlying log-gamma arithmetic itself does not overflow at 500 or well beyond.
It does not solve inverse problems: finding the n needed for a target probability, the p implied by observed data, or a confidence interval for p. Those are estimation and design questions with their own methods, not readings of a single distribution. It does not handle varying p across trials, sampling without replacement from a small population (hypergeometric), or counts over time (Poisson) — the conditions section explains how to recognise each case. And it cannot judge whether the binomial model fits your real experiment: that judgement is yours, made from how the trials actually behave.
What it does promise: the textbook binomial distribution formula, computed at full precision by a numerically stable method, all five probability questions answered together, with a worked example on the page whose every figure you can verify by hand — in your browser, free, with nothing uploaded.
Sources and References
- Wikipedia — Binomial distribution — the definition, probability mass function, mean and variance used throughout this guide.
- Wikipedia — Binomial coefficient — nCr: the arrangement count at the heart of the binomial distribution formula.
- NIST/SEMATECH e-Handbook of Statistical Methods — Binomial Distribution (1.3.6.6.18) — the US National Institute of Standards and Technology reference on the binomial model and its assumptions.
- Wolfram MathWorld — Binomial Distribution — the formal mathematical treatment, including moments and generating functions.
- Wikipedia — Bernoulli trial — the single two-outcome trial from which a binomial experiment is built.
- Wikipedia — Cumulative distribution function — the ≤ probabilities and complement identities used for at most / at least questions.
- StatLect — Binomial distribution — properties, proofs and exercises for the binomial distribution.