Solved.tools — Free Online Calculators & Tools

We use cookies for analytics and advertising. Learn more about our cookie policy

Margin of Error Calculator

Last updated: 16 August 2026

Reviewed by Gavin · Research and drafting assisted by AI

Margin of Error Calculator

Compute a confidence interval margin of error for a proportion or a mean, or solve for the sample size needed to hit a target margin.

Result

Critical value1.96
Standard error √(p(1−p)/n)0.05
Margin of error9.8%
Lower bound40.2%
Upper bound59.8%
50% ± 9.8% → [40.2%, 59.8%]

Formulas

MoE = z · √( p · (1 − p) / n )  ·  CI = p ± MoE

Critical values used: z90 = 1.645, z95 = 1.960, z99 = 2.576.

Was this helpful?


Margin of Error Calculator

The margin of error (MoE) is the standard way of saying "how close is this estimate to the truth?" Whenever you read a poll that says "52% support Candidate A, plus or minus 3 percentage points," that "3 percentage points" is the margin of error. It comes from the same family of formulas that William G. Cochran laid out in Sampling Techniques (Wiley, 3rd ed., 1977), the work that is still cited in the NIST/SEMATECH e-Handbook of Statistical Methods and in the methods pages of Pew Research Center and the American Association for Public Opinion Research (AAPOR). This calculator applies those formulas to two of the most common cases a researcher faces: a yes/no proportion (such as a survey question with a binary answer or a conversion-rate metric in an A/B test) and a continuous mean (such as a measured time, height, or test score). It also has a "solve for n" tab that inverts the formula so you can plan a study backwards from the margin you want.

How to Use the Margin of Error Calculator

  1. Pick a mode using the tabs at the top: Proportion for yes/no questions and percentages, Mean for continuous measurements like time or weight, or Solve for n when you want to know how many people to survey to hit a target margin.
  2. Enter the inputs. For Proportion you need the sample size n and the observed proportion p. For Mean you need n, the sample mean , and the sample standard deviation s. For Solve for n you enter the desired margin (as a percentage) and an expected proportion p, the conservative default of 0.5 maximises the required sample size and is the right choice when you have no prior estimate.
  3. Pick a confidence level: 90%, 95%, or 99%. The default 95% is what you see in nearly all published polls.
  4. Optionally tick Use exact t (Mean mode only). This swaps the z critical value for an exact Student-t critical value when n < 30, a small-sample correction recommended in the NIST/SEMATECH handbook.
  5. Read the result panel. You will see the standard error, the margin of error, the lower and upper bounds, and a copyable confidence-interval string.
  6. Click Copy next to the interval if you want to paste the answer into a report or email.

The Formulas

The proportion mode uses the textbook Cochran formula:

MoE = z · √( p · (1 − p) / n )

Here p is the observed proportion (expressed as a number between 0 and 1, not a percentage), n is the sample size, and z is the critical value from the standard normal distribution at the chosen confidence level. The classic values are z = 1.645 for 90%, z = 1.960 for 95%, and z = 2.576 for 99%. The resulting confidence interval is p ± MoE, clipped to the [0, 1] interval.

The mean mode uses the parallel formula:

MoE = z · ( s / √n )

where s is the sample standard deviation and is the sample mean. The interval is ± MoE. For samples smaller than 30, NIST/SEMATECH §1.3.3.1 recommends substituting the Student-t critical value t(α/2, df = n − 1) in place of z; the calculator offers this as an option.

The solve-for-n tab inverts the proportion formula:

n = ( z² · p · (1 − p) ) / MoE²

The result is then rounded up to the next whole respondent, because you cannot survey half a person. This is the same rearrangement that appears in Cochran's equation 4.4 and is the basis for the "1,067 respondents for a 3-point margin" rule of thumb that pollsters use.

Worked Examples

The five examples below were hand-verified against the formulas. They are the canonical test cases for the calculator.

Example 1, A small survey. A team surveys 100 customers and 50 say they would recommend the product. With the conservative 0.5 proportion and 95% confidence: MoE = 1.96 · √(0.5 · 0.5 / 100) = 1.96 · √0.0025 = 1.96 · 0.05 = 0.098. The 95% confidence interval is 0.50 ± 0.098, i.e. 40.2% to 59.8%. Even with 100 respondents, the answer is far from precise; this is why most consumer polls run to at least 400 respondents.

Example 2, A larger survey. A market-research firm surveys 400 people and finds 60% favourable to a brand. MoE = 1.96 · √(0.6 · 0.4 / 400) = 1.96 · √0.0006 = 1.96 · 0.024495 = 0.04801. The 95% confidence interval is 55.20% to 64.80%. Note that 0.6 · 0.4 is smaller than 0.5 · 0.5, so the margin is tighter than the worst-case 9.8% from Example 1 even though n is only 4× larger.

