Calculator Hero

Margin of Error Calculator

Calculates the margin of error and confidence interval for survey results, or finds the required sample size for a desired margin of error.

Last updated: June 11, 2026

Margin of Error Calculator

z = 1.96 for 95% confidence level
Enter sample size to calculate the margin of error.

How to Use the Margin of Error Calculator

This margin of error calculator has two modes: Calculate Margin of Error from a known sample size, or Find Required Sample Size for a target margin of error. Select your confidence level (90%, 95%, or 99%), enter the sample proportion p̂ (use 0.5 for the most conservative estimate), and enter either the sample size or desired MOE. The calculator returns the margin of error as both a decimal and percentage, plus the confidence interval bounds.

For formal hypothesis tests on survey proportions, combine this with our t-test calculator for significance testing.

Margin of Error Formula

The margin of error for a proportion uses the following formula:

ME = z × √(p̂(1 − p̂) / n)

Where:

  • z = critical value: 1.645 (90%), 1.96 (95%), 2.576 (99%)
  • = sample proportion (the observed percentage, expressed as a decimal)
  • n = sample size

The standard error is SE = √(p̂(1−p̂)/n), and the confidence interval is [p̂ − ME, p̂ + ME].

Solving for Required Sample Size

Rearranging the formula: n = (z / ME)² × p̂(1 − p̂). With p̂ = 0.5 (which maximizes n), this simplifies to n = (z / ME)² × 0.25. Always round up to the next integer.

AdvertisementResponsive Ad

Confidence Levels and Z-Values

The z-value comes from the standard normal distribution — it is the number of standard deviations that captures the desired percentage of the distribution:

  • 90% confidence → z = 1.645 — you accept a 10% chance of missing the true value
  • 95% confidence → z = 1.960 — the most common standard; 5% chance of error
  • 99% confidence → z = 2.576 — very conservative; only 1% chance of error, but requires larger samples

Higher confidence requires a larger z, which increases the MOE for a given sample size — or requires a larger sample to maintain the same MOE.

Sample Size vs Margin of Error

The MOE shrinks as sample size grows, but with diminishing returns — the relationship is proportional to 1/√n:

  • n = 100 → MOE ≈ ±9.8% (at 95%, p̂ = 0.5)
  • n = 400 → MOE ≈ ±4.9%
  • n = 1,000 → MOE ≈ ±3.1%
  • n = 2,500 → MOE ≈ ±2.0%
  • n = 10,000 → MOE ≈ ±1.0%

Going from ±5% to ±2.5% requires 4× the sample size. This is why reducing MOE below ±2% is expensive — you need very large samples. National polls typically target 1,000–1,500 respondents for a ±3% MOE at 95% confidence. For related statistical calculations, see our standard deviation calculator.

AdvertisementResponsive Ad

Combinatorics and Sample Counting

When designing a survey, you may also need to count how many distinct samples of size n can be drawn from a population — this involves combinations, which use factorials (n!). Our factorial calculator computes n! for any non-negative integer, which is the building block for binomial coefficients and combination formulas used in sampling theory.

Limitations of the Margin of Error

The MOE only accounts for random sampling error. It does not capture:

  • Non-response bias — if certain groups are less likely to respond, results may not represent the population
  • Question wording effects — subtle phrasing differences can shift responses by several percentage points
  • Social desirability bias — respondents may answer in socially expected ways rather than honestly
  • Coverage bias — online polls exclude people without internet access; telephone polls exclude those without phones
  • Timing effects — opinions can shift rapidly; a poll conducted over two weeks may conflate different conditions

A poll with a small MOE but significant systematic bias is less accurate than a poll with a larger MOE but sound methodology.

Sources & References

  1. Margin of errorWikipedia
  2. Confidence intervalWikipedia
  3. Survey methodologyWikipedia

Frequently Asked Questions

Related Calculators

Advertisement

320 × 50 — Mobile Anchor