ForHosting KIT · Math

Binomial probability calculator

In 10 trials with a success chance of 0.5, exactly 5 successes happen close to one time in four, and 5 or fewer a little over 60 percent of the time. Enter trials, chance and target count to get both, plus mean and variance. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
N
10
Power (W)
0.5
K
5
You get
Probability
0.24609375
Cumulative
0.623046875
Mean
5
Variance
2.5

The binomial probability calculator evaluates a discrete Binomial(n, p) random variable for a chosen success count k. You provide the number of independent Bernoulli trials n, the success probability p on each trial, and the target number of successes k. The engine returns the point probability P(X equals k), the cumulative probability P(X is less than or equal to k), the mean n times p, and the variance n times p times one minus p. Arithmetic is deterministic floating-point with a log-space binomial coefficient path, so the same inputs always produce the same outputs without network calls or random sampling.

What the binomial distribution tells you

A binomial experiment is a fixed number of independent trials where each trial has exactly two outcomes, success and failure, and the success probability stays constant across trials. If X counts the number of successes in n such trials with success probability p, then X follows the binomial distribution with parameters n and p. The classic probability mass function is P(X equals k) equals the binomial coefficient C(n, k) times p to the k times (1 minus p) to the n minus k.

This calculator also returns the cumulative distribution function P(X is less than or equal to k), which is the sum of the mass function from zero through k, plus the mean n p and the variance n p (1 minus p). Those four numbers cover the questions students, analysts, and engineers ask most often: how likely is exactly k successes, how likely is at most k, and what are the location and spread of the distribution. The contract is intentionally strict.

The success count k must be an integer between zero and n inclusive; k above n is rejected rather than returning a silent zero that could hide an off-by-one bug in a caller. If you need Poisson, normal, or hypergeometric calculators, use those dedicated tools when they are available; here the search intent is binomial probability for n, p, and k with exact formulas and free browser execution.

How n, p, and k are read and how PMF and CDF are computed

Optional leading plus signs on integers are allowed; embedded spaces, hex prefixes, negative signs where forbidden, and exponential notation on integer fields are rejected so a bad spreadsheet cell does not become a wrong probability. Probability p accepts ordinary decimal numbers and scientific notation as a finite real, then enforces the closed unit interval with an explicit error that names the field when the value falls outside zero to one.

Computation of the mass function uses logarithms: log C(n, k) is built from a multiplicative product of ratios, then k log p and (n minus k) log (1 minus p) are added, and the exponential recovers a probability in zero to one. That path avoids intermediate overflow that full factorials would cause for moderate n. Boundary cases p equals zero and p equals one short-circuit to exact zero or one masses without taking logs of zero.

The cumulative value is obtained by summing mass terms; when k is large relative to n the engine sums the complementary upper tail and subtracts from one for better numerical behavior. Mean and variance use the closed forms n p and n p (1 minus p).

Where binomial probabilities fit in study, quality control, and code

Students meet the binomial distribution when a textbook asks for the chance of five heads in ten fair coin flips, when a worksheet wants the probability of at most two defective items in a sample, or when they verify that the mean and variance formulas match the definition from the probability mass function. Teachers can pre-generate answer keys for modest n without trusting opaque calculator apps that round intermediate coefficients or hide the cumulative definition.

Quality and operations teams sketch pass-fail inspection models: n items inspected, p the historical defect rate, k a threshold of defects that triggers a hold. Product and growth analysts use the same structure for independent conversion trials with a fixed success rate, for example the chance of at least a target number of sign-ups if each visitor converts with probability p.

Developers call the contract from scripts to seed deterministic test vectors, to illustrate log-space coefficient tricks, or to satisfy programming-challenge statements that demand P(X equals k) and P(X less than or equal to k) for given n, p, and k. Contest practice often needs a fast offline source of binomial values so solutions can be checked without embedding large static tables by hand.

Homework and exam preparation

Look up exact binomial PMF and CDF values for textbook exercises with known n, p, and k, plus mean and variance checks.

What does the binomial probability calculator cost?

It is free in your browser on this page.

What formula is used for P(X = k)?

P(X = k) = C(n, k) · p^k · (1 − p)^(n − k). The cumulative field is P(X ≤ k), the sum of that mass from 0 through k.

What happens if p is outside 0 to 1?

The success probability must lie in the closed interval from zero to one.

What are the mean and variance of Binomial(n, p)?

The mean is n · p and the variance is n · p · (1 − p). Both are returned on every successful request.

Can k be larger than n?

No. k must be an integer between 0 and n inclusive.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/prob/binomial-distribution

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/prob/binomial-distribution \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"n":10,"p":0.5,"k":5}'
{
  "n": 10,
  "p": 0.5,
  "k": 5
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "prob.binomial_distribution",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_n1000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Edge cases are handled explicitly: p equals zero or one yield exact zero-one masses, and any p outside the closed unit interval is rejected with invalid_input rather than silently clamped.

What the binomial distribution answers and what the response contains

The response echoes the normalized n, k, and p, attaches short formula strings so learners can cross-check by hand, and includes the published maximum n so batch clients can validate before they send work. Probability p must lie in the closed interval from zero to one; values below zero or above one are invalid_input, not clipped.

How n, p, and k are read and how PMF and CDF are computed

The preferred fields are n for trials, p for success probability, and k for the success count, but aliases are accepted so forms and scripts can reuse familiar names. For n the aliases are trials and num_trials; for p they are probability, success_prob, and prob; for k they are successes and x. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline without re-implementing binomial coefficients yourself.

Where binomial probabilities fit in study, quality control, and code

On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result. Pair it with combinatorial counters when you need only C(n, k), with geometric-sequence tools when you need growth factors rather than trial counts, and with other math endpoints when you are building a small lab of free, deterministic probability helpers.

Deterministic test fixtures

Generate reproducible probability, cumulative, mean, and variance fields for unit tests and CI assertions without hand-rolled formulas.

Quality-control and conversion sketches

Model pass-fail inspection or fixed-rate conversion trials: n items or visits, p success rate, k defect or conversion threshold.

Read the full KIT documentation →