Binomial Probability Calculator
A binomial experiment is a fixed number of independent trials, each a success or a failure with the same probability. Set the number of trials n and the success probability p, pick the question you want, and this tool returns the exact probability, a cumulative total, a range, or the inverse count, with a bar chart of the whole distribution and the region shaded. Everything runs in your browser.
P(X ≥ 7) = 0.1719
How this is computed
pbinom(), so deep tails and large n stay precise where a long running sum would drift.
✓ No data leaves your browser
✓ Verified against R's dbinom(), pbinom() and qbinom()
✓ Free, no sign-up
The five questions a binomial answers
Each mode above maps to one R function. Exact counts use dbinom(); cumulative totals use pbinom(); the inverse uses qbinom().
| You want | The event | In R |
|---|---|---|
| Exactly k successes | P(X = k) | dbinom(k, n, p) |
| At most k successes | P(X ≤ k) | pbinom(k, n, p) |
| At least k successes | P(X ≥ k) | pbinom(k - 1, n, p, lower.tail = FALSE) |
| Between a and b | P(a ≤ X ≤ b) | pbinom(b, n, p) - pbinom(a - 1, n, p) |
| The count for a probability | find k | qbinom(prob, n, p) |
The formulas behind it
The probability of exactly k successes multiplies the number of ways to arrange them by the probability of each arrangement.
| Quantity | Formula | Meaning |
|---|---|---|
| P(X = k) | C(n, k) · pk · (1 - p)n-k | Exact probability of k successes |
| Mean | n · p | Expected number of successes |
| Variance | n · p · (1 - p) | Spread of the count |
| Std. dev. | √(n · p · (1 - p)) | Typical distance from the mean |
When np ≥ 5 and n(1 - p) ≥ 5, the count is close to a normal distribution with that mean and variance, and a continuity correction (shifting the boundary by half a step) makes the approximation sharper. For small n or extreme p the shape is too skewed, and the exact binomial above is the honest answer.
Frequently asked questions
How do I calculate a binomial probability?
Set the number of trials n and the success probability p, choose whether you want an exact count, a cumulative probability, a range, or the inverse, then enter the count. The exact probability of k successes is C(n, k) p^k (1 - p)^(n-k), exactly what R's dbinom() returns; cumulative probabilities add up the bars and match pbinom().
What is the difference between P(X = k) and P(X ≤ k)?
P(X = k) is exactly k successes, one bar of the distribution. P(X ≤ k) is k or fewer, the running total of every bar up to and including k. Use "Exactly k" for a single count and the cumulative modes for a threshold such as at most or at least.
When can I use the normal approximation to the binomial?
The common rule of thumb is np ≥ 5 and n(1 - p) ≥ 5. When both hold, the binomial is roughly Normal(np, np(1 - p)), and a continuity correction sharpens it. When they fail the distribution is too skewed; use the exact binomial, which this calculator always does. The note under each result tells you which case you are in.
What does the inverse binomial give me?
The inverse mode works backwards from a cumulative probability to a count: the smallest number of successes whose cumulative probability reaches your target. That is R's qbinom(), used for control limits and for the critical value of an exact binomial test.
Does this calculator match R?
Yes. Every probability and quantile uses the same algorithms as R's dbinom(), pbinom() and qbinom(), including the tail-accurate incomplete-beta form, and agrees to at least nine decimals across the range, including k = 0, k = n, tiny p and large n.