Two Proportion Confidence Interval Calculator
Estimate the difference between two population proportions, p₁ − p₂, with a confidence interval and a check on whether it includes zero.
Open → Two Proportion Confidence Interval CalculatorEstimate a population proportion with a confidence interval. Enter the number of successes and the sample size, choose a confidence level, and compare the Wald, Wilson score and Agresti–Coull intervals side by side, along with the margin of error and every step of the calculation.
Formula p̂ ± z·√(p̂(1 − p̂) ⁄ n)
| Method | Lower | Upper | Width |
|---|
A confidence interval for a proportion can be built three common ways from the same data. The Wald interval is p̂ ± z*·√(p̂(1 − p̂)/n); the Wilson score and Agresti–Coull intervals adjust the centre and width so they stay reliable when p̂ is near 0 or 1 or the sample is small.
| Method | Formula | Best for |
|---|---|---|
| Wald | p̂ ± z·√(p̂(1 − p̂)/n) | Large samples, p̂ away from 0 and 1. The one in most textbooks. |
| Wilson score | (p̂ + z²/2n ± z·√(p̂(1 − p̂)/n + z²/4n²)) / (1 + z²/n) | Any sample size. Never leaves 0–1. The usual recommendation. |
| Agresti–Coull | p̃ ± z·√(p̃(1 − p̃)/ñ), ñ = n + z², p̃ = (x + z²/2)/ñ | A hand-friendly stand-in for Wilson: add ~2 successes and ~2 failures at 95%. |
p̂ = x ÷ n — the sample proportion is the centre of the Wald interval.
1.645 for 90%, 1.960 for 95%, 2.576 for 99%. Higher confidence means a wider interval.
Margin of error E = z*·SE. The interval is p̂ − E to p̂ + E.
These examples build a confidence interval for a proportion step by step. In the first, 540 of 1,200 people support a proposal, so p̂ = 0.45, the standard error is about 0.0144, and the 95% Wald interval runs from about 0.422 to 0.478, a margin of error of roughly ±2.8 percentage points.
In a poll, 540 of 1,200 people support a proposal. Find a 95% interval.
45% ± 2.8 points — methods agree
3 of 25 items fail inspection. Find a 95% interval for the failure rate.
Use Wilson: 4.2% to 30.0% — Wald goes negative
The Wald interval centres on p̂ and uses p̂ to estimate its own standard error. When p̂ is close to 0 or 1, that standard error is underestimated and the interval is too narrow — a "95%" Wald interval can cover the true value far less than 95% of the time. With x = 0 it collapses to a single point, which is plainly wrong.
The Wilson interval fixes this by inverting the z-test: it collects every value of p that a test would not reject. Its centre is pulled slightly towards 0.5 and its width never collapses, which is why statistics references recommend it as the default. Brown, Cai and DasGupta's review of binomial intervals in Statistical Science (2001, doi:10.1214/ss/1009213286) recommends the Wilson interval for small samples, which is the rule this calculator follows when there are fewer than 10 successes or failures. The full method is on the methodology page.
The "±3 points" quoted with opinion polls is the 95% margin of error for a proportion, usually computed at p = 0.5 where it is largest. A sample of about 1,068 gives ±3 points; see the sample size calculator for the arithmetic. For comparing two groups — say, support among two age bands — use the two proportion confidence interval. The guide to proportions in statistics explains the sampling distribution behind all of these.
Methods, meaning and how to narrow the interval.
p̂ ± z* × √(p̂(1 − p̂) ÷ n), where p̂ = x ÷ n and z* is the critical value for your confidence level — 1.645 for 90%, 1.960 for 95%, 2.576 for 99%. The part after ± is the margin of error.