Calcist

Style

Buttons

Spacing

How much to show

Decimal places

Text size

Margin of error calculator

Work out the margin of error for a poll or an average, with an optional finite population correction. Or find the sample size you need for the margin you want.

Private: calculated on your device. Nothing you type is sent anywhere.

Next: Want the full interval for your data? Use the confidence interval calculator, or plan a study with the sample size calculator.

Margin of error formulas

Proportion: MOE = z × √(p(1 − p) ÷ n)
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₀ = z² × p(1 − p) ÷ E² (or (z × σ ÷ E)² for a mean)
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 sizeMargin 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.

Sources

How we checked this

Before every update, this calculator is run in a real browser with these known answers, and it must match all of them:

  • 1,000 people, 50%, 95% confidence: ±3.10% ✓
  • 1,500 people, 42%, 95% confidence: ±2.50% ✓
  • 400 of a population of 2,000, with the correction: ±4.38% ✓
  • Mean: SD 12, n = 36, 95%: ±3.919928 ✓
  • Sample size for ±3% at 95%: 1,068 ✓
  • Same, from a population of 10,000: 965 ✓
  • Edge: a sample size of 0 is rejected ✓

Last checked October 26, 2026. Spotted something wrong? The math is done in your browser with the formula shown on this page, so you can check any result by hand.

Add this calculator to your website (free)

Paste this code into any web page. The calculator works on your page, resizes itself, has no ads and no tracking cookies, and nothing your visitors type is sent anywhere. More about embedding.

Questions people ask

How do you calculate the margin of error?

For a percentage, multiply z by √(p(1 − p) ÷ n). For 50% from 1,000 people at 95%, that's 1.96 × √(0.25 ÷ 1,000) = ±3.1 points.

What sample size gives a 3% margin of error?

About 1,068 at 95% confidence, assuming 50% (the worst case). For ±5% you need 385, and for ±1% about 9,604.

Why use 50% when I don't know the result?

p(1 − p) is largest at p = 50%, so it gives the biggest margin and the safest sample size. Any other result gives a smaller margin.

What does a 95% confidence level mean?

If you repeated the poll many times, about 95% of the intervals worked out this way would contain the true value.

Does a bigger population need a bigger sample?

Hardly. For large populations the margin depends on the sample size, not the population. The correction only helps when you sample a large share of a small population.

Related calculators