Margin of Error Calculator: Formula & How to Use 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.
The margin of error calculator works out the range within which the true population value likely falls, based on your sample size, sample proportion, and confidence level. You enter the sample size, the observed proportion (as a percentage), and choose a confidence level (90%, 95%, or 99%), and the calculator returns the margin of error as a percentage. This is the standard ± value you see attached to poll results, such as “±3%.�
Formula
The margin of error (E) for a proportion is calculated using the formula:
E = Z * sqrt( p̂(1 − p̂) / n )
- E = margin of error (as a decimal, multiply by 100 to get a percentage)
- Z = Z-score corresponding to the chosen confidence level (1.645 for 90%, 1.96 for 95%, 2.576 for 99%)
- p̂ = sample proportion (as a decimal, e.g., 0.50 for 50%)
- n = sample size (number of respondents or observations)
This formula assumes a simple random sample and a binary outcome (e.g., yes/no, support/oppose). It is the most commonly used formula for poll margins of error.
Worked Example
Using the calculator defaults: sample size (n) = 500, sample proportion (p) = 50%, confidence level = 95% (Z = 1.96).
- Convert the proportion to a decimal: p̂ = 0.50
- Compute p̂(1 − p̂) = 0.50 × 0.50 = 0.25
- Divide by n: 0.25 / 500 = 0.0005
- Take the square root: sqrt(0.0005) ≈ 0.02236
- Multiply by Z: 1.96 × 0.02236 ≈ 0.04383
- Convert to percentage: 0.04383 × 100 = 4.38%
The margin of error is ±4.38%. This means if 50% of the sample gave a certain answer, the true population value is likely between 45.62% and 54.38% (at the 95% confidence level).
How to Choose the Confidence Level
The confidence level reflects how sure you want to be that the true value lies within the margin. A 95% confidence level is standard in most social science and market research. Use 90% when you accept more risk of being wrong, often in exploratory research. Use 99% when precision is critical (e.g., medical or legal decisions), but note that the margin of error grows because the Z-score increases.
For a given sample size, higher confidence always yields a larger margin of error. There is no “correct� level—it depends on the stakes of being wrong.
How Sample Size Affects the Margin
The margin of error decreases as sample size increases, but not linearly. To halve the margin, you must quadruple the sample size. For example:
- n = 100 → margin ≈ ±9.8% (at 95% confidence, p=50%)
- n = 400 → margin ≈ ±4.9%
- n = 1,000 → margin ≈ ±3.1%
- n = 10,000 → margin ≈ ±1.0%
This is why national polls often use samples of 1,000–2,000 people—it gives a reasonable balance between cost and precision.
Common Mistakes and Misconceptions
Mistake 1: Using the wrong Z-score. Many people use 1.96 for 90% or 2.576 for 95%. Double-check the table.
Mistake 2: Confusing percentage points with percent. A margin of ±3% means the true value is within 3 percentage points, not 3% relative. If the sample proportion is 50%, the interval is 47%–53%, not 48.5%–51.5%.
Mistake 3: Applying the margin to subgroups. The margin of error applies to the whole sample, not to subsets like age or gender groups. Subgroup margins are larger because the effective sample size is smaller.
Misconception: “The margin of error covers all errors.� It only covers random sampling error. It does not account for non-response bias, question wording, or coverage errors.
When to Use This Formula (and When Not To)
Use this formula when you have a random sample from a large population (over 10,000) and you are measuring a proportion. It is ideal for political polls, customer satisfaction surveys, and market research.
Do not use it for:
- Small populations (under 10,000) – you need a finite population correction: multiply the margin by sqrt((N−n)/(N−1)), where N is the population size.
- Means or averages – that uses a different formula involving the standard deviation.
- Non-random samples – convenience samples or online opt-in polls do not meet the assumptions.
Alternatives and Related Concepts
If you are estimating a mean (e.g., average income), the margin of error formula is E = Z * (σ / sqrt(n)), where σ is the population standard deviation (or use the sample standard deviation with a t-score for small samples).
For small populations, apply the finite population correction mentioned above. For very small samples (n < 30), consider using a t-distribution instead of the normal Z-distribution.
Related terms: confidence interval (the range itself), standard error (the denominator sqrt(p̂(1−p̂)/n)), and statistical significance (whether the interval excludes a null value).
Frequently Asked Questions
What does “margin of error� actually mean?
It is the maximum expected difference between the sample result and the true population value, due to random sampling. If a poll says 52% with a ±3% margin, the true support is likely between 49% and 55%, assuming no other biases.
Why is the margin of error largest at 50%?
Because the formula uses p̂(1−p̂), which reaches its maximum when p̂ = 0.50. At 50%, the product is 0.25; at 10% or 90%, it is 0.09, giving a smaller margin. This is why polls near a 50/50 split report the largest error.
Can the margin of error be zero?
Only if you survey the entire population (n = N) or if the sample size is infinite. In practice, it is always positive. A margin of ±0% would mean you have no sampling error, which is impossible with a sample.
How do I calculate margin of error without a calculator?
Use the formula manually: multiply the Z-score by the square root of (p̂(1−p̂) divided by n). For a quick estimate at 95% confidence, use Z=2 (rounding 1.96) and p̂=0.5, giving approximately 1/sqrt(n). For n=1000, that is 1/31.6 ≈ 3.2%.
Does the margin of error change if the population is large?
No, as long as the population is much larger than the sample (typically 10 times or more). The formula does not include population size. Only for small populations (under 10,000) do you need the finite population correction, which slightly reduces the margin.
Related
Formula used
in n | Sample size | people | 500 | 1 in p | Sample proportion | % | 50 | 0 sel cl | Confidence level | 90%=1.645, 95%=1.96, 99%=2.576 | 1.96 out moe | Margin of error | ±% | (cl * sqrt((p/100)*(1-p/100)/n))*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.