Home › Statistics & Probability Calculators › Confidence Interval for a Proportion
Confidence Interval for a Proportion Calculator
Use this calculator to build a confidence interval for a proportion, such as the share of voters who support a candidate or the pass rate on an exam. Enter the number of successes and the sample size and choose a confidence level. The main result is the Wald interval p̂ ± z√[p̂(1 − p̂)/n] taught in introductory courses, with the steps shown.
Because the Wald interval performs poorly when p̂ is near 0 or 1 or when the sample is small, the Wilson score interval is reported alongside it. Wilson is what SciPy’s binomtest and many statisticians recommend for general use, and it never extends below 0 or above 1. The tool checks np̂ ≥ 10 and n(1 − p̂) ≥ 10 and tells you when to prefer Wilson.
The interval is reported both as proportions and as percentages. To decide how many people to survey for a given margin of error, use the sample size calculator for a proportion.
Result and step-by-step solution
p̂ ± ME = 0.33 ± 0.0461 (Wald interval). Wilson score interval: 0.2857 to 0.3775.
- Sample proportionp̂ = x ÷ n = 132 ÷ 400 = 0.33
- Check the conditionsnp̂ = 132, n(1 − p̂) = 268. Both are at least 10, so the normal (Wald) interval is reasonable.
- Standard errorSE = √[p̂(1 − p̂) ÷ n] = √[0.33 × 0.67 ÷ 400] = 0.0235
- Critical valuez0.025 = 1.96
- Margin of errorME = z × SE = 1.96 × 0.0235 = 0.0461
- Intervalp̂ ± ME = (0.2839, 0.3761), i.e. 28.39% to 37.61%
Frequently asked questions
- What is the formula for a confidence interval for a proportion?
- p̂ ± z × √[p̂(1 − p̂)/n], where p̂ is the sample proportion and z is 1.96 for 95% confidence.
- What is the difference between the Wald and Wilson intervals?
- Wald is the simple formula above. Wilson solves for the values of p that would not be rejected by a z-test, which gives better coverage for small n or extreme p̂ and always stays inside 0 to 1.
- How is this related to the margin of error in polls?
- A poll’s “±3%” is the margin of error of a 95% Wald interval, usually computed at p̂ = 0.5 for the worst case.
- What if I have zero successes?
- The Wald interval collapses to zero width, which is wrong. Use the Wilson interval, which still gives a sensible upper bound.
Last reviewed: September 25, 2026. Calculations run in your browser and were validated against SciPy.
