Skip to content
Omnikalc

Confidence interval for a proportion

From x successes in n trials, get the Wilson, Clopper–Pearson (exact), Agresti–Coull and Wald confidence intervals for the true proportion.

Updated on
Your inputs

Value out of range

Value out of range

Results

Observed proportion

36.00%

Wilson interval, lower bound (recommended)

24.14%

Wilson interval, upper bound

49.86%

Clopper–Pearson exact interval, lower bound
22.92%
Clopper–Pearson exact interval, upper bound
50.81%
Agresti–Coull interval, lower bound
24.10%
Agresti–Coull interval, upper bound
49.89%
Wald interval, lower bound (simple, less reliable)
22.70%
Wald interval, upper bound
49.30%

Confidence interval for a proportion

When x of n people answer yes, or x of n units fail, the observed proportion p̂ = x ÷ n estimates the true proportion. A confidence interval gives the range of values compatible with the data. Several methods exist, and the textbook one is the least reliable.

The four methods

  • Wald: p̂ ± z √(p̂(1 − p̂) ÷ n). Simple, but it covers the true value less often than claimed, especially for small n or proportions near 0 or 100%. It can even give bounds below 0 or above 100%.
  • Wilson (score interval): centered on (p̂ + z²/2n) ÷ (1 + z²/n). It keeps close to its nominal coverage even for small samples and is the recommended default.
  • Agresti–Coull: add z²/2 successes and z²/2 failures, then apply the Wald formula. With 95% confidence this is roughly “add two successes and two failures”. It is simple and works well.
  • Clopper–Pearson (exact): based on the binomial distribution. It always covers the true value at least as often as stated, so it is conservative and somewhat wider. It is often required in regulatory or medical contexts.

Example

18 successes out of 50 trials, so p̂ = 36%, with 95% confidence:

Method Interval
Wilson 24.1% to 49.9%
Clopper–Pearson 22.9% to 50.8%
Agresti–Coull 24.1% to 49.9%
Wald 22.7% to 49.3%

With 50 observations the methods are close. With 2 successes out of 20, they diverge sharply: Wald gives −3.1% to 23.1%, an impossible negative bound, while Wilson gives 2.8% to 30.1%.

Zero successes

If x = 0, Wald gives the meaningless interval 0 to 0. The exact upper bound is 1 − (α/2)^(1/n), and the “rule of three” approximates the one-sided 95% upper bound by 3 ÷ n. With 0 adverse events in 100 patients, the true rate could still be about 3%.

Interpreting the interval

A 95% interval means that the method, applied to many samples, captures the true proportion 95% of the time. It does not account for bias: a non-random sample, low response rates or leading questions can shift the estimate far more than the interval suggests.

Planning a survey

The width of the interval shrinks with √n: to halve the margin of error, you need four times as many respondents. For a margin of about ±3 points at 95% confidence around 50%, you need roughly 1,070 respondents. The margin of error and sample size calculators handle this planning step.

Frequently asked questions

Which confidence interval for a proportion is best?

The Wilson interval is the usual recommendation; Clopper–Pearson is preferred when guaranteed coverage is required.

Why is the Wald interval not recommended?

It covers the true value less often than stated, especially for small samples or proportions near 0 or 100%.

What is the confidence interval when there are zero successes?

The exact upper bound is 1 − (α/2)^(1/n); the rule of three gives about 3 ÷ n for 95% one-sided.

How many respondents do I need for a ±3% margin?

About 1,070 for 95% confidence around 50%.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.