Margin of error formulas
Mean: MOE = z × σ ÷ √n
Finite population: multiply by √((N − n) ÷ (N − 1))
z comes from the confidence level: 1.645 for 90%, 1.96 for 95% and 2.576 for 99%. p is the sample proportion as a decimal, n is the sample size, σ is the standard deviation and N is the population size.
The sample size needed for a target margin E turns the formula around (Cochran's formula), then corrects for a small population:
n = n₀ ÷ (1 + n₀ ÷ N), rounded up
Worked example
A poll of 1,000 people finds 50% support. At 95% confidence: MOE = 1.96 × √(0.5 × 0.5 ÷ 1,000) = 1.96 × 0.01581 = 0.0310, or ±3.1 points. So true support is likely between 46.9% and 53.1%.
To get ±3 points instead: n₀ = 1.96² × 0.25 ÷ 0.03² = 1067.07, so you need 1,068 people. That matches Pew Research's note that a random sample of 1,067 has a margin of about ±3 points. If the whole population is only 10,000 people, the correction brings it down to 964.2, so 965.
Margin of error by sample size
At 95% confidence with p = 50% (the widest case). Notice that quadrupling the sample only halves the margin.
| Sample size | Margin of error |
|---|---|
| 100 | ±9.8% |
| 200 | ±6.9% |
| 400 | ±4.9% |
| 500 | ±4.4% |
| 1,000 | ±3.1% |
| 1,500 | ±2.5% |
| 2,000 | ±2.2% |
| 5,000 | ±1.4% |
Getting a realistic number
- The margin of error only covers random sampling error. It doesn't cover people who won't answer, a sample that misses groups, or leading questions.
- Results for subgroups, like one age group, have a much bigger margin because the subgroup sample is smaller.
- Weighting, which many polls use, makes the real margin larger than this simple formula gives.
- The lead of one candidate over another has a margin about twice as big as the margin on each one's share.
- For an average from a small sample (under about 30) with an SD estimated from that sample, a t-value gives a slightly wider margin. The confidence interval calculator uses t.
- The population correction only matters when the sample is more than about 5% of the population.