What Is the Margin of Error?
When a news organization reports a poll result with "±3 percentage points," that figure is the margin of error. It does not mean the poll is wrong by 3 points. It means that if you repeated the same poll many times under identical conditions, 95% of the resulting confidence intervals would contain the true population value. The margin of error is the half-width of that interval.
One constraint worth stating early: the margin of error only accounts for random sampling error. It says nothing about non-sampling errors — question wording bias, non-response bias, undercoverage, or measurement error. A poorly designed survey with n = 10,000 can have a tiny MOE and still produce a deeply misleading estimate. This limitation is frequently overlooked when poll numbers are reported in the press.
MOE measures only random sampling variability. Systematic bias from non-probability sampling, poorly worded questions, or low response rates will not appear in the MOE figure, no matter how large the sample is.
Sampling and Polls: A Brief History
The modern polling margin of error traces directly to the work of Jerzy Neyman, whose 1934 paper on stratified sampling established the mathematical framework for confidence intervals that underpins survey reporting today. George Gallup's successful prediction of the 1936 U.S. presidential election — using a sample of roughly 50,000 against the Literary Digest's flawed poll of 2.4 million — made it clear that sample design mattered far more than raw sample size. The margin of error became the standard summary of that design's precision.
Today the same principles apply to study design in clinical trials, quality control in manufacturing, and A/B testing in software products. The underlying math is described in detail in the sampling distributions section on Statistics Fundamentals.
The Three Variables That Control MOE
These three relationships are not independent. Increasing the confidence level from 95% to 99% requires a larger critical value (from z* = 1.960 to z* = 2.576), which directly increases the MOE. Recovering that precision requires a larger sample. This trade-off is exactly what sample size calculators are built to solve.
How to Calculate Margin of Error: Step-by-Step Formulas
There are two standard versions of the margin of error formula, one for estimating a population mean and one for estimating a population proportion. The choice depends on what you measured in your sample.
Formula for a Population Mean (μ)
z* = critical value for confidence level
σ = population standard deviation
n = sample size
σ/√n = standard error (SE)
When the population standard deviation σ is unknown — which is the usual case — substitute the sample standard deviation s and use the t-distribution critical value t* instead of z*. The degrees of freedom are df = n − 1. This matters most when n is small (under 30). For large samples, the t and z critical values converge and the distinction becomes negligible. See the full confidence interval for a mean guide for the t-distribution version.
Set the confidence level and locate z*
For 90% confidence: z* = 1.645. For 95%: z* = 1.960. For 99%: z* = 2.576. These come from the standard normal distribution — see the z-table for full values.
Identify σ (or s) and n
Use the known population SD if available. Otherwise use the sample SD. Record the sample size n — the number of individual observations collected.
Calculate the standard error
SE = σ / √n. Divide the standard deviation by the square root of the sample size. This is the standard deviation of the sample mean's sampling distribution — explained further in the sample mean distribution guide.
Multiply: MOE = z* × SE
This is the margin of error as a raw number (same units as your measurement). To express it as a percentage, divide by the sample mean and multiply by 100.
Formula for a Population Proportion (p)
z* = critical value for confidence level
p̂ = sample proportion
n = sample size
√[p̂(1−p̂)/n] = standard error of proportion
When p̂ is unknown in advance — for example, before a poll is conducted — use p̂ = 0.5. This produces the most conservative (largest) possible margin of error, because the expression p̂(1 − p̂) reaches its maximum at p̂ = 0.5. Sample size tables in research proposals almost always assume p̂ = 0.5 for this reason.
When the sample is a substantial fraction of a small population, multiply the standard error by √[(N − n) / (N − 1)], where N is the total population size. For large populations (N > 10,000), this correction is negligible and safely ignored.
Live Margin of Error Calculator
Enter your study parameters below. The calculator handles both the proportion formula (most common for surveys) and the mean formula. Select the calculation type first to see the relevant inputs.
🧮 Margin of Error Calculator
Confidence Interval Structure: Point Estimate ± Margin of Error
(Estimate − MOE)
Estimate
(Estimate + MOE)
The margin of error is the radius of the confidence interval — the maximum distance expected between the sample statistic and the true population value at the chosen confidence level.
Worked Examples: Three Real-World Scenarios
Case Study 1 — Political Polling at 95% Confidence
Problem: A polling firm surveys 1,200 likely voters. 54% say they plan to vote for Candidate A. What is the margin of error at 95% confidence, and what is the confidence interval?
z* = 1.960 (95% CL)
p̂ = 0.54
n = 1,200
Critical value: 95% confidence → z* = 1.960. This comes from the standard normal distribution: 95% of area falls within ±1.960 standard deviations of the mean.
Standard error: SE = √[0.54 × 0.46 / 1200] = √[0.2484 / 1200] = √0.000207 = 0.01439
MOE: 1.960 × 0.01439 = 0.0282 = 2.82% (rounds to ±3%)
Confidence interval: 0.54 ± 0.0282 → [51.2%, 56.8%]
✅ Interpretation: We are 95% confident the true population proportion supporting Candidate A is between 51.2% and 56.8%. The candidate's lead appears real — the lower bound (51.2%) still exceeds 50%. If the MOE had straddled 50%, the race would be a statistical toss-up.
Case Study 2 — Clinical Trial Efficacy at 99% Confidence
Problem: A clinical trial measures blood pressure reduction in 80 patients. The sample mean reduction is 12.4 mmHg with a known population SD of σ = 6.5 mmHg. Compute the 99% confidence interval and margin of error.
z* = 2.576 (99% CL)
σ = 6.5 mmHg
n = 80
Critical value: 99% confidence → z* = 2.576. Clinical standards typically use 99% confidence (α = 0.01) to reduce the risk of false positives.
Standard error: SE = 6.5 / √80 = 6.5 / 8.944 = 0.7270 mmHg
MOE: 2.576 × 0.7270 = 1.87 mmHg
99% CI: 12.4 ± 1.87 → [10.53 mmHg, 14.27 mmHg]
✅ Interpretation: We are 99% confident the true mean blood pressure reduction is between 10.53 and 14.27 mmHg. Since the entire interval lies well above zero, there is strong statistical evidence of a real treatment effect. The higher confidence level required a wider interval — a direct cost of reducing α from 0.05 to 0.01.
Case Study 3 — Manufacturing Quality Control at 90% Confidence
Problem: A manufacturer inspects a sample of 300 components and finds 18 defective (p̂ = 6%). They want a 90% confidence interval for the true defect rate to inform production adjustments.
Critical value: 90% confidence → z* = 1.645
Standard error: SE = √[0.06 × 0.94 / 300] = √[0.0564 / 300] = √0.000188 = 0.01371
MOE: 1.645 × 0.01371 = 0.02255 = 2.26%
90% CI: 6% ± 2.26% → [3.74%, 8.26%]
✅ Interpretation: At 90% confidence the true defect rate is between 3.74% and 8.26%. If the manufacturer's tolerance threshold is 5%, the upper bound of 8.26% warrants investigation — the sample alone cannot rule out a defect rate double the target. Using 90% rather than 95% was a deliberate choice to allow a slightly narrower interval with a lower sample cost.
Quick-Reference Calculation Matrices
Critical Value Cheat Sheet
| Confidence Level | Alpha (α) | Tail Area (α/2) | Critical Value z* |
|---|---|---|---|
| 90% | 0.10 | 0.050 | 1.645 |
| 95% | 0.05 | 0.025 | 1.960 |
| 99% | 0.01 | 0.005 | 2.576 |
Sample Size Impact on MOE (95% CL, p̂ = 0.5)
| Sample Size (n) | Standard Error (SE) | Margin of Error (MOE) | Change from n = 100 |
|---|---|---|---|
| 100 | 0.0500 | 9.8% | — |
| 500 | 0.0224 | 4.4% | −55% |
| 1,000 | 0.0158 | 3.1% | −68% |
| 2,000 | 0.0112 | 2.2% | −78% |
| 5,000 | 0.0071 | 1.4% | −86% |
| 10,000 | 0.0050 | 1.0% | −90% |
This table demonstrates the diminishing returns of increasing sample size. Going from n = 100 to n = 1,000 (ten times larger) reduces MOE from 9.8% to 3.1% — not by a factor of ten, but by roughly two-thirds. That square-root relationship means you need 100× the sample to get 10× the precision. The sample size calculator makes it straightforward to solve for n given a target MOE.
Statistical Comparisons: MOE vs. Related Concepts
Margin of Error vs. Standard Error
These two terms are frequently confused because both measure variability in sample statistics. The distinction is precise and worth getting right.
| Concept | Standard Error (SE) | Margin of Error (MOE) |
|---|---|---|
| Definition | SD of the sampling distribution of a statistic | Maximum expected deviation between sample and population at a set confidence level |
| Formula | SE = σ/√n (for mean) SE = √[p̂(1−p̂)/n] (for proportion) | MOE = z* × SE |
| Confidence level | Not tied to a confidence level | Always tied to a specific confidence level (e.g., 95%) |
| Reported? | Mostly in academic tables and regression output | Standard in poll and survey reporting |
| Relationship | Building block of MOE | SE scaled by a critical value |
The standard error is a property of the statistic and the sample design. The margin of error adds the decision about how confident you want to be, converting SE into the language of interval estimation. For more on SE and its role in inference, see the guide to sampling distributions of sample proportions.
Margin of Error vs. Confidence Interval
| Concept | Margin of Error | Confidence Interval |
|---|---|---|
| What it is | The half-width of the CI (a single number) | A range: [estimate − MOE, estimate + MOE] |
| Tells you | How precise the estimate is | The range likely to contain the true value |
| Example | ± 3% | [51%, 57%] |
| Used in | Polls, news reports, sample size planning | Academic papers, data analysis, decision-making |
The confidence interval tells you where the truth probably lives. The margin of error tells you how wide that region is. You need both to interpret a survey result fully. See the confidence interval for a proportion and confidence interval for a mean pages for the full derivation of each.
Where Margin of Error Appears in Practice
Political Polling
The most visible use. News organizations report MOE alongside every poll result. A 3-point lead within a ±3% MOE is a statistical dead heat.
Clinical Research
Trial results report CIs around treatment effects. Regulators at the FDA and EMA use interval width as a measure of evidence quality.
Quality Control
Acceptance sampling plans specify MOE thresholds. A batch is approved only when the defect rate CI falls below the tolerance limit.
Market Research
Brand tracking surveys, customer satisfaction scores, and net promoter scores all carry a MOE that governs meaningful change detection.
Python and R Implementation
Python (scipy.stats)
import scipy.stats as stats import math # Margin of error for a proportion def moe_proportion(p_hat, n, confidence=0.95): z = stats.norm.ppf(1 - (1 - confidence) / 2) se = math.sqrt((p_hat * (1 - p_hat)) / n) moe = z * se return { "moe": round(moe, 4), "lower": round(p_hat - moe, 4), "upper": round(p_hat + moe, 4), "z_star": round(z, 3) } # Margin of error for a mean (known σ) def moe_mean(sigma, n, x_bar=None, confidence=0.95): z = stats.norm.ppf(1 - (1 - confidence) / 2) se = sigma / math.sqrt(n) moe = z * se result = {"moe": round(moe, 4), "z_star": round(z, 3)} if x_bar is not None: result["lower"] = round(x_bar - moe, 4) result["upper"] = round(x_bar + moe, 4) return result # Examples print(moe_proportion(0.54, 1200, confidence=0.95)) # {'moe': 0.0282, 'lower': 0.5118, 'upper': 0.5682, 'z_star': 1.96} print(moe_mean(6.5, 80, x_bar=12.4, confidence=0.99)) # {'moe': 1.8727, 'z_star': 2.576, 'lower': 10.5273, 'upper': 14.2727}
R Script
# Margin of error for a proportion moe_proportion <- function(p_hat, n, confidence = 0.95) { z <- qnorm(1 - (1 - confidence) / 2) se <- sqrt((p_hat * (1 - p_hat)) / n) moe <- z * se list(moe = round(moe, 4), lower = round(p_hat - moe, 4), upper = round(p_hat + moe, 4), z_star = round(z, 3)) } # Margin of error for a mean (known sigma) moe_mean <- function(sigma, n, x_bar = NULL, confidence = 0.95) { z <- qnorm(1 - (1 - confidence) / 2) se <- sigma / sqrt(n) moe <- z * se result <- list(moe = round(moe, 4), z_star = round(z, 3)) if (!is.null(x_bar)) { result$lower <- round(x_bar - moe, 4) result$upper <- round(x_bar + moe, 4) } result } # Examples moe_proportion(0.54, 1200, confidence = 0.95) moe_mean(6.5, 80, x_bar = 12.4, confidence = 0.99)
Entity and Formula Glossary
| Term | Formula | Interpretation |
|---|---|---|
| Margin of Error | MOE = z* × SE | Maximum expected distance between the sample statistic and the true population parameter at a stated confidence level |
| Confidence Interval | Estimate ± MOE | The range [Lower, Upper] constructed to contain the true parameter with probability equal to the confidence level |
| Confidence Level | 1 − α | The long-run proportion of identically constructed intervals that will contain the true parameter |
| Standard Error (mean) | SE = σ / √n | Standard deviation of the sample mean's sampling distribution; measures how much x̄ varies across repeated samples |
| Standard Error (proportion) | SE = √[p̂(1−p̂)/n] | Standard deviation of the sample proportion's sampling distribution |
| Critical Value | z* or t* | The z or t score that cuts off the tail(s) at α/2 for a two-tailed interval; depends on the confidence level |
| Sample Size | n | Number of independent observations; MOE decreases proportionally to 1/√n |
| Point Estimate | p̂ or x̄ | The single sample-based value used to estimate the population parameter; the center of the confidence interval |