Example 3, A national poll. A newspaper surveys 1,600 likely voters and finds 50% supporting a candidate. MoE = 1.96 · √(0.5 · 0.5 / 1600) = 1.96 · 0.0125 = 0.0245. The 95% confidence interval is 47.55% to 52.45%. This is exactly the "plus or minus 2.45 points" you see cited in national polls, the n = 1,600 figure is not a coincidence, it is the value that produces a clean ±2.5-point MoE under the most conservative p = 0.5.

Example 4, A clinical measurement. A pilot study of 25 patients records a mean systolic blood pressure of 100 mmHg with sample SD 15. Using the mean-mode formula and 95% confidence: MoE = 1.96 · 15 / √25 = 1.96 · 3 = 5.88. The interval is 94.12 to 105.88 mmHg. If you tick "Use exact t" with n = 25, df = 24 and the t critical value is 2.064 in place of 1.96, which widens the MoE to 6.19 and the interval to 93.81 to 106.19 mmHg. The difference matters exactly for small samples.

Example 5, A high-confidence corporate estimate. A company wants a 99% confidence interval for the proportion of customers who churn, and is willing to accept a 4-point margin. With p = 0.5 (the worst case) and n = 1000: MoE = 2.576 · √(0.25 / 1000) = 2.576 · 0.015811 = 0.04073. The 99% confidence interval is 45.93% to 54.07%. Going from 95% to 99% confidence inflates the critical z by a factor of 2.576/1.96 ≈ 1.31, so the same n yields about 31% more margin at 99% confidence.

Where It Shows Up

Poll reporting. Every election cycle, networks and newspapers report "Candidate X leads 48% to 44%, with a margin of error of ±3 percentage points." Those numbers come directly from this calculator with the conservative p = 0.5 assumption and 95% confidence.

Clinical trials. The published results of a phase III trial usually report a mean treatment effect with a 95% confidence interval, e.g. "drug lowers blood pressure by 8.2 mmHg (95% CI: 5.9 to 10.5)." Those intervals are built from the mean-mode formula here, often with a t critical value for modest samples.

A/B testing. Product teams running conversion-rate experiments use the proportion formula to decide whether a 2.1% lift (from 4.0% to 6.1%) is real or just noise. A 95% CI that does not include zero is the standard significance test for an A/B read-out.

Manufacturing and quality control. Process engineers estimate the mean tensile strength of a batch using the mean-mode formula, then use the solve-for-n tab to plan a sampling plan that achieves a target tolerance.

Employee engagement surveys. Companies run quarterly pulse surveys and report "engagement is 71%, ±2 points." The 2-point figure comes from a known population size plugged into the same proportion formula with a finite-population correction.

Election polling methodology. Pew Research Center, Gallup, and the AAPOR Code of Professional Ethics all require reporting margin of error alongside any survey result. AAPOR's Transparency Initiative standard specifies the exact z values used here (1.645, 1.96, 2.576).

Common Mistakes

Forgetting the conservative p = 0.5 assumption. The variance p(1 − p) is maximised when p = 0.5, which gives the largest margin of error for a given n. When you have no prior estimate, you must assume p = 0.5, otherwise you will understate the margin and overstate your precision. This is the rule pollsters cite in their fine print.

Conflating standard deviation and standard error. The mean formula uses s / √n, not s. The sample standard deviation measures spread in the data; the standard error of the mean is the SD divided by √n and shrinks as you collect more samples. Mixing the two is one of the most common errors in introductory statistics.

Using z when the sample is small. For n < 30, the normal approximation is loose and the exact Student-t critical value should be used. The NIST/SEMATECH handbook flags this in its discussion of the one-sample t confidence interval. Our calculator's "Use exact t" checkbox implements this correction.

Forgetting to round up n. The solve-for-n formula gives a real number like 1067.1. You cannot survey 0.1 of a person, always round up to the next integer, which is 1068. This is a tiny difference but it matters when the formula comes out close to an integer.

Ignoring design effects. The formulas here assume a simple random sample. Stratified, clustered, or weighted samples inflate the variance by a "design effect" (DEFF), so the real margin of error is DEFF × √(p(1 − p) / n). If your survey uses weighting, multiply the result by √DEFF.

Reporting the margin alone. A bare "±3%" with no confidence level is ambiguous. The convention is to pair every margin with a level, "±3 percentage points at 95% confidence", so the reader knows what the interval means.

Frequently Asked Questions

What does "margin of error" actually mean?

