Margin of Error Formula for Surveys: Mean and Proportion
The margin of error is the plus-or-minus distance around an estimate in a confidence interval. For a survey proportion, it depends on the confidence-level critical value, the estimated proportion, and sample size. This guide covers proportion and mean formulas, a worked example, sample-size planning, and Excel.

Margin of error formula at a glance
For a survey proportion: MOE = z × √[p̂(1 − p̂) / n].
For a sample mean with an estimated standard error: MOE = critical value × s / √n. The confidence interval is the estimate minus and plus the margin of error.
Here, z is the confidence-level critical value, p̂ is the sample proportion as a decimal, and n is the sample size. At 95% confidence, z is about 1.96. A margin of 0.049 equals 4.9 percentage points.
What the margin of error means
A sample estimates a population value, but another valid sample may produce a different estimate. A confidence interval places lower and upper limits around that estimate. The margin of error is the distance to either limit, or half the interval's total width.
If a poll estimates support at 52% with a margin of 4.9 percentage points, its interval is about 47.1% to 56.9%. The confidence level describes how often the method captures the fixed population value across repeated samples, assuming the model and sampling design are suitable. It does not measure every source of survey error.
Formula for a survey proportion
For a simple random sample, the estimated standard error of a proportion is the square root of the estimated variance. Multiply that standard error by the critical value to obtain the usual normal-approximation margin of error:
SE(p̂) = √[p̂(1 − p̂) / n]
MOE = z × SE(p̂) = z × √[p̂(1 − p̂) / n]
Confidence interval = p̂ ± MOE
Enter a proportion from 0 to 1: use 0.52 for 52%, not 52. The result is a proportion too, so multiply by 100 to report percentage points. For a fixed sample size, uncertainty is largest near p̂ = 0.50; that value is conservative when planning without a prior estimate.
The usual normal approximation assumes random sampling. With small samples or p̂ near 0 or 1, the basic Wald interval may have poor coverage; a Wilson or exact interval may be preferable.
Formula for a sample mean
For a mean, the margin of error uses the standard error of the sample mean. If the population standard deviation is known, use the normal critical value. When it is unknown, a sample standard deviation is commonly used with a t critical value and n − 1 degrees of freedom:
Known population standard deviation: MOE = z × σ / √n
Estimated from a sample: MOE = t × s / √n
Here, σ is the population standard deviation and s is the sample standard deviation. The interval is x̄ ± MOE; its width also depends on data spread and confidence level. See the standard error of the mean guide for the standard-error step.
Worked example: calculate a survey margin of error
Suppose 400 people are selected for a simple random survey and 52% choose an option. Use p̂ = 0.52, n = 400, and z = 1.96 for a two-sided 95% interval. Calculate the standard error first:
SE = √[0.52 × (1 − 0.52) / 400]
SE = √(0.2496 / 400) = √0.000624 ≈ 0.02498
MOE = 1.96 × 0.02498 ≈ 0.04896
The margin is about 0.049, or 4.9 percentage points. Subtract and add that amount to 52%:
- Lower limit: 52.0% − 4.9 points ≈ 47.1%
- Upper limit: 52.0% + 4.9 points ≈ 56.9%
Report an estimate of 52% with a margin of about ±4.9 percentage points at 95% confidence. That percentage describes the method's repeated-sampling coverage, not certainty about this one interval.

How confidence level changes the margin
For the same data and sample size, a higher confidence level uses a larger critical value. That makes the interval wider. Common two-sided standard normal values are approximately:
| Confidence level | Critical value z | Effect |
|---|---|---|
| 90% | 1.645 | Narrower interval, lower long-run coverage |
| 95% | 1.960 | Common balance for reporting |
| 99% | 2.576 | Wider interval, higher long-run coverage |
These are two-sided standard normal values. For a mean with an estimated standard deviation, use the appropriate t value. State the confidence level beside the margin.
Use the margin to plan sample size
When planning a proportion survey, rearrange the formula to solve for the number of completed responses needed for a chosen maximum margin E:
n = z² × p(1 − p) / E²
Use decimals for p and E. For 95% confidence, a 5-point target, and no prior estimate, use p = 0.50:
n = 1.96² × 0.50 × 0.50 / 0.05² = 384.16
Round up to 385 completed responses.
Round up because rounding down would exceed the target margin. The result is completed, usable responses; invite more people if nonresponse is expected, but extra invitations do not remove nonresponse bias. Using p = 0.50 is conservative because it maximizes p(1 − p).
This estimate assumes a simple random sample. Clustering, weights, stratification, subgroup goals, or a large sampling fraction can change the required n; account for the actual survey design.
Margin of error formula in Excel
For a proportion survey, suppose A2 contains the sample size, B2 contains the estimated proportion as a decimal, and C2 contains the confidence level such as 0.95. This Excel formula returns the margin as a proportion:
=NORM.S.INV(1-(1-C2)/2)*SQRT(B2*(1-B2)/A2)With A2 = 400, B2 = 0.52, and C2 = 0.95, the result is about 0.04896, or 4.9 percentage points when formatted as a percentage. Subtract and add the result to B2 for the interval limits.
For a mean, use the matching standard error and a t critical value when the population standard deviation is estimated from a small sample. Check that the selected cells contain exactly the intended observations.
Assumptions and limits to check
- Sampling: convenience samples do not become representative because they are large.
- Bias: nonresponse, coverage, wording, measurement, and processing errors are outside the sampling margin.
- Design: weighted or clustered surveys need design-aware standard errors.
- Finite populations: a large sampling fraction may require a correction.
- Rounding: calculate with unrounded values and report sensible precision.
The margin of error is one part of uncertainty reporting, not a survey quality score. A standard deviation calculator can check the spread input for a mean, but the sampling design still determines its standard error.
For context, see the researched Coursera overview and sample-mean example. This guide keeps proportion and mean inputs separate so each step can be checked.
Frequently asked questions
What is the margin of error formula for a survey proportion?
For a simple random sample under the usual normal approximation, use MOE = z × √[p̂(1 − p̂) / n]. Enter p̂ as a decimal, then report the result in percentage points when appropriate.
Is margin of error the same as standard error?
No. Standard error estimates the spread of a statistic across repeated samples. The margin of error multiplies that standard error by a confidence-level critical value to set the half-width of a confidence interval.
What is the margin of error at 95% confidence with 400 responses?
It depends on the estimated proportion. With p̂ = 0.52 and a simple random sample of 400, the standard error is about 0.02498. Using z = 1.96 gives a margin of about 0.04896, or 4.9 percentage points.
Can the margin of error be negative?
The half-width is nonnegative and is written as ±MOE around an estimate. Find the lower limit by subtracting the margin and the upper limit by adding it.
Does the margin of error account for survey bias?
No. It describes sampling uncertainty under the stated design and model. Bias from nonresponse, coverage, question wording, or measurement requires separate evaluation.
Summary
The margin of error formula is a critical value multiplied by a standard error. For a proportion, use z × √[p̂(1 − p̂) / n]; for a mean, use the matching standard error and critical value. State the confidence level, show the estimate ± margin, round the sample-size result up, and describe the sampling limits alongside the number.
