Binomial Distribution Calculator

Counting Successes Across a Fixed Number of Trials

Any process with a fixed number of independent yes/no trials and a constant success probability — defective parts on a production line, free throws attempted, patients responding to a treatment — is a candidate for the binomial distribution. It answers precisely how likely a given number of successes is, not just the average you'd expect over the long run.

The Formula

P(X = k) = C(n, k) × p^k × (1−p)^(n−k)

Mean: μ = np
Variance: σ² = np(1−p)

n is the number of trials, k is the number of successes, and p is the probability of success on any single trial. C(n, k) is the number of distinct ways to arrange k successes among n trials.

Worked Example: Defect Rate Inspection

A production line has a historical defect rate of 5%. Inspecting 20 units at random:

Binomial distribution, n = 20, p = 0.05
Defective units (k)Probability
035.85%
137.74%
218.87%
35.96%

Expected defects (mean) = 20 × 0.05 = 1.0, with a standard deviation of 0.97. The probability of finding 1 or fewer defective units is 73.58% — useful context when deciding whether an inspection sample of 2+ defects should trigger a process review.

Where This Matters

  • Quality control — acceptance sampling plans are built directly on binomial probabilities.
  • Clinical trials — modeling the number of patients who respond to treatment out of a fixed cohort.
  • A/B testing — conversions out of a fixed number of visitors follow a binomial distribution.
  • Polling — the number of respondents favoring a candidate out of n surveyed, assuming independent responses.

How to Use This Calculator

  1. Choose Exactly, At Most, or At Least k Successes from the dropdown.
  2. Enter the number of trials (n).
  3. Enter the number of successes (k) you're interested in.
  4. Enter the probability of success on a single trial (as a decimal between 0 and 1).
  5. Select Calculate to get the probability, along with the mean and standard deviation of the distribution.

Related Calculations

For the special two-outcome case of a coin, see the Coin Flip Calculator. For counting rare events over a continuous interval instead of fixed trials, use the Poisson Distribution Calculator.