Skip to content
The Calculatorz
Estimation

Confidence Interval for a Proportion (Margin of Error)

Calculate the confidence interval and margin of error for a percentage or proportion from a survey or sample, using the Wilson and Wald methods.

Statistical results depend on the assumptions stated in the formula. Check that your data meet them before drawing conclusions.

Sample counts

Sample

How to use this calculator

Enter how many people (or items) in your sample had the characteristic, such as answering 'yes' in a poll, and the total sample size. The calculator gives the sample proportion, its margin of error and confidence interval. The Wilson score interval is recommended; the simpler Wald interval is also shown for comparison.

Formula

p̂ = x ÷ n. Wald: p̂ ± z√(p̂(1 − p̂) ÷ n). Wilson: [p̂ + z²/2n ± z√(p̂(1 − p̂)/n + z²/4n²)] ÷ (1 + z²/n), where z = 1.645, 1.960 or 2.576 for 90%, 95% or 99% confidence.

Calculator credits

Calculator developmentJulia Edwards

Editorial supervision

Expert reviewSaeedM.Phil Statistics, Data Scientist

Published byThe Calculatorz

Last updated

Read how we research, test, review and correct our calculators in our editorial policy.

Frequently asked questions

What is the margin of error?

Half the width of the confidence interval. A poll result of 42% ± 3.1% means the interval runs from about 38.9% to 45.1%.

Why use the Wilson interval?

It stays accurate for small samples and for proportions near 0% or 100%, where the simple Wald interval can be far too narrow or even go below zero.

How large a sample do I need?

The margin of error shrinks with the square root of sample size: quadrupling the sample halves it. Use the Sample Size Calculator to plan.

Does the margin of error cover all errors?

No. It reflects random sampling error only, not biased questions, non-response or an unrepresentative sample.

What does 95% confidence mean?

If the survey were repeated many times, about 95% of intervals calculated this way would contain the true population proportion.

Can I use this for a mean?

No. For averages of measurements, use the Confidence Interval Calculator for a Mean.

References & methodology sources

These sources support the calculator’s formula, definitions, thresholds, units or result interpretation.

  1. Agresti, A., & Coull, B. A. (1998). Approximate is better than 'exact' for interval estimation of binomial proportions. The American Statistician, 52(2), 119–126. View source
  2. Croarkin, C., & Tobias, P. (Eds.). (2012). NIST/SEMATECH e-handbook of statistical methods. National Institute of Standards and Technology. View source
  3. Illowsky, B., & Dean, S. (2023). Introductory statistics 2e. OpenStax. View source
  4. Cochran, W. G. (1991). Sampling techniques (3rd ed.). Wiley. View source