Home › Statistics & Probability › Binomial Distribution Calculator
Binomial Distribution Calculator
Computes the probability of exactly, at most, at least, fewer than or more than k successes in n independent trials with success probability p, plus the mean, variance and standard deviation of the distribution.
When to use
You have a fixed number of independent yes/no trials with a constant success probability (coin flips, defect counts in a batch, conversions among n visitors) and need the probability of a number of successes.
Do not use when: Trials are not independent or p changes, the number of trials is not fixed, or you count events over time or space at an average rate (use poisson-distribution).
Formula
P(X = k) = C(n, k) · p^k · (1 − p)^(n − k); P(X ≤ k) = Σ_{i=0..k} P(X = i); P(X ≥ k) = Σ_{i=k..n} P(X = i); mean = n·p; variance = n·p·(1 − p)
Probabilities are computed term by term in log space, so large n does not overflow the binomial coefficient. Results are exact (no normal approximation).
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
trials | integer | yes | Total number of independent trials. Range: ≥ 1, ≤ 100000 | |
successes | integer | yes | Number of successes of interest (0 ≤ k ≤ n). Range: ≥ 0, ≤ 100000 | |
probability_of_success | number | yes | Probability of success on a single trial, as a number between 0 and 1 (0.5 for 50 %), not a percentage. Range: ≥ 0, ≤ 1 |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
probability_exact | number | Probability of exactly k successes. | |
probability_at_most | number | Cumulative probability of k or fewer successes. | |
probability_at_least | number | Probability of k or more successes. | |
probability_less_than | number | Probability of fewer than k successes. | |
probability_more_than | number | Probability of more than k successes. | |
mean | number | Expected number of successes n·p. | |
variance | number | n·p·(1 − p). | |
std_dev | number | √(n·p·(1 − p)). |
Example
3 heads in 10 fair coin flips: {"trials":10,"successes":3,"probability_of_success":0.5} → {"probability_exact":0.117188,"probability_at_most":0.171875,"probability_at_least":0.945313,"probability_less_than":0.054688,"probability_more_than":0.828125,"mean":5,"variance":2.5,"std_dev":1.5811}
2 defects in 20 items at 10 %: {"trials":20,"successes":2,"probability_of_success":0.1} → {"probability_exact":0.28518,"probability_at_most":0.676927,"probability_at_least":0.608253,"mean":2,"variance":1.8,"std_dev":1.3416}
GET https://tttkmbb.com/api/v1/calculate/binomial-distribution?trials=10&successes=3&probability_of_success=0.5
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/binomial-distribution(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/binomial-distribution · Markdown: https://tttkmbb.com/statistics/binomial-distribution.md · JSON definition: https://tttkmbb.com/statistics/binomial-distribution.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="binomial-distribution" - OpenAPI operationId:
calculate_binomial_probability - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
FAQ
Is p a percentage?
No. Enter the single-trial success probability as a fraction between 0 and 1: 0.25 for 25 %.
When can the normal approximation be used instead?
When n·p ≥ 10 and n·(1 − p) ≥ 10 the binomial is close to a normal with mean n·p and SD √(n·p·(1 − p)); this calculator does not need the approximation because it computes the exact sum.
Related calculators
- Poisson Distribution Calculator — Counts of rare events at an average rate (limit of the binomial for large n, small p).
- Probability of Two Events Calculator — Combine the probabilities of two events.
- Combinations and Permutations Calculator — The binomial coefficient C(n, k) used in the formula.