Margin of Error Calculator: Formula & How to Use It
- Lower bound
- %
- Result
- Upper bound
- %
- Result
- Sample size
- 1000 people
- You entered
A statistical margin of error calculator works out the range around a survey or poll result that likely contains the true population value, given your sample size, the observed percentage, and a chosen confidence level. You enter the sample size, the proportion (as a percentage), and usually a confidence level (most often 95%), and you get back the margin of error as a plus-or-minus percentage point figure. This article explains the formula, walks through a worked example, and covers the common pitfalls that make margins of error misleading.
Formula
The margin of error (MoE) for a proportion is calculated as:
MoE = z * sqrt( p * (1 – p) / n )
where:
- z = the z-score corresponding to your confidence level (1.96 for 95%, 1.645 for 90%, 2.576 for 99%)
- p = the observed proportion (as a decimal, so 50% becomes 0.50)
- n = the sample size (number of respondents)
When you work with percentages directly, the formula becomes MoE = z * sqrt( p% * (100 – p%) / n ), which gives the margin in percentage points. The result is added to and subtracted from the observed percentage to give the confidence interval.
Worked Example
Using the default values from the calculator above (sample size = 1000, observed percentage = 50%, confidence level = 95%):
- Convert 50% to a decimal: p = 0.50
- Compute p * (1 – p) = 0.50 * 0.50 = 0.25
- Divide by n: 0.25 / 1000 = 0.00025
- Take the square root: sqrt(0.00025) = 0.015811
- Multiply by z = 1.96: 1.96 * 0.015811 = 0.03099
- Convert to percentage points: 0.03099 * 100 = 3.1%
So with 1000 respondents and 50% saying yes, the margin of error is ±3.1 percentage points at 95% confidence. The confidence interval is 50% ± 3.1%, meaning the true population value likely lies between 46.9% and 53.1%.
Why the Margin of Error Exists
No survey can ask everyone in a population, so every sample estimate carries some uncertainty. The margin of error quantifies that uncertainty from random sampling. If you drew 100 different random samples of the same size and computed the same statistic each time, the margin of error (at 95% confidence) would mean that about 95 of those intervals would contain the true population value. The other 5 would miss it just by chance.
This is not a statement about bias, non-response, or poor question wording. It only reflects the variability that comes from sampling a fraction of the population. A well-conducted survey with a 3% margin of error is still subject to other errors that the margin does not capture.
How Sample Size and Percentage Affect the Result
The margin of error shrinks as the sample size grows, but not linearly. To halve the margin, you must quadruple the sample size. For example, going from 1000 to 4000 respondents cuts the margin from about 3.1% to about 1.5% (at 50%, 95% confidence).
The observed percentage also matters. The margin is largest when p = 50% and smaller toward the extremes. A poll showing 90% support with a sample of 1000 has a margin of about 1.9%, while a poll showing 50% has a margin of about 3.1%. That is why pollsters often report the margin at 50%—it is the worst-case scenario and applies to any result near the middle.
Choosing a Confidence Level
The confidence level is the probability that the interval contains the true value if you repeated the survey many times. The most common choices are:
- 90% (z = 1.645): a narrower interval, but you accept a 10% chance of being wrong
- 95% (z = 1.96): the standard in most social science and polling work
- 99% (z = 2.576): a wider interval, used when the cost of being wrong is high
Higher confidence always produces a larger margin of error for the same sample size. There is no free lunch: you cannot simultaneously have a very high confidence and a very small margin without increasing the sample size.
Common Mistakes and Misconceptions
One frequent error is treating the margin of error as if it applies to the difference between two candidates in a poll. If Candidate A has 48% and Candidate B has 45%, each with a margin of ±3%, the difference of 3 points is not automatically significant. The margin for the difference is larger—roughly the square root of the sum of the squared individual margins, which in this case is about ±4.2 points. So the race is effectively a tie.
Another mistake is using the margin of error for a sample that was not randomly selected. Convenience samples, online opt-in panels, or self-selected polls do not meet the assumptions of probability sampling, so the formula gives a number that looks precise but has no valid statistical basis.
A third issue is rounding. If you round the margin to fewer decimal places than the percentage itself, you can imply false precision. Report both to the same number of decimal places.
Finally, the margin of error does not account for non-response bias, question order effects, or coverage errors. A survey with a tiny margin can still be badly wrong if the sample is not representative.
Alternatives and Related Measures
For small samples or rare events, the normal approximation used here breaks down. In those cases, statisticians use the Wilson score interval or the exact Clopper-Pearson interval, which are more conservative and do not produce negative lower bounds. Many online calculators offer these as alternatives.
For continuous data (like averages rather than percentages), the margin of error uses the standard deviation of the sample and the t-distribution instead of the normal distribution. The formula becomes MoE = t * (s / sqrt(n)), where s is the sample standard deviation and t is the critical value from the t-distribution with n-1 degrees of freedom.
If you are designing a study and need to know what sample size to collect, you can rearrange the formula: n = (z^2 * p * (1-p)) / MoE^2. For a 3% margin at 95% confidence and p = 0.5, that gives n = (1.96^2 * 0.25) / 0.03^2 ≈ 1067 respondents.
Frequently Asked Questions
What is the difference between margin of error and standard error?
The standard error is the standard deviation of the sampling distribution—it measures how much the estimate varies from sample to sample. The margin of error is the standard error multiplied by the z-score for your confidence level. So the margin of error is the standard error scaled to the confidence you want.
Why is the margin of error always largest at 50%?
Because the expression p * (1-p) reaches its maximum when p = 0.5. At p = 0.5, the product is 0.25. At p = 0.1, it is only 0.09, and at p = 0.01, it is 0.0099. Since this product sits inside a square root, the margin shrinks as the percentage moves away from 50%.
Can the margin of error be more than 100%?
No, not for a valid calculation. The margin is always less than the percentage itself when the sample size is reasonable. For very small samples (like n = 10) and p = 50%, the margin can exceed 30 percentage points, but it still stays below 100%. The normal approximation becomes unreliable at such small sizes, so you should use an exact method instead.
Does the population size matter?
Only when the sample is a large fraction of the population. If you sample more than 5% of a finite population, you can apply the finite population correction: multiply the margin by sqrt((N – n) / (N – 1)), where N is the population size. For typical national polls with populations in the millions and samples around 1000, the correction is negligible.
What does “margin of error of ±3%� actually mean?
It means that if the survey were repeated many times with the same method and sample size, the true population value would fall within 3 percentage points of the reported result about 95% of the time (assuming 95% confidence). It does not mean there is a 95% chance the true value is within that range for this specific poll—the true value is either inside or outside, but you cannot know which.
Related
Formula used
in n | Sample size | people | 1000 | 1 in p | Observed percentage | % | 50 | 0 in cl | Confidence level | 90%=1.645, 95%=1.96, 99%=2.576 | 1.96 | 0 out moe | Margin of error | ± % | (cl * sqrt(p * (100 - p) / n)) | 1 out ci_low | Lower bound | % | p - (cl * sqrt(p * (100 - p) / n)) | 1 out ci_high | Upper bound | % | p + (cl * sqrt(p * (100 - p) / n)) | 1
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.