Margin of error is the number that turns a single survey result into an honest range of possibilities. Whenever you see a poll, a study, or a survey report a percentage or an average, the margin of error tells you how much that number could realistically be off โ and how seriously to take small differences between competing results.
How the margin of error is calculated
For a survey proportion, the margin of error is z ร โ(p(1โp)/n) โ a critical value (z) multiplied by the standard error of the proportion. For an average, it's z ร SD/โn, the same z multiplied by the standard error of the mean. In both cases the standard error shrinks as the sample size n grows, but only by the square root of n: to cut your margin of error in half, you need roughly four times the sample, not double.
The z-score comes from the standard normal distribution and depends only on your chosen confidence level: 1.645 for 90%, 1.96 for 95%, and 2.576 for 99%. Because it's fixed for a given confidence level, the sample size and variability (p or the standard deviation) are what actually drive the result.
Inputs and what they mean
Sample size (n) is the count of people or observations surveyed โ bigger samples give tighter margins, with diminishing returns. Proportion (p) is your best estimate of the share falling into a category, from 0 to 1; if you have no prior estimate, 0.5 gives the most conservative (widest) margin of error, which is why most published national polls implicitly assume it. Standard deviation measures how spread out your data is around the mean โ a tighter cluster of values (low SD) gives a smaller margin of error for the same sample size. The optional population size only matters when your sample is a large share of a small, finite group; for national surveys or web polls it's effectively infinite and can be left blank.
Limits and edge cases
This calculator assumes simple random sampling โ every member of the population had an equal, independent chance of being selected. Real-world surveys often use stratified, clustered, or weighted sampling, which changes the effective margin of error (usually widening it via a "design effect"). It also assumes the sampling distribution is approximately normal, which holds well for most sample sizes above about 30, but can break down for very small samples or extreme proportions (p very close to 0 or 1).
Margin of error only accounts for random sampling variability โ it says nothing about non-response bias, poorly worded questions, or a sample that doesn't represent the population you care about. A poll can have a tiny margin of error and still be systematically wrong if the people who responded aren't representative.