Margin of Error Calculator

Enter your sample size and either the sample percentage or the standard deviation. You get the margin of error, the standard error, the critical value and the sample needed to halve the margin.

Updated

Embed this calculator

Paste this code into your page. The calculator runs inside the frame and links back to the full version.

Keep the credit link in place. Do not resell the calculator.

Formula

  • Proportion: MOE = z × √(p × (1 - p) / n), shown in percentage points
  • Mean: MOE = (z or t) × s / √n, with n - 1 degrees of freedom for t
  • Standard error: √(p(1-p)/n) or s / √n
  • Sample needed to halve the margin: 4 × n

Worked example

Poll of n = 1,000 with p = 50% at 95% confidence:

  • Standard error = √(0.25 / 1000) = 0.01581, i.e. 1.581 points
  • MOE = 1.95996 × 1.581 = 3.099 points
  • Halving it needs 4,000 respondents.

Mean with s = 12 and n = 36: z gives 1.96 × 2 = 3.92; t(35) = 2.0301 gives 4.06.

Frequently asked questions

What is the margin of error formula for a poll?

For a proportion it is z × √(p(1-p)/n). With p = 50%, n = 1,000 and 95% confidence (z = 1.96) it is 1.96 × √(0.25/1000) = 0.03099, or about ±3.1 percentage points.

How big a sample do I need to halve the margin of error?

Four times as big, because the margin shrinks with the square root of n. Going from 1,000 to 4,000 respondents moves a ±3.1 point margin to about ±1.55.

Should I use z or t for a mean?

Use z if the population σ is known or the sample is very large. Otherwise use t with n - 1 degrees of freedom. For s = 12 and n = 36 at 95%, z gives ±3.92 and t (2.030) gives ±4.06.

Does the margin of error cover all survey errors?

No. It only describes random sampling error for a simple random sample. Bias from who responds, question wording and coverage is not included, so the true error can be larger.