Margin of Error Calculator

Find the margin of error of a poll result or a sample mean. Enter the sample proportion and the number of respondents, or the standard deviation and sample size of a mean, choose a confidence level and get the margin, the confidence interval it implies and the working. The last mode turns the question around: how many respondents does a target margin of error need?

Margin of error vs confidence interval · Sample size calculator · Confidence interval calculator · Standard error calculator

What the margin of error tells you

The margin of error is the half-width of a confidence interval: the distance from the sample estimate to each end of the interval. A poll that finds 52% support with a margin of error of ±3.1 percentage points at 95% confidence says that the support in the whole population is plausibly between 48.9% and 55.1%. It measures one thing only, sampling error: the chance variation that comes from asking a random sample instead of everyone.

The size of the margin depends on the variation in the answers, on the sample size and on the confidence you ask for. Confidence 95% means that if the survey were repeated many times with new random samples, about 95% of the intervals built this way would contain the true value. It does not mean that this one interval has a 95% probability of containing it.

Margin of error formulas

Proportion: MOE = z × √(p(1 − p) / n)

Mean, σ known: MOE = z × σ / √n

Mean, σ estimated by s: MOE = t × s / √n, with n − 1 degrees of freedom

Finite population of N units: multiply the standard error by √((N − n) / (N − 1))

Sample size for a target margin E: n = z² × p(1 − p) / E²

Here p is the sample proportion, n the sample size, σ the population standard deviation and s the sample standard deviation. The multiplier z depends only on the confidence level: 1.2816 for 80%, 1.6449 for 90%, 1.9600 for 95%, 2.5758 for 99% and 3.2905 for 99.9%. The t multiplier is larger, most of all for small samples, because s is itself an estimate. This calculator uses the exact values, not the rounded 1.96 and 2.576, so it agrees with statistical software to every digit shown.

A quick rule for polls: p(1 − p) is largest at p = 50%, so at 95% confidence the margin can never be more than about 98 ÷ √n percentage points. With 1,000 respondents that is ±3.1.

How to use this calculator

  1. Choose the estimate type: a proportion (a survey percentage), a mean with a known population standard deviation (z), a mean with the standard deviation of the sample (t, the usual case), or the number of respondents needed for a target margin.
  2. Enter the values. A proportion is a percentage: type 52 for 52%. For a mean, the sample mean is optional and only adds the interval around it.
  3. Choose the confidence level, from 80% to 99.9%. Add the population size only if the sample is a sizeable share of a small, known population.
  4. Press Calculate Margin of Error. The working under the results shows every step, and Copy link to this calculation keeps your inputs in a link you can share.

Worked example: a poll of 1,000 people

Of 1,000 respondents, 520 support a measure, so the sample proportion is 52%.

  1. Standard error = √(0.52 × 0.48 / 1000) = 0.015799.
  2. At 95% confidence z = 1.9600 (exactly 1.959964), so the margin of error is 1.959964 × 0.015799 = 0.030965, that is ±3.0965 percentage points, usually quoted as ±3.1.
  3. The interval runs from 52% − 3.0965% to 52% + 3.0965%: 48.9035% to 55.0965%.

Worked example: the mean of 36 measurements

A sample of 36 measurements has mean 80 and standard deviation s = 12. The standard deviation comes from the sample, so the multiplier is t.

  1. Standard error = 12 / √36 = 2.
  2. With n − 1 = 35 degrees of freedom the 95% multiplier is t = 2.0301, so the margin of error is 2.0301 × 2 = ±4.0602.
  3. The interval is 75.9398 to 84.0602.
  4. Using z = 1.96 as if σ were known would give ±3.9199, a margin that is too narrow by about 3.5%. If the 36 measurements had been drawn without replacement from a population of only 200 units, the standard error would shrink by √((200 − 36)/199) and the margin would be ±3.6859.

Margin of error by sample size

For a proportion of 50%, the case with the widest margin, the margin at 95% confidence falls only with the square root of the sample size:

Sample size nMargin of error (± percentage points)
100±9.80
200±6.93
400±4.90
500±4.38
800±3.46
1,000±3.10
1,067±3.00
1,500±2.53
2,000±2.19
2,401±2.00
4,000±1.55
10,000±0.98

Halving the margin takes four times the respondents: 1,000 respondents give ±3.10 and 4,000 give ±1.55. That is why polls stop near 1,000 to 1,500 interviews: the last few hundred respondents buy very little. The 1,067 and 2,401 rows are the sizes that give ±3 and ±2 points. Strictly, ±3 needs 1,067.07 respondents, so the sample size calculator rounds up to 1,068.

Confidence has a price as well. The same poll, 1,000 respondents at 50%, at other confidence levels:

Confidence levelz multiplierMargin of error (± percentage points)
80%1.2816±2.03
90%1.6449±2.60
95%1.9600±3.10
99%2.5758±4.07
99.9%3.2905±5.20

The margin of a lead between two answers

The margin of error quoted for a poll belongs to a single percentage. A lead is the difference between two percentages from the same question, and it is less certain: for two shares p₁ and p₂ in one random sample the standard error of the difference is √((p₁ + p₂ − (p₁ − p₂)²) / n). When the two answers make up nearly all responses and are close, the margin of the lead is almost twice the quoted margin.

Example: 48% against 44% among 1,000 respondents. Each share has a margin of ±3.10, but the standard error of the 4-point lead is √((0.48 + 0.44 − 0.04²) / 1000) = 0.030305, so its margin at 95% confidence is ±5.94 points. A lead of 4 points is well inside that: the poll is compatible with a tie. For two separate polls the variances add instead, √(p₁(1 − p₁)/n₁ + p₂(1 − p₂)/n₂).

Small samples: z or t?