The margin of error is half the width of a confidence interval at a stated confidence level. If a poll reports "52% ± 3%, 95% confidence," it means that if the pollster drew many random samples of the same size from the same population, about 95% of the resulting intervals would contain the true population proportion. The 3-point figure is the radius of the interval, not the width; the full interval is 49% to 55%.

Why is 95% the default confidence level?

Because of a historical accident. In the early 20th century, the statistician R. A. Fisher popularised the 5% significance level, and the corresponding 95% confidence level became the convention in scientific publishing. Modern reporting standards (Pew, AAPOR) preserve that default. You can absolutely use 90% or 99%, choose whichever matches the risk you are willing to take.

Is a larger sample always better?

Yes for precision, but with diminishing returns. Doubling the sample size cuts the margin of error by a factor of √2 ≈ 1.41. To halve the margin you must quadruple the sample. There is a point, usually around n = 1,000 to n = 2,500 for a proportion, at which additional respondents are not worth the cost. Use the solve-for-n tab to find that point for your target margin.

What is the difference between the proportion formula and the mean formula?

The proportion formula uses p(1 − p) as the variance, which assumes a Bernoulli (yes/no) outcome. The mean formula uses s² as the variance, which assumes a continuous measurement. They share the same shape, z times a standard error, but the standard error itself is computed differently. Pick the proportion mode for percentages and rates, the mean mode for measured quantities.

When should I use the exact t critical value?

When your sample is small (n < 30) and you are estimating a mean. The normal approximation to the t distribution is good within about 1% once n exceeds 30, but for n = 10 or n = 20 it can overstate your precision by 5 to 10%. The "Use exact t" checkbox in the calculator swaps in the proper Student-t critical value from the t distribution with n − 1 degrees of freedom.

How do pollsters get a 3% margin with only 1,067 respondents?

Plug into the solve-for-n formula with z = 1.96, p = 0.5, and MoE = 0.03: n = 1.96² · 0.5 · 0.5 / 0.03² = 3.8416 · 0.25 / 0.0009 = 0.9604 / 0.0009 = 1067.1. Round up to 1,068 respondents. Pew, Gallup, and most national polls quote "n ≈ 1,000" because that is roughly where the ±3-point / 95% threshold lives. Note that this is the conservative case; surveys of narrower populations (e.g. registered Republicans only) often need more respondents to reach the same margin.

Does this calculator handle finite populations?

Not directly. The formulas above assume the sample is a small fraction of a large population, so that sampling without replacement has negligible effect. If your population is small (n > 5% of N), apply the finite population correction: divide the variance by (1 − n/N). That is a one-line adjustment and is documented in the NIST/SEMATECH handbook §1.3.3.

Can I use this for non-normal data?

The proportion mode is exact for Bernoulli data, so it works for any yes/no question. The mean mode is exact for normally distributed data and approximate for non-normal data when n is large enough for the central limit theorem to kick in. As a rule of thumb, n ≥ 30 is usually sufficient for the mean mode; for very skewed distributions, consider a non-parametric bootstrap or a log conversion.

What is the relationship between margin of error and p-value?

The two come from the same z-distribution but answer different questions. A margin of error describes the precision of an estimate ("how big is the range?"). A p-value tests a specific hypothesis ("is this result distinguishable from chance?"). A 95% margin of error and a 5% significance level use the same z = 1.96 cutoff, but the margin describes an interval while the p-value describes a single number's tail probability.

Why do some polls quote a "design effect" instead of a raw margin?

Because real surveys use stratification, clustering, and weighting, all of which inflate variance above the simple-random-sample baseline. A design effect of 1.5 means the true variance is 1.5× the SRS variance, so the published margin is multiplied by √1.5 ≈ 1.22. The Pew Research Center methods page routinely reports DEFFs in the 1.2 to 1.8 range for its national polls.

References

  • Cochran, W. G. Sampling Techniques, 3rd ed. Wiley, 1977. The original derivation of the proportion margin formula and the sample-size rearrangement (Chapter 4).
  • NIST/SEMATECH. e-Handbook of Statistical Methods, §1.3.3 (Confidence Intervals for the Mean) and §7.2 (Sample Sizes for Proportions). The canonical reference for the z = 1.645 / 1.96 / 2.576 critical values and the t-distribution substitution for small samples.
  • Pew Research Center. Methodology, How Pew Research conducts its polling, including design effects, weighting, and the standard "±3.1 percentage points at 95% confidence" reporting convention.
  • American Association for Public Opinion Research (AAPOR). Code of Professional Ethics & Practices, 2023 edition. Establishes the obligation to report margin of error, confidence level, and design effect for every published survey result.
  • Isserlis, L. (1918). "On the use of certain approximate formulae for the standard deviation of the sampling distribution of the sample proportion." Biometrika. Historical note on the conservative p = 0.5 assumption still in use today.