How to calculate the margin of error
For a survey proportion, the margin of error is z × √(p(1 − p) ÷ n), where p is the sample proportion, n the sample size, and z the confidence z-score. With p = 0.5, n = 1000 and z = 1.96, the result is 1.96 × √(0.25 ÷ 1000) = 0.0310, or ±3.10%. The figure is a critical value times the standard error, so that is the quantity to get right first.
How to use this calculator
Enter the sample proportion as a decimal between 0 and 1, the sample size, and the z-score for your confidence level. Using p = 0.5 gives the most conservative (largest) margin. To plan a sample for a target margin, use the sample size calculator.
- Enter p as a decimal, not a percentage: 45% is 0.45, and typing 45 will be rejected.
- Report the margin as ±, so a poll at 45% with ±3.10% spans roughly 41.9% to 48.1%.
- Sampling error only. This says nothing about biased questions, poor coverage or people refusing to answer.
What affects the margin of error
The margin shrinks as the sample size grows (it depends on √n) and is widest when p = 0.5. A higher confidence level raises z and widens the margin. To turn a margin into a range around a mean, see the confidence interval calculator.
Frequently asked questions
- How do I calculate the margin of error?
- Use z × √(p(1 − p) ÷ n). With p = 0.5, n = 1000, z = 1.96 the margin is ±3.10%.
- Why use p = 0.5?
- p = 0.5 maximizes p(1 − p), giving the largest, most conservative margin of error.
- How do I reduce the margin of error?
- Increase the sample size. Because it depends on √n, quartering the margin requires roughly 16 times the sample.
- Which z-score should I use?
- Use 1.645 for 90%, 1.96 for 95%, or 2.576 for 99% confidence.
- Can I use this for a mean instead of a proportion?
- No — this formula is only for proportions. For a sample mean the margin is z × s ÷ √n, where s is the sample standard deviation, so you need the spread of your data rather than a percentage.