For a proportion, or for a mean whose σ is known, the multiplier is z. For a mean with the standard deviation estimated from the same sample it is t with n − 1 degrees of freedom, which approaches z as n grows:

Sample size nDegrees of freedomt multiplier at 95%
542.7764
1092.2622
20192.0930
30292.0452
60592.0010
1201191.9801
1,0009991.9623
Any n, σ known (z)n/a1.9600

At n = 30 the t multiplier is about 4% larger than z and at n = 10 about 15% larger, so a margin computed with z would be too optimistic. The t table lists the multipliers for other sample sizes and confidence levels.

What the margin of error does not cover

  • Bias. Coverage gaps, non-response, question wording and respondents who answer untruthfully move the estimate in a way that a bigger sample does not fix.
  • Weighting and clustering. The formulas assume a simple random sample. The American Association for Public Opinion Research (AAPOR) points out that in most surveys of people or households the classical margin is too small, and that it can be multiplied by the square root of the design effect. With a design effect of 1.5 the ±3.10 of a 1,000-person poll becomes ±3.80.
  • Non-random samples. The classical margin of sampling error is defined for probability samples. AAPOR cautions that it may be misleading to report one for an opt-in sample, where any estimate of the likely error rests on a statistical model.
  • Subgroups. The margin belongs to the group that was measured: among 250 of the 1,000 respondents it is ±6.20 points, not ±3.10.
  • Proportions near 0% or 100%. When fewer than 10 successes or failures are expected, or the interval would leave the range from 0% to 100%, use the Wilson interval of the proportion confidence interval calculator.

Margin of error in Excel, R, Python and on a TI-84

ToolProportion: 52% of 1,000 (±0.030965)Mean: s = 12, n = 36 (±4.0602)
Excel=NORM.S.INV(0.975)*SQRT(0.52*0.48/1000)=CONFIDENCE.T(0.05,12,36)
Rqnorm(0.975) * sqrt(0.52 * 0.48 / 1000)qt(0.975, 35) * 12 / sqrt(36)
Python (SciPy)norm.ppf(0.975) * (0.52 * 0.48 / 1000) ** 0.5t.ppf(0.975, 35) * 12 / 36 ** 0.5
TI-84STAT, TESTS, A:1-PropZInt with x = 520, n = 1000, C-Level = .95; the margin is half the width of the intervalSTAT, TESTS, 8:TInterval, Stats, with x̄ = 80, Sx = 12, n = 36, C-Level = .95

In Excel, CONFIDENCE.NORM(alpha, standard_dev, size) returns z × σ / √n, and CONFIDENCE.T(alpha, standard_dev, size) returns t × s / √n, with alpha = 1 minus the confidence level. For the 36 measurements =CONFIDENCE.NORM(0.05,12,36) gives 3.9199, the z margin. Both return the margin of error, not the interval: add and subtract it from the mean. See also the guides to the confidence interval in Excel and to the TI-84 statistics functions.

Frequently Asked Questions

What is a good margin of error?

There is no universal threshold. National polls usually report about ±3 percentage points at 95% confidence, which needs roughly 1,000 respondents; ±5 points needs about 385 and ±1 point about 9,600. Choose the margin from the decision you have to make and the cost of each interview.

How do you calculate the margin of error?

Multiply the critical value for your confidence level (z or t) by the standard error: z × √(p(1 − p)/n) for a proportion, or t × s/√n for a mean. For 52% of 1,000 respondents at 95% confidence this is 1.96 × 0.0158 = 0.031, or ±3.1 percentage points.

Why do polls report a margin of error of about ±3%?

With about 1,000 respondents the worst-case margin, for an answer of 50%, is ±3.1 points at 95% confidence, and pollsters round it to 3. Answers far from 50% have a smaller margin.

Which confidence level should I use?

95% is the convention in polling and in most research; 90% is used when a narrower interval is acceptable and 99% when a miss is costly. Going from 95% to 99% widens the margin by about 31%, because 2.5758 is 31% more than 1.9600.

Does the population size matter?

Hardly, unless the sample is a large share of a small population. The finite population correction √((N − n)/(N − 1)) matters when the sample exceeds about 5% of the population; for a national poll it is 1 for practical purposes.

What is the margin of error for a subgroup?

It is computed from the size of the subgroup, not of the whole sample. In a poll of 1,000, a subgroup of 250 has a margin of ±6.2 points at 95% confidence for an answer of 50%.

Does a larger sample always help?

It shrinks sampling error, but only with the square root of n: four times the respondents halve the margin. It does nothing about bias from who responds, question wording or coverage, which is often larger than the sampling error.

Is the margin of error the same as the standard error?

No. The standard error measures how much the estimate would vary from sample to sample. The margin of error is the standard error times the critical value, about 1.96 at 95% confidence, and is the half-width of the confidence interval.

When do I use t instead of z?

For the mean of a sample when the standard deviation is estimated from the same data, use t with n − 1 degrees of freedom. For proportions, or when σ is known, use z. The t multiplier is about 4% larger than z at n = 30 and about 15% larger at n = 10.

What does within the margin of error mean?

That a difference is small compared with the sampling uncertainty. The margin of a lead between two answers in one poll is nearly twice the quoted margin: for 48% against 44% among 1,000 respondents it is ±5.9 points, so a 4-point lead is compatible with a tie.

Does the margin of error include non-sampling error?

No. It models random sampling variation only. Coverage error, non-response, question wording and measurement error are additional, and weighting or clustering makes the true margin larger than the simple formula gives.

Can I use it for an online opt-in poll?

The classical margin of sampling error is defined for probability samples. The American Association for Public Opinion Research cautions that reporting one for a non-probability sample may be misleading, because the likely error then depends on a model.

Embed This Calculator

Add this free calculator to your course page or LMS.

Adjust the height value to fit your page.