Margin of Error Calculator
Test cases replayed : 4 of 4 match · Methodology · No outside source listed
Enter the percentage found in your sample, the sample size and a confidence level to get the margin of error of a survey result.
Result
Margin of error (± percentage points)
Critical value (z)
- Lower bound
- Upper bound
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- Sample percentage (50 if unknown), in percent: enter a number from 0 to 100.
- Sample size: enter 1 or more.
- Confidence level: choose 90%, 95%, 98% or 99%.
- Population size (0 if very large): enter 0 or more.
- Read the result: Margin of error (± percentage points); the panel also shows Critical value (z), Lower bound and Upper bound.
How this calculator works
Margin of error of a sample proportion: E = z × √(p̂(1 − p̂) ÷ n), where p̂ is the sample proportion, n the sample size and z the critical value of the standard normal distribution for the chosen confidence level (1.96 for 95%).
For a sample drawn from a small population of size N, the finite population correction multiplies E by √((N − n) ÷ (N − 1)). The interval p̂ ± E is the Wald interval; it assumes a simple random sample and covers sampling error only, not non-response or question wording.
p̂ = 50% gives the largest margin, which is why it is used when the result is not yet known.
The formula
| Symbol | Meaning | Unit |
|---|---|---|
| Sample percentage (50 if unknown) | % | |
| Sample size | ||
| Confidence level | ||
| Population size (0 if very large) | ||
| Critical value | ||
| Margin of error (± percentage points) | % | |
norminv(p, m, s) | the value that a Gaussian variable with mean m and standard deviation s stays at or below with probability p (mean zero and standard deviation one without m and s). |
Worked example
| Sample percentage (50 if unknown) | 50% |
|---|---|
| Sample size | 1,000 |
| Confidence level | 95% |
| Population size (0 if very large) | 0 |
| Critical value (z) | 1.96 |
|---|---|
| Lower bound | 46.9% |
| Upper bound | 53.1% |
Margin of error (± percentage points) 3.1%
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
What is the margin of error for 1,000 people at 95% confidence?
With p̂ = 50%: 1.96 × √(0.25 ÷ 1,000) ≈ 3.1 percentage points.
How does sample size affect the margin of error?
The margin shrinks with the square root of n: four times as many respondents halve it, so 4,000 people give about ± 1.55 points.