Margin of Error Calculator — Sample Size & Confidence Level

Calculate a normal-approximation margin of error from a sample size, or find the minimum sample size for a target margin. Choose a population proportion or mean and optionally account for sampling without replacement from a finite population.

Planning inputs

What do you want to calculate?
Confidence and sample

Enter 50 through 99.999.

Use only for sampling without replacement.

Expected population proportion

Use 50% when unknown; it gives the most conservative result.

Inputs are processed only in your browser and are not added to analytics events.

Result

Your result will appear here.
Choose the estimate and calculation, then enter the planning values.

Advertisement

Margin of error and sample size formulas

EstimateMargin of error (E)Initial required sample (n₀)
Population proportionE = z* × √[p(1 − p) / n]n₀ = z*²p(1 − p) / E²
Population meanE = z* × σ / √nn₀ = (z*σ / E)²

For a known finite population sampled without replacement, the margin is multiplied by √[(N − n)/(N − 1)]. Required sample size is adjusted to n = Nn₀/(N + n₀ − 1), then rounded up. The unrounded value is displayed so the rounding is transparent.

How to use the calculator

  1. Choose Proportion for a percentage or Mean for a numerical average.
  2. Select whether to find margin of error or required sample size.
  3. Enter the confidence level and expected proportion or planning standard deviation.
  4. Enter the current sample size or desired half-width.
  5. Optionally enter a finite population, then calculate and review the assumptions.

How to interpret the result

A margin of error of ±3 percentage points at 95% confidence means the corresponding normal-approximation interval extends 3 points on either side of the estimated percentage. The confidence level describes the long-run coverage of the method when its assumptions hold.

Precision improves with the square root of sample size. Halving the margin usually requires about four times the sample when other inputs stay fixed. Higher confidence produces a wider margin or a larger required sample.

Assumptions and limits

  • The formulas assume a simple random sample and independent observations. Clustered, stratified, weighted, multistage, or repeated data need design-specific variance methods.
  • The proportion calculation is the familiar Wald normal approximation used for survey planning. It can be unreliable with small samples or proportions near 0% or 100%.
  • The mean calculation treats σ as a known or planning standard deviation and uses a normal critical value. A final interval based on an estimated sample SD usually uses Student's t.
  • Finite population correction applies only to sampling without replacement from a known population. Leave population size blank for an effectively large or unknown population.
  • A required sample is the number of usable, independent responses. Increase recruitment separately for expected nonresponse, exclusions, or attrition.

Statistical limit: Margin of error measures random sampling uncertainty under the selected model. It does not include coverage error, nonresponse, measurement error, response bias, question wording, data processing errors, or poor study design.

Frequently asked questions

What is margin of error?

It is the critical value multiplied by the standard error—the plus-or-minus half-width of the corresponding confidence interval under the model.

Why should I use 50% when the proportion is unknown?

Because p(1 − p) is largest at p = 0.5. This produces the largest normal-approximation margin and the most conservative sample-size requirement.

Does population size affect margin of error?

Usually very little when the sample is a small fraction of the population. For sampling without replacement, the finite population correction becomes more noticeable as the sampling fraction grows.

Does a higher confidence level require a larger sample?

Yes. Higher confidence increases the normal critical value, so the required sample rises when the target margin stays fixed.

Should I add extra people for nonresponse?

Yes. This result is the required number of usable observations. If the expected usable-response rate is r, a simple recruitment target is required usable sample divided by r, rounded up.

Is this the same as statistical power?

No. Margin-of-error planning targets estimation precision. Power planning targets the probability of detecting a specified effect in a hypothesis test. Use the related two-sample power calculator for that design.

Does margin of error include survey bias?

No. It describes random sampling error only under the stated model, not bias or other nonsampling errors.

Are my inputs tracked?

No. Calculations run locally in your browser, and entered values are not sent, stored, or attached to analytics events.

Methodology and references

Last reviewed: August 4, 2026. The proportion, mean, conservative p = 0.5, and finite-population formulas were checked against university statistics guidance and the NIST/SEMATECH handbook.

Explore more tools