Confidence Interval for a Proportion Calculator

From x successes in n trials, find the plausible range for the true proportion. Four standard methods are computed so you can see how much the choice matters.

Also called: Binomial confidence interval calculator

  • Last updated
  • Formula tested against reference values

Your numbers

Result

Lower limit
—

Calculating…

Upper limit
—
Sample proportion
—
Half-width (points)
—
Method
—
Full table

How to use this calculator

  1. Enter or choose successes (x).
  2. Enter or choose trials (n).
  3. Enter or choose confidence level.
  4. Enter or choose method.
  5. The lower limit updates as you type. Use Copy result or Share to keep it.

Method

Wald: p̂ ± z√(p̂(1 − p̂)/n); Wilson: (p̂ + z²/2n ± z√(p̂(1 − p̂)/n + z²/4n²)) ÷ (1 + z²/n); Agresti–Coull: Wald on p̃ = (x + z²/2) ÷ (n + z²); Clopper–Pearson: Beta(α/2; x, n − x + 1) to Beta(1 − α/2; x + 1, n − x)

x
successes
n
trials
p̂
x ÷ n
z
two-sided normal critical value
Beta(q; a, b)
quantile of the beta distribution

Worked example

  1. p̂ = 7 ÷ 20 = 0.35; z = 1.96, z² = 3.8415.
  2. Centre = (0.35 + 0.09604) ÷ 1.19207 = 0.37417; half-width = 1.6442 × √(0.011375 + 0.002401) = 0.19296.
  3. Interval: 0.1812 to 0.5671. The exact method gives 0.1539 to 0.5922.

With 7 successes in 20 trials, the 95% Wilson interval for the true proportion is about 18.1% to 56.7%.

What the result means

A wide interval means the data say little; collect more trials to narrow it. Wilson is a good default; Clopper–Pearson is conservative (wider) but guarantees at least the stated coverage.

Assumptions and limits

  • Independent trials with a constant probability of success (a binomial model).
  • Two-sided intervals; limits are clipped to 0–100%.
  • The Wald interval performs poorly for small n or proportions near 0 or 1, and is shown mainly for comparison.

Questions

What if I observed 0 successes?

Wald gives a useless 0 to 0. Wilson and Clopper–Pearson still give a sensible upper limit; for 0 of n the exact 95% upper limit is 1 − 0.025^(1/n), close to the “rule of three” 3 ÷ n.

Which method do software packages use?

R’s binom.test uses Clopper–Pearson; prop.test uses Wilson with a continuity correction; many survey tools use Wald.