ThisCalculator

Statistics

Margin of Error Formula & How to Calculate It

Updated · Standard formula, shown below

Margin of error 98.00 ± %
z-score used
1.96
Result
Sample size
1000 people
You entered
Observed percentage
50 %
You entered

Margin of Error Formula & How to Calculate It

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 from inferential statistics, based on the normal approximation to the binomial distribution.

Formula

The margin of error (E) for a proportion is calculated as:

E = z * sqrt( pÌ‚(1 – pÌ‚) / n ) * sqrt( (N – n) / (N – 1) )

Where:

  • z = z-score corresponding to the chosen confidence level (e.g., 1.96 for 95%, 2.576 for 99%, 1.645 for 90%)
  • pÌ‚ = observed proportion (as a decimal, e.g., 0.50 for 50%)
  • n = sample size (number of respondents)
  • N = population size (use 0 or a very large number if unknown – the finite population correction factor then becomes ~1)

The first part (without the sqrt((N-n)/(N-1)) term) is the standard error of the proportion. The second part is the finite population correction (FPC), which shrinks the margin of error when the sample is a large fraction of the total population. When N is large or unknown, the FPC is effectively 1 and is often omitted.

Worked Example

Using the default values from the calculator above: sample size n = 1000, observed percentage p = 50%, confidence level = 95%, and population size = 0 (infinite).

  1. Convert p to a proportion: p̂ = 50/100 = 0.50
  2. Find the z-score for 95% confidence: z = 1.96
  3. Compute the standard error: sqrt( 0.50 * (1 – 0.50) / 1000 ) = sqrt( 0.25 / 1000 ) = sqrt(0.00025) = 0.015811
  4. Since population is infinite, the FPC = 1 (or you can skip it).
  5. Multiply by z: 1.96 * 0.015811 = 0.03099
  6. Convert to percentage points: 0.03099 * 100 = 3.10%

So the margin of error is ±3.10 percentage points. This matches the calculator’s output of 3.10%.

When to Use the Margin of Error

The margin of error applies when you are estimating a population proportion from a random sample. It is the standard companion to any poll or survey result, telling you how much the sample result might differ from the true population value due to random sampling error alone.

Use it when:

  • You have a simple random sample (or a sample that approximates one).
  • You are measuring a percentage or proportion (e.g., “52% of voters support Xâ€�).
  • You want to report a confidence interval around your estimate.

It does not account for non-sampling errors like question wording, non-response bias, or data entry mistakes. Those can be far larger than the margin of error but are not captured by this formula.

How to Choose the Confidence Level and Sample Size

The confidence level is a choice you make. The most common is 95%, which means that if you repeated the survey many times, 95% of the resulting confidence intervals would contain the true population value. Higher confidence (e.g., 99%) gives a larger margin of error; lower confidence (e.g., 90%) gives a smaller one.

Sample size is usually dictated by budget and practical constraints. To achieve a desired margin of error, you can rearrange the formula to solve for n:

n = ( z^2 * p̂(1-p̂) ) / E^2

For example, to get a ±3% margin of error at 95% confidence with p̂=0.50, you need n ≈ (1.96^2 * 0.25) / 0.03^2 = 1067. The calculator above lets you experiment with different sample sizes to see how the margin of error changes.

Common Mistakes and Pitfalls

  • Using the wrong z-score: 1.96 is for 95%, not 90% or 99%. Look up the correct value.
  • Treating percentages as decimals: The formula works with proportions (0.50), not percentages (50). If you enter 50 directly, you must divide by 100 first.
  • Ignoring the finite population correction: If your sample is more than 5% of the population, the FPC matters and will reduce the margin of error.
  • Applying it to non-random samples: The formula assumes random sampling. If your sample is a convenience sample, the margin of error is meaningless.
  • Rounding too early: Round only at the final step to avoid accumulating errors.

Limitations of the Formula

The formula relies on the normal approximation to the binomial distribution, which works well when the sample size is large and p̂ is not near 0 or 1. A common rule of thumb is that both n*p̂ and n*(1-p̂) should be at least 5 (some say 10). If your sample is small or the proportion is extreme, the normal approximation can be inaccurate – consider using the Wilson score interval or an exact method instead.

Also, the margin of error only covers sampling error. It does not include biases from non-response, question wording, or the sampling frame. Real-world polls often report a “design effect� that adjusts for complex sampling methods, which can increase the effective margin of error.

Frequently Asked Questions

What is the margin of error for a 95% confidence level with a sample of 500?

Assuming p̂=0.50 and an infinite population, the margin of error is approximately 1.96 * sqrt(0.25/500) = 4.38%. So you would report ±4.38 percentage points.

Why does the margin of error decrease when the sample size increases?

Because the standard error of the proportion is inversely proportional to the square root of the sample size. Doubling the sample size reduces the margin of error by about 30% (1/√2 ≈ 0.707). To halve the margin of error, you need to quadruple the sample size.

What is the finite population correction and when should I use it?

The finite population correction (FPC) is the factor sqrt((N-n)/(N-1)). It reduces the margin of error when the sample size is a significant fraction of the total population. Use it when n/N > 0.05. For example, if you survey 500 out of 2,000 people, the FPC would be sqrt((2000-500)/(2000-1)) ≈ 0.866, reducing the margin of error by about 13%.

Can the margin of error be more than 100%?

No. Since the margin of error is added to and subtracted from a proportion, it can never exceed 100% in absolute terms. In practice, for very small samples or extreme proportions, the normal approximation may give a value that, when added to p̂, exceeds 1 – that’s a sign to use a different method.

How is the margin of error different from the standard error?

The standard error (SE) is the standard deviation of the sampling distribution of the statistic. The margin of error is the SE multiplied by the z-score for your confidence level. In other words, the margin of error is the “radius� of the confidence interval, while the SE is the “spread� of the estimate.

Related

Formula used
in n | Sample size | people | 1000 | 1
in p | Observed percentage | % | 50 | 0
in cl | Confidence level | % | 95 | 50
in pop | Population size (optional, 0 = infinite) | people | 0 | 0
out moe | Margin of error | ± % | ( ( ( (1.96 * sqrt( (p/100) * (1 - p/100) / n )) * ( sqrt( (pop - n) / (pop - 1) ) ) ) ) * 100 ) | 2
out z | z-score used | - | 1.96 | 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.