Margin of Error Formula & How to Calculate It
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
This calculator works out the margin of error for a survey or poll result. You enter the sample size, the population size (optional), the confidence level, and the observed percentage, and it returns the margin of error as a plus-or-minus percentage point value. The formula used is the standard one based on the normal approximation to the binomial distribution.
Formula
The margin of error (MOE) for a proportion is calculated as:
MOE = Z * √( pÌ‚(1 – pÌ‚) / n )
Where:
- Z = Z-score corresponding to the desired confidence level (1.96 for 95%, 1.645 for 90%, 2.576 for 99%)
- p̂ = observed proportion (as a decimal, e.g., 0.50 for 50%)
- n = sample size (number of respondents)
When the population size is known and small relative to the sample, a finite population correction (FPC) is applied:
MOE_corrected = MOE * √( (N – n) / (N – 1) )
Where N is the total population size. If N is large (say, over 20,000) or unknown, the FPC is typically ignored because it makes little difference.
Worked Example
Using the default values from the calculator: sample size n = 500, observed percentage p = 50%, confidence level = 95%, and no population size (so FPC = 1).
- Convert p to a decimal: 50% → 0.50
- Compute pÌ‚(1 – pÌ‚) = 0.50 * 0.50 = 0.25
- Divide by n: 0.25 / 500 = 0.0005
- Take the square root: √0.0005 ≈ 0.02236
- Multiply by Z (1.96): 1.96 * 0.02236 ≈ 0.04382
- Convert to percentage: 0.04382 * 100 = 4.38%
The margin of error is ±4.38 percentage points. So if 50% of respondents said “yes,� the true population value is likely between 45.62% and 55.38% at the 95% confidence level.
How to Choose the Right Confidence Level
The confidence level reflects how sure you want to be that the true value falls within the margin of error. The most common choices are:
- 90% (Z = 1.645) – used for quick, exploratory polls where precision is less critical.
- 95% (Z = 1.96) – the standard for most academic, business, and media surveys.
- 99% (Z = 2.576) – used when high certainty is required, such as medical or legal research.
Higher confidence levels produce larger margins of error for the same sample size. To keep the margin small while raising confidence, you must increase the sample size.
Common Mistakes and Misconceptions
One frequent error is using the margin of error as if it were a guarantee. A 95% confidence level means that if you repeated the survey 100 times, about 95 of the resulting intervals would contain the true population value. It does not mean there is a 95% chance the true value is within the interval for a single survey.
Another mistake is ignoring the observed percentage. The margin of error is largest when p̂ = 50% and shrinks as p̂ moves toward 0% or 100%. If you don’t know p̂ in advance, using 50% gives the most conservative (largest) margin.
A third issue is applying the formula to non-random samples. The margin of error only accounts for sampling error – it does not cover bias from poor question wording, nonresponse, or a non-representative sample. A well-designed survey with a small margin of error can still be wildly inaccurate if the sample is biased.
When to Use the Finite Population Correction
The finite population correction (FPC) matters when the sample size is a significant fraction of the total population – typically more than 5%. For example, if you survey 1,000 people out of a population of 5,000, the FPC noticeably reduces the margin of error. If the population is 1 million, the FPC is negligible and can be skipped.
In the calculator, enter 0 for population size to ignore the FPC, or enter the actual population size to apply it. The formula then becomes:
MOE = Z * √( pÌ‚(1 – pÌ‚) / n ) * √( (N – n) / (N – 1) )
This correction is standard in survey sampling textbooks and is built into most professional polling software.
How Sample Size Affects the Margin of Error
The relationship between sample size and margin of error is not linear – to halve the margin, you must quadruple the sample size. For example:
- n = 100 → MOE ≈ ±9.8% (at 95% confidence, p=50%)
- n = 400 → MOE ≈ ±4.9%
- n = 1,000 → MOE ≈ ±3.1%
- n = 2,500 → MOE ≈ ±2.0%
This is why national polls typically use samples of 1,000–1,500 people – it gives a reasonable balance between cost and precision. To get below ±1%, you would need a sample of over 9,600 people.
Alternatives and Related Measures
The margin of error is one part of a broader set of statistics used to describe uncertainty:
- Confidence interval – the range itself (e.g., 45.6% to 55.4%). The margin of error is half the width of this interval.
- Standard error – the standard deviation of the sampling distribution, equal to √( pÌ‚(1 – pÌ‚) / n ). The margin of error is the standard error multiplied by the Z-score.
- Design effect – a factor that adjusts the margin for complex survey designs (e.g., stratified or clustered sampling). If your survey uses such a design, multiply the margin of error by the design effect (often between 1.1 and 2.0).
For very small samples (n < 30) or extreme percentages (near 0% or 100%), the normal approximation used here can be inaccurate. In those cases, statisticians recommend exact binomial confidence intervals (like the Wilson or Clopper-Pearson methods). For most practical surveys, however, the formula above is sufficient.
Frequently Asked Questions
What is a good margin of error?
There is no universal “good� value – it depends on your purpose. For national political polls, ±3% is common. For academic research, ±5% is often acceptable. If the margin is larger than ±10%, the results are usually too imprecise to draw strong conclusions.
Why does the margin of error increase when the observed percentage is near 50%?
Because the product pÌ‚(1 – pÌ‚) is maximized at pÌ‚ = 0.5. At 50%, the standard error is largest, meaning the estimate is most uncertain. At 0% or 100%, the product is zero, giving a zero margin – but in practice you rarely see exactly 0% or 100% in a sample.
Can the margin of error be negative?
No. The margin of error is always a positive number, expressed as a plus-or-minus value (e.g., ±3%). It represents the radius of the confidence interval, not a direction.
Does a larger population size require a larger sample?
Not necessarily. Once the population is large (say, over 20,000), the sample size needed for a given margin of error barely changes. A survey of 1,000 people can represent a city of 1 million almost as well as a country of 300 million, assuming random sampling.
What if my sample is not random?
Then the margin of error formula is not valid. The formula assumes each person in the population has a known and equal chance of being selected. If you use convenience sampling or voluntary response, the margin of error may be meaningless because the sample is likely biased.
Related
Formula used
in n | Sample size | people | 500 | 1 in p | Observed percentage | % | 50 | 0 in cl | Confidence level | % | 95 | 50 in pop | Population size (optional) | - | 0 | 0 out moe | Margin of error | +/- % | ( ( ( cl == 95 ? 1.96 : cl == 90 ? 1.645 : cl == 99 ? 2.576 : 1.96 ) * sqrt( (p/100) * (1 - p/100) / n ) ) * ( pop > 0 ? sqrt( (pop - n) / (pop - 1) ) : 1 ) ) * 100 | 2
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.