Binomial Distribution Calculator
The binomial distribution describes the number of successes in n independent trials, each with success probability p. Enter n, p and a target k to get the point probability P(X = k), the cumulative probabilities and the distribution's mean, variance and standard deviation.
Point and cumulative probabilities together
The binomial distribution counts successes in a fixed number of independent attempts, each with the same chance of succeeding. Heads in twenty coin flips, defective items in a batch of a hundred, or converted visitors out of a thousand are all binomial counts.
Given the number of trials, the success probability and a target count, this calculator returns the point probability, all four cumulative probabilities around that target, and the distribution's mean, variance and standard deviation.
Most real questions are cumulative rather than exact. “At least eight out of ten” and “no more than three defects” are the shapes that matter, and getting them wrong by one term is the classic error. Reporting P(X ≤ k), P(X < k), P(X ≥ k) and P(X > k) side by side makes the boundary explicit instead of leaving it to be inferred.
The summary statistics are there for a different reason: μ and σ tell you where the distribution sits and how wide it is, which is what makes a computed probability feel reasonable or suspicious.
How to use this calculator
- Enter the number of trials n A non-negative whole number. This is the count of independent attempts, fixed before the experiment starts — not the number of successes you happened to see.
- Enter the success probability p A probability between 0 and 1, not a percentage. A 5% defect rate is entered as 0.05, and anything outside [0, 1] is rejected.
- Enter the target k A whole number between 0 and n inclusive. The solver refuses a k outside that range, because more successes than trials is not a possible outcome.
- Pick the right cumulative line Four are given. Match the wording of your question: “at most” is P(X ≤ k), “fewer than” is P(X < k), “at least” is P(X ≥ k) and “more than” is P(X > k).
The formula, and where it comes from
P(X = k) = C(n, k)·pᵏ·(1 − p)ⁿ⁻ᵏ μ = np σ² = np(1 − p)
Any single sequence with k successes and n − k failures has probability pᵏ(1 − p)ⁿ⁻ᵏ, because the trials are independent and the probabilities multiply. The binomial coefficient C(n, k) counts how many distinct orderings produce that same total, and multiplying the two gives the probability of the count regardless of order.
The cumulative values are computed by summing the point probability term by term from zero up to k, not by a closed form. P(X ≥ k) is then obtained as 1 − P(X < k), which is why the solver reports P(X < k) explicitly: it is the intermediate value that makes the complement visible.
What each input means
- n Number of trials — form field “Number of trials n”
- How many independent attempts are made. It must be a non-negative integer and fixed in advance; a design that stops as soon as a success occurs is geometric, not binomial. Units: trials.
- p Success probability — form field “Success probability p”
- The chance of success on any one trial, constant across all of them. Which outcome counts as a success is your choice — swapping the labels replaces p with 1 − p and k with n − k.
- k Target number of successes — form field “Target k”
- The count the probabilities are computed around. It must be a whole number in [0, n]. Units: successes.
Worked examples
Every number below is produced by the same calculation engine the tool above runs. Nothing here is typed by hand, so the walkthrough cannot drift from what you get when you enter the same values yourself.
Ten fair coin flips
Flip a fair coin ten times and ask about getting exactly five heads — the modal outcome, and the one people most often overestimate.
Inputs Number of trials n = 10, Success probability p = 0.5, Target k = 5
- Distribution X ~ Binomial(n = 10, p = 0.5)
- P(X = k) C(10, 5)·0.5^5·0.5^5 = 0.246094
- P(X ≤ k) 0.623047
- P(X < k) 0.376953
- P(X ≥ k) 1 − P(X < k) = 0.623047
- P(X > k) 0.376953
- Mean μ = n·p = 5
- Variance σ² = n·p·(1 − p) = 2.5
- Standard deviation σ = 1.58114
Result P(X = 5) = 0.246094, P(X ≤ 5) = 0.623047, P(X ≥ 5) = 0.623047
Exactly five heads happens under a quarter of the time. Five is the most likely single count, but there are eleven possible counts and the probability is spread across all of them, so the most likely outcome is still uncommon.
Because the distribution is symmetric at p = 0.5, P(X ≤ 5) and P(X ≥ 5) are equal here. They sum to more than one, since both include the k = 5 term — a useful reminder that these two are not complements of each other.
A rare event in many trials
A hundred items with a 5% defect rate. How likely is exactly five defects, and what does the spread look like?
Inputs Number of trials n = 100, Success probability p = 0.05, Target k = 5
- Distribution X ~ Binomial(n = 100, p = 0.05)
- P(X = k) C(100, 5)·0.05^5·0.95^95 = 0.180018
- P(X ≤ k) 0.615999
- P(X < k) 0.435981
- P(X ≥ k) 1 − P(X < k) = 0.564019
- P(X > k) 0.384001
- Mean μ = n·p = 5
- Variance σ² = n·p·(1 − p) = 4.75
- Standard deviation σ = 2.17945
Result P(X = 5) = 0.180018, P(X ≤ 5) = 0.615999, P(X ≥ 5) = 0.564019
The mean is exactly five, so the target sits at the centre of the distribution — yet the exact-value probability is still only about 0.18. With a hundred trials the outcome is spread across many counts, and no single one carries much mass.
The standard deviation is close to 2.2, so counts from roughly three to seven are all unremarkable. This is the regime where the Poisson distribution with λ = np is a good approximation, since n is large and p is small.
Reading the result
Choosing between the four cumulative lines
The difference between P(X ≤ k) and P(X < k) is exactly the point probability at k, which can be substantial. For the coin example that single term is worth about 0.25, so picking the wrong line is not a rounding-level error.
Mean and standard deviation as a sanity check
μ = np is where the distribution is centred and σ = √(np(1−p)) is its spread. A target more than two or three standard deviations from the mean should return a small probability; if it does not, one of the inputs is probably wrong.
Precision of the displayed values
Probabilities are shown to six significant figures. The cumulative values are exact sums of the individual terms rather than approximations, so for moderate n they are accurate to the limits of double precision.
When you would use this
Acceptance sampling and quality control
With n the sample size and p the assumed defect rate, P(X ≤ k) is the probability a batch passes a plan that allows at most k defects. Varying k shows how the acceptance rule trades supplier risk against consumer risk.
Conversion and response rates
For a mailing or a landing page with a known baseline rate, the cumulative probability of seeing at least the observed count answers whether a result is surprising enough to be worth investigating.
Assumptions and limitations
What this calculator assumes
- The number of trials is fixed in advance, and every trial is independent of the others.
- Each trial has exactly two outcomes and the success probability p is identical across all of them.
- n and k are whole numbers with 0 ≤ k ≤ n; anything else is rejected with an explicit message rather than approximated.
Where it stops being the right tool
- Only one target k at a time. The tool reports probabilities around a single value rather than a full table or a plot.
- Interval probabilities such as P(3 ≤ X ≤ 7) are not computed directly; subtract two cumulative values to obtain them.
- No inference: the tool computes probabilities from a known p and does not estimate p or test a hypothesis about it.
Common mistakes
Using P(X ≤ k) for “at least k”
Why it happens. The two phrases are easy to transpose under time pressure, and both produce a plausible-looking probability, so nothing signals the error.
How to avoid it. Read the label rather than the position. “At least” means k or more, which is P(X ≥ k) — the line computed as 1 − P(X < k).
Entering p as a percentage
Why it happens. Defect rates and conversion rates are quoted as percentages, so 5 rather than 0.05 is the number in hand.
How to avoid it. Divide by 100 first. The solver rejects any p outside [0, 1], so this shows up as an error message rather than a silently wrong result.
Applying the binomial to trials that are not independent
Why it happens. The formula still returns a number when trials are dependent — for instance when sampling a small population without replacement — so nothing looks wrong.
How to avoid it. Check that removing one item does not change the odds for the next. Where it does, and the sample is a large fraction of the population, the hypergeometric distribution is the correct model.
Frequently asked questions
When is the binomial distribution the right model?
When the number of trials is fixed in advance, each trial is independent, each has exactly two outcomes, and the success probability stays the same throughout. Breaking any of those four conditions makes the result wrong even though a number is still returned.
Why do P(X ≤ k) and P(X ≥ k) add up to more than 1?
Because both include the outcome X = k. Their sum is 1 + P(X = k). The true complement of P(X ≥ k) is P(X < k), which the solver reports on its own line for exactly this reason.
What are the mean and variance?
The mean is μ = np and the variance σ² = np(1 − p), so the standard deviation is √(np(1 − p)). The variance is largest at p = 0.5 and shrinks towards zero as p approaches either extreme, where outcomes become predictable.
Why must k be a whole number no greater than n?
Because k counts successes among n trials, so values above n or below zero describe impossible outcomes, and fractional counts do not exist. The solver rejects them with a message naming the valid range rather than returning a meaningless figure.