Exact for n up to 1,000Reviewed 28 Sep 2026Runs in your browser

Binomial Probability Calculator

Find the exact probability of k successes in n independent trials — P(X = k), P(X ≤ k), P(X < k), P(X ≥ k) and P(X > k) — with the mean, variance and shape of the distribution, a probability histogram and every step of the working.

Who wrote it

Written by Suhaib Hassan. The formula and every worked example are re-derived by hand. Our methodology.

How the engine works

It evaluates C(n, k) · pᵏ · qⁿ⁻ᵏ using logarithms of factorials, so large n does not overflow, and adds terms for the cumulative results.

Why we built it

Textbook tables stop at small n and round heavily. This calculator gives every tail in one place and shows the arithmetic behind the answer.

Distribution parameters

X ~ Binomial(n, p)

Presets
1 to 1,000
0 to n
0 to 1
Fractions
Primary result to show
P(X = k)—
—

—

As a percentage—
Odds form—
P(X = k)
—

—

P(X ≤ k)
—

—

P(X ≥ k)
—

—

P(X < k)
—

—

P(X > k)
—

—

Most likely value (mode)
—

—

Distribution moments
Expected value μ = np
—
Variance σ² = npq
—
Standard deviation σ
—
Skewness (1 − 2p) ÷ σ
—
Excess kurtosis (1 − 6pq) ÷ σ²
—
Failure probability q = 1 − p
—

Probability mass function

The chance of each possible number of successes. Bars in the event you asked for are dark; the dashed line marks the mean.

—

Step-by-step working

—

—

    Governing equations and conditions

    The equations

    Probability mass functionP(X = k) = C(n, k) · pᵏ · (1 − p)ⁿ⁻ᵏ
    Cumulative distributionP(X ≤ k) = Σᵢ₌₀ᵏ C(n, i) · pⁱ · qⁿ⁻ⁱ
    Mean and varianceμ = np, σ² = npq

    Four conditions for a binomial model

    • Fixed number of trials. n is set in advance.
    • Two outcomes. Each trial is a success or a failure.
    • Constant probability. p is the same on every trial.
    • Independence. One trial’s outcome does not affect another’s.

    Worked examples

    Each uses exact binomial sums, checked by hand and reproducible with the presets and inputs above.

    Lot inspection

    A batch has a 2% defect rate. An inspector tests 50 units and rejects the batch if more than 2 are defective.

    P(X ≤ 2) with n = 50, p = 0.02
    = 0.36417 + 0.37160 + 0.18580 = 0.92157
    P(reject) = P(X > 2) = 0.0784

    Clinical response

    A treatment works for 70% of patients. Among 30 patients, what is the chance that at least 25 respond?

    n = 30, p = 0.70, k = 25
    P(X ≥ 25) = 0.0766 (about 7.7%)
    Mean = 21 responders

    Packet loss

    Each of 64 packets is lost independently with probability 0.05. What is the chance more than 5 are lost?

    n = 64, p = 0.05, k = 5
    P(X ≤ 5) = 0.89990
    P(X > 5) = 0.1001 (about 10.0%)

    What is the binomial distribution?

    The binomial distribution gives the probability of getting exactly k successes in n independent trials when each trial succeeds with the same probability p. Typical examples are the number of heads in coin tosses, defective items in a sample, or patients who respond to a treatment.

    How to calculate a binomial probability

    • Work out the binomial coefficient C(n, k) = n! ÷ (k!(n − k)!), the number of ways to choose which trials succeed.
    • Multiply by pᵏ, the probability that those k trials all succeed.
    • Multiply by (1 − p)ⁿ⁻ᵏ, the probability that the other trials all fail.
    • For a cumulative probability, add the terms over the range of k values you need.

    By Suhaib Hassan · Reviewed 28 September 2026 · How CalculatePilot verifies formulas →

    Sources

    Frequently asked questions

    What is the difference between the binomial and hypergeometric distributions?

    The binomial model assumes independent trials with a constant probability, as with sampling with replacement or from a very large population. The hypergeometric distribution models sampling without replacement from a finite population, where each draw changes the odds of the next. When the sample is a small fraction of the population (commonly under 5%), the binomial is a good approximation.

    When can I use a normal approximation?

    A common rule of thumb is that both np and n(1 − p) should be at least 5 (some texts use 10). Then X is approximately normal with mean np and standard deviation √(npq), usually with a continuity correction of ±0.5. This calculator gives the exact answer, so no approximation is needed.

    How does the calculator avoid overflow for large n?

    Instead of multiplying huge factorials, it works with the logarithm of the binomial coefficient (using the log-gamma function) and exponentiates at the end. The exact coefficient shown in the steps is computed separately with integer arithmetic.

    What happens when p is 0 or 1?

    The outcome is certain: if p = 0 every trial fails, so P(X = 0) = 1; if p = 1 every trial succeeds, so P(X = n) = 1. The variance is zero and the distribution is a single point.

    How do I find the probability of at least one success?

    Use the complement: P(X ≥ 1) = 1 − P(X = 0) = 1 − (1 − p)ⁿ. Set k = 1 and choose P(X ≥ k) to see it directly.

    What if my trials are not independent?

    Then the binomial model does not apply exactly. Depending on the situation, a hypergeometric or other model may be more suitable. Independence and a constant probability are essential assumptions.

    Related calculators

    Continue with probability and counting.

    All Math Calculators

    Embed This Binomial Calculator

    Free and responsive, and it runs in the visitor's browser. Branding removal from $7.99/month.

    <iframe src="https://www.calculatepilot.com/embed/binomial-probability-calculator.html" width="100%" height="560" loading="lazy" title="Binomial Probability Calculator"></iframe>
    For website owners

    Want this calculator on your own website?

    Embed it in one line of code. Keep it free with a small CalculatePilot attribution link, or go white-label: your brand, no attribution, one license for all your domains.

    • All 159 calculators, unlimited embeds
    • Works on WordPress, Webflow, Squarespace, Wix and plain HTML
    • Runs in your visitor's browser, so nothing is sent to a server
    • License key emailed automatically after checkout, cancel anytime
    $7.99 / month
    or $89.99 / year · white-label Pro
    Get the white-label license Embed free with attribution