Binomial Probability Calculator

Find the probability of a given number of successes in a fixed number of independent trials. Enter your values below, and see the formula, a worked example, and ready-to-use Python code underneath.

Enter your values

Please enter a whole number of trials (n ≥ 1), a probability between 0–100%, and 0 ≤ k ≤ n.

Probability
Mean (n·p)
Std. deviation

What binomial probability tells you

The binomial distribution models the number of successes in a fixed number of independent trials, each with the same probability of success — think coin flips, pass/fail quality checks, or yes/no survey answers. It answers questions like "what's the probability of getting exactly 6 heads in 10 flips of a fair coin?"

This calculator covers both the exact probability of a specific count (the probability mass function) and cumulative probabilities like "at least" or "at most" a given count (the cumulative distribution function).

Binomial probability formula

P(X = k) = C(n,k) · pᵏ · (1 − p)ⁿ⁻ᵏ
C(n,k) = n! / ( k!(n − k)! )
n is the number of trials, p is the probability of success on each trial, and k is the number of successes. Cumulative probabilities like P(X ≤ k) sum P(X = i) for i from 0 to k.

Python code

You can compute binomial probabilities manually, or with SciPy:

# Method 1 — manual calculation
from math import comb
n, p, k = 10, 0.5, 6
p_exact = comb(n, k) * (p ** k) * ((1 - p) ** (n - k))
print(p_exact)  # 0.2051

# Method 2 — SciPy
from scipy.stats import binom
binom.pmf(k, n, p)         # P(X = k)
binom.cdf(k, n, p)         # P(X \u2264 k)
1 - binom.cdf(k - 1, n, p) # P(X \u2265 k)

Worked example

A fair coin is flipped 10 times. What's the probability of getting exactly 6 heads?

  1. 1
    Identify n, p, and k.
    n = 10, p = 0.5, k = 6
  2. 2
    Compute the binomial coefficient.
    C(10,6) = 210
  3. 3
    Apply the formula.
    P(X = 6) = 210 × 0.5⁶ × 0.5⁴ = 210 × 0.0009766 = 0.2051

There's about a 20.51% chance of getting exactly 6 heads in 10 flips. For comparison, P(X ≥ 6) — six or more heads — is 37.70%.

Frequently asked questions

What conditions does a binomial distribution require?

A binomial setting needs a fixed number of trials, each trial resulting in one of two outcomes (success or failure), a constant probability of success across trials, and independence between trials.

What's the difference between "exactly k" and "at least k"?

"Exactly k" (the probability mass function) gives the probability of one specific outcome count. "At least k" or "at most k" (the cumulative distribution) sum the probabilities of a whole range of outcomes, which is usually what you want when asking questions like "what's the chance of 6 or more successes."

What are the mean and standard deviation of a binomial distribution?

The mean number of successes is n × p, and the standard deviation is the square root of n × p × (1 − p). These describe the center and typical spread of the distribution without needing to compute every individual probability.

When can I approximate a binomial distribution with a normal distribution?

A common rule of thumb is that the normal approximation works reasonably well when both n×p and n×(1−p) are at least 10 (some sources use 5). For smaller values, especially with p far from 0.5, the exact binomial calculation is more reliable.

Advertisement