01
Margin of error formula
margin of error = z × √(p × (1 − p) ÷ n)
for a mean: margin of error = z × SD ÷ √n
z is 1.645 for 90%, 1.960 for 95% and 2.576 for 99% confidence. p is the sample proportion; 0.5 gives the widest margin and is the usual choice when you quote one figure for a whole survey. For a population of N, multiply by √((N − n) ÷ (N − 1)).
Sources: NIST/SEMATECH e-Handbook, §7.2.4.1 (the proportion formula, which it calls the most frequently used; it recommends the Wilson interval, whose lower limit, unlike this formula’s, cannot be negative); §7.2.2.2 (the margin for a mean when σ is known, z × σ ÷ √n; with an SD from a small sample, the t value replaces z).
02
Margin of error by sample size
| Sample size | Margin of error (95%, p = 50%) |
|---|---|
| 100 | ± 9.80% |
| 400 | ± 4.90% |
| 1,000 | ± 3.10% |
| 2,000 | ± 2.19% |
| 5,000 | ± 1.39% |
Halving the margin takes four times the sample. With 400 responses from a population of 2,000, the correction brings ± 4.90% down to ± 4.38%.
03
What the margin does not cover
The margin of error only measures random sampling error. It assumes a random sample; it says nothing about people who did not respond, leading questions or a sample that leaves out part of the population. For percentages near 0% or 100% and small samples, the simple formula is inaccurate and a Wilson interval is better.
04
Common mistakes with the margin of error
- Quoting the whole survey’s margin for a subgroup. 1,000 responses give ± 3.10%; the 250 people in one subgroup give ± 6.20%.
- Using it for the gap between two answers. With 52% against 48% among 1,000 people, the 4-point lead has a margin of ± 6.19 points, not ± 3.1.
- Applying the simple formula to small samples and extreme percentages. For 3% of 30 people the margin is ± 6.10 points, so the lower limit comes out below zero; use a Wilson interval instead.
Trust
How this page is checked
- The calculation runs on code with automated tests against worked reference values. Every number in the examples on this page was produced by that same code, not typed by hand.
- The formulas and conventions used are stated on the page, so you can reproduce the result yourself or compare it with your own software.
- Last reviewed by the Sciloom team, Zebra Nine Studio Inc. It is a tool for research and teaching, not a substitute for a statistician, a validated lab method or medical advice.
Cite this page
Sciloom. (2026). Margin of error calculator. Zebra Nine Studio Inc. https://sciloom.si/margin-of-error-calculator
Frequently asked questions
How do I calculate the margin of error?
Multiply the z value for your confidence level by the standard error. For a survey of 1,000 at 95% confidence: 1.96 × √(0.5 × 0.5 ÷ 1000) = 0.031, or about ± 3.1 percentage points.
What is a good margin of error?
National polls usually aim for about ± 3 percentage points, which takes roughly 1,000 responses. Smaller studies often accept ± 5 points, about 400 responses.
Does population size matter?
Hardly, unless the sample is more than about 5% of the population. A sample of 1,000 gives nearly the same margin for a city as for a country.
Is the margin of error the same as a confidence interval?
The margin is half the width of the interval. A result of 40% with a margin of ± 3 points corresponds to a confidence interval of 37% to 43%.