Margin of Error Calculator

Compute the margin of error for a mean or a proportion, with critical values and every step shown
Margin of error for p-hat = 0.52, n = 1000 at 95% confidence
Margin of error for a mean with sigma = 12, n = 64, 95% confidence
Margin of error for a mean with s = 8, n = 25, 99% confidence
Sample size needed for a 3% margin of error at 95% confidence

The Margin of Error Formula

The margin of error EE is the half-width of a confidence interval โ€” how far a sample estimate can plausibly sit from the true population parameter.

Mean, population ฯƒ\sigma known:

E=zโˆ—โ‹…ฯƒnE = z^* \cdot \frac{\sigma}{\sqrt{n}}

Mean, ฯƒ\sigma unknown (the usual case):

E=tnโˆ’1โˆ—โ‹…snE = t^*_{n-1} \cdot \frac{s}{\sqrt{n}}

Proportion:

E=zโˆ—p^(1โˆ’p^)nE = z^* \sqrt{\frac{\hat{p}(1 - \hat{p})}{n}}

Symbols: nn is the sample size, ฯƒ\sigma the population standard deviation, ss the sample standard deviation, p^\hat{p} the sample proportion, and zโˆ—z^* or tโˆ—t^* the critical value for the chosen confidence level.

The interval is then estimateยฑE\text{estimate} \pm E. Because EE shrinks like 1/n1/\sqrt{n}, quadrupling the sample only halves the margin of error.

Critical Values, Standard Error, and Sample Size

Critical values

Confidencezโˆ—z^*
90%1.6451.645
95%1.961.96
99%2.5762.576

Use zโˆ—z^* when ฯƒ\sigma is known; use tโˆ—t^* with df=nโˆ’1df = n - 1 whenever you estimate the spread from the sample with ss. At 99% confidence with n=25n = 25, t24โˆ—=2.797t^*_{24} = 2.797 โ€” noticeably wider than zโˆ—=2.576z^* = 2.576, which is exactly the penalty for not knowing ฯƒ\sigma.

Standard error vs margin of error

The standard error is ฯƒ/n\sigma/\sqrt{n} (or p^(1โˆ’p^)/n\sqrt{\hat{p}(1-\hat{p})/n}). The margin of error is that standard error multiplied by the critical value. They are different numbers, and only the second one carries a confidence level.

Sample size for a target margin

Solve for nn:

n=(zโˆ—ฯƒE)2n=p^(1โˆ’p^)(zโˆ—E)2n = \left(\frac{z^*\sigma}{E}\right)^2 \qquad\qquad n = \hat{p}(1-\hat{p})\left(\frac{z^*}{E}\right)^2

With no prior estimate of p^\hat{p}, use 0.50.5 โ€” it maximises p^(1โˆ’p^)\hat{p}(1-\hat{p}) and so is the safe choice. Always round nn up.

Conditions and Common Mistakes

These formulas are valid only when:

  • Random sampling: the data come from a simple random sample or a randomised experiment. Margin of error quantifies sampling variability only โ€” it says nothing about bias from non-response, bad question wording, or a self-selected panel.
  • Independence: observations are independent. When sampling without replacement, keep nโ‰ค10%n \le 10\% of the population.
  • Approximate normality: for a mean, either the population is roughly normal or nโ‰ฅ30n \ge 30 so the Central Limit Theorem applies. For a proportion, check np^โ‰ฅ10n\hat{p} \ge 10 and n(1โˆ’p^)โ‰ฅ10n(1-\hat{p}) \ge 10.

Frequent errors

  • Using zโˆ—z^* when ฯƒ\sigma is unknown and nn is small โ€” that understates EE; use tโˆ—t^*.
  • Dividing by nn instead of n\sqrt{n}.
  • Grabbing the one-tailed critical value: a two-sided 95% interval uses 1.961.96, not 1.6451.645.
  • Assuming a larger population demands a larger sample. Population size is almost irrelevant; nn is what drives EE.

Examples

Step 1: Check conditions: np^=520โ‰ฅ10n\hat{p} = 520 \ge 10 and n(1โˆ’p^)=480โ‰ฅ10n(1-\hat{p}) = 480 \ge 10 โœ“
Step 2: Standard error: 0.52ร—0.481000=0.0002496=0.01580\sqrt{\dfrac{0.52 \times 0.48}{1000}} = \sqrt{0.0002496} = 0.01580
Step 3: Critical value for 95%: zโˆ—=1.96z^* = 1.96
Step 4: E=1.96ร—0.01580=0.03097E = 1.96 \times 0.01580 = 0.03097
Step 5: Interval: 0.52ยฑ0.031=(0.489,ย 0.551)0.52 \pm 0.031 = (0.489,\ 0.551)
Answer: Eโ‰ˆ0.031E \approx 0.031, i.e. about ยฑ3.1\pm 3.1 percentage points

Step 1: ฯƒ\sigma is unknown, so use tโˆ—t^* with df=nโˆ’1=24df = n - 1 = 24
Step 2: For 99% two-sided, t24โˆ—=2.797t^*_{24} = 2.797
Step 3: Standard error: s/n=8/25=8/5=1.6s/\sqrt{n} = 8/\sqrt{25} = 8/5 = 1.6
Step 4: E=2.797ร—1.6=4.4752E = 2.797 \times 1.6 = 4.4752
Answer: Eโ‰ˆ4.48E \approx 4.48

Step 1: No prior estimate, so take the conservative p^=0.5\hat{p} = 0.5, giving p^(1โˆ’p^)=0.25\hat{p}(1-\hat{p}) = 0.25
Step 2: n=0.25(1.960.03)2n = 0.25 \left(\dfrac{1.96}{0.03}\right)^2
Step 3: 1.96/0.03=65.33โ€พ1.96/0.03 = 65.3\overline{3}, and 65.33โ€พ2=4268.4465.3\overline{3}^2 = 4268.44
Step 4: n=0.25ร—4268.44=1067.11n = 0.25 \times 4268.44 = 1067.11
Step 5: Round up โ€” a fractional respondent is not available
Answer: n=1068n = 1068

Frequently Asked Questions

The standard error measures how much a sample estimate varies from sample to sample. The margin of error is the standard error multiplied by a critical value (z* or t*), which attaches a confidence level to it. For a 95% interval the margin of error is roughly twice the standard error.

Use t* with df = n โˆ’ 1 whenever you estimate the spread from the sample standard deviation s, which is nearly always the case with real data. Use z* only when the population ฯƒ is genuinely known. For n โ‰ฅ 30 the two critical values are close, but t* is never wrong.

There is no universal threshold โ€” it depends on the decision. National opinion polls typically report ยฑ3%, market research often accepts ยฑ5%, and clinical work may demand ยฑ1% or better. Pick the largest error you could tolerate and still act the same way, then solve for the sample size that delivers it.

Essentially no. The formula depends on n, not on population size, so a sample of 1000 gives roughly ยฑ3% whether the population is 100,000 or 300 million. A finite-population correction matters only when your sample exceeds about 10% of the population.

Related Solvers

Related Guides

Try AI-Math for Free

Get step-by-step solutions to any math problem. Upload a photo or type your question.

Start Solving