Quick answer
The margin of error is ME = z* × σ ÷ √n for a mean, or z* × √(p(1 − p) ÷ n) for a proportion. With σ = 15, n = 100 and 95% confidence, ME = 1.96 × 1.5 = 2.94.
Choose mean or proportion, then enter the confidence level, σ or p and the sample size. The calculator returns the margin of error and the critical value.
Related tools: Standard Error Calculator: Standard error of a mean or a proportion. Sample Size Calculator: Sample size for estimating a mean or a proportion. Confidence Interval Calculator: Confidence interval for a mean (t or z).
How to use the Margin of Error Calculator
- Choose for a: Mean (σ known) and Proportion.
- Enter confidence level (%) (between 0 and 99.999). It starts at 95.
- Enter σ (mean) or proportion p (0–1) (above 0).
- Enter sample size (a whole number, 1 or more).
- Press Calculate to see the result, and use Reset to start again.
| Input | What to enter | Allowed values |
|---|---|---|
| For a | Choose one: Mean (σ known); Proportion | Starts at Mean (σ known) |
| Confidence level | A number, in % | > 0, ≤ 99.999, starts at 95 |
| σ (mean) or proportion p (0–1) | A number | > 0 |
| Sample size | A whole number | ≥ 1 |
Formula and method
Formula
ME = z* × σ ÷ √n; ME = z* × √(p(1 − p) ÷ n)
IEEE-754 double precision; shown to at most 6 decimal places.
z* is the exact normal quantile for the confidence level.
Worked examples
These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.
Example 1
Inputs: For a = Mean (σ known); Confidence level = 95; σ (mean) or proportion p (0–1) = 15; Sample size = 100.
| Result | Value |
|---|---|
| Margin of error | 2.939946 |
| Critical value z* | 1.959964 |
Example 2
Inputs: For a = Proportion; Confidence level = 95; σ (mean) or proportion p (0–1) = 0.5; Sample size = 400.
| Result | Value |
|---|---|
| Margin of error | 0.048999 |
The first line is the headline result (margin of error). Below it the margin of Error Calculator lists critical value z*, which describe the same case from other angles. IEEE-754 double precision; shown to at most 6 decimal places.
Polls
For a poll with p = 0.5 and n = 1,000 at 95%, ME = 1.96 × √(0.25 ÷ 1,000) = 3.1 points. Quadrupling the sample halves the margin.
What it covers
Margin of error captures sampling variability only, not bias from poor question wording or non-response. The proportion must be below 1. Use the Sample Size calculator to plan a survey.
How the result changes with σ or proportion p
Holding every other input at the first worked example, this table changes only σ or proportion p. It shows how sensitive the answer is to that one value; each row was produced by running this calculator.
| σ or proportion p | Margin of error | Critical value z* |
|---|---|---|
| 7.5 | 1.469973 | 1.959964 |
| 15 | 2.939946 | 1.959964 |
| 30 | 5.879892 | 1.959964 |
| 60 | 11.759784 | 1.959964 |
What happens with invalid input
These messages are produced by the calculator itself, so you know what to fix.
- σ (mean) or proportion p (0–1): entering "2" shows "A proportion must be between 0 and 1." beside that field and no result.
Choosing between the Margin of Error Calculator and similar calculators
Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.
| Calculator | You enter | It returns |
|---|---|---|
| [Standard Error Calculator](/statistics/standard-error-calculator/) | statistic, standard deviation or proportion p and sample size | Standard error |
| [Sample Size Calculator](/statistics/sample-size-calculator/) | estimate a, confidence level and margin of error | Required sample size |
| [Confidence Interval Calculator](/statistics/confidence-interval-calculator/) | sample mean, standard deviation and sample size | Confidence interval |
| [Point Estimate Calculator](/statistics/point-estimate/) | successes and trials | Sample proportion |
| [Odds Ratio Calculator](/statistics/odds-ratio-calculator/) | exposed with outcome, exposed without outcome and unexposed with outcome | Odds ratio |
Background: hypothesis testing and inference
A hypothesis test compares a test statistic with what the null hypothesis predicts. The decision rule is to reject the null hypothesis when the p-value is at or below the significance level α, which you should choose before seeing the data (0.05 is conventional, not special). For a two-tailed z test the p-value is 2 × (1 − Φ(|z|)); for a one-sample t test the statistic is (x̄ − μ₀) ÷ (s ÷ √n) with n − 1 degrees of freedom.
Failing to reject the null hypothesis does not prove it true, and a statistically significant result can still be too small to matter in practice.
Assumptions and limitations
- Proportion below 1
If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for σ (mean) or proportion p (0–1) to confirm this.
Frequently asked questions
What is z* for 95%?
For 95% confidence the critical value z* is 1.96.
Why does n matter?
ME falls with the square root of n.
What p is worst case?
p = 0.5 gives the largest margin of error, because p(1 − p) is greatest there; use it when you have no prior estimate.
What does the Margin of Error Calculator calculate?
Margin of error for a mean or a proportion. It returns Margin of error and Critical value z*.
What formula does the Margin of Error Calculator use?
ME = z* × σ ÷ √n; ME = z* × √(p(1 − p) ÷ n). z* is the exact normal quantile for the confidence level.
What do I need to enter in the margin of Error Calculator?
You enter For a, Confidence level (%), σ (mean) or proportion p (0–1) and Sample size.
How is the result rounded or limited?
IEEE-754 double precision; shown to at most 6 decimal places. Proportion below 1.
What does the “For a” option change?
It sets how the margin of Error is worked out. The choices are Mean (σ known) and Proportion.
What is an example of a margin of Error result?
With for a Mean (σ known), confidence level 95, σ (mean) or proportion p (0–1) 15 and sample size 100, the margin of error is 2.939946.
Related calculators
- Standard Error Calculator — Standard error of a mean or a proportion.
- Sample Size Calculator — Sample size for estimating a mean or a proportion.
- Confidence Interval Calculator — Confidence interval for a mean (t or z).
- Point Estimate Calculator — Point estimates of a proportion (MLE, Laplace and Wilson).
- Odds Ratio Calculator — Odds ratio from a 2×2 table.
- Relative Risk Calculator — Relative risk from a 2×2 table.
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods (itl.nist.gov/div898/handbook)
- Standard textbook definitions (e.g. Moore, McCabe & Craig, Introduction to the Practice of Statistics)
Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.