Margin of Error Calculator

  • Tested against OpenStax's examples and 120 cases worked to 120 digits by an independent program
  • Checked by Wayne Bickerton
  • Sources: OpenStax
  • Updated November 6, 2026

A poll or survey only asks some people, so its result could be a little off from what everyone thinks. The margin of error says by how much. Type how many people answered, the result and the confidence level to see the likely range (the confidence interval), or switch to sample size to find how many people to ask.

%
%

Result: the share who gave an answer, like 52% saying yes. Not sure? 50% gives the widest margin.

Margin of error
±3.1% 95% confidence

With 1,000 people and a result of 50%, the true figure is likely between 46.9% and 53.1% (95% confidence).

Likely range 46.9% – 53.1%
z-score 1.96
For half the margin 4,000 people

What is the margin of error?

The margin of error is how far a survey result could be from the true figure for everyone, at a chosen confidence level. A result of 50% with a margin of ±3.1% means the true share is likely between 46.9% and 53.1%. That range is called a confidence interval.

It only covers the luck of who happened to be asked in a random sample. It doesn’t fix a sample that isn’t random or questions that steer people. And it works only when more than 5 people gave each answer.

Source OpenStax · Introductory Statistics 2e, 8.3 A Population Proportion ↗

How to calculate the margin of error

Margin of error = z × √(p′ × (1 − p′) ÷ n)

Here it is with your numbers:

  1. The z-score for 95% confidence is 1.96.
  2. Margin = z × √(0.5 × 0.5 ÷ 1,000)
  3. Margin = 3.1%
  4. Range = 50% ± 3.1%

It means we estimate with 95% confidence that the true figure for everyone is between 46.9% and 53.1%.

The z-score comes from the normal curve: for 95% confidence, 95% of the curve lies between −1.96 and 1.96. For 90% it is 1.6449 (often written 1.645) and for 99% it is 2.5758.

Sample size needed for a margin of error

To plan a survey, turn the formula around: n = z² × p′ × (1 − p′) ÷ margin², rounded up. Use 50% for the result if you don’t know it yet; that gives the largest sample, so you are covered whatever the answer. Choose “Sample size” above.

Margin of error for the result and confidence level above, by the number of people asked:

People askedMargin of error
100±9.8%
250±6.2%
500±4.38%
1,000±3.1%
1,500±2.53%
2,000±2.19%
5,000±1.39%
10,000±0.98%

FAQs

How to find the 95% margin of error?

Multiply 1.96 by the square root of p′ × (1 − p′) ÷ n, where p′ is the result as a decimal and n the number of people. OpenStax’s example: 421 of 500 people (0.842) gives 1.96 × √(0.842 × 0.158 ÷ 500), which is 0.032, so the true share is likely between 81% and 87.4%.

Source OpenStax · Introductory Statistics 2e, 8.3 A Population Proportion ↗

What is a 3% margin of error?

It means the true figure is likely within 3 percentage points either way of the result. A poll showing 40% with a 3% margin at 95% confidence puts the true share between 37% and 43%.

What sample size is needed for a 5% margin of error at 95% confidence?

385 people, when you don’t know the result in advance. Use 50% for it, the most careful choice: 1.96 (more exactly 1.959964) squared × 0.5 × 0.5 ÷ 0.05 squared is 384.1459, rounded up to 385.

Does sample size affect the margin of error?

Yes: more people give a smaller margin, but it shrinks with the square root of the sample size. Asking 4 times as many people halves it: ±3.1% for 1,000 people becomes ±1.55% for 4,000.

What does 95% margin of error mean?

It is the margin at a 95% confidence level: if you repeated the survey many times, 95% of the ranges worked out this way would contain the true figure. A 99% level needs a wider margin for the same people.

Sources

Related calculators