Sample Size from Margin of Error Calculator

Sample Size from Margin of Error Calculator

Emerging AI Skill PRO

Enter Calculation

Formula

n=n01+n0−1Population,n0=z2·p^(1−p^)e2n = \dfrac{n_0}{1 + \dfrac{n_0 - 1}{\text{Population}}}, \qquad n_0 = \dfrac{z^2 \cdot \hat{p}\,(1 - \hat{p})}{e^2}
Usage stats

Advertisement

Results

Required Sample Size
385
respondents needed
Unadjusted size (infinite population) 385
z-score 1.96
Margin of error 5%
Assumed proportion 50%

Report an error on this page

What This Calculator Does

This calculator tells you how many people you need to survey to estimate a population proportion within a chosen margin of error at a given confidence level. It is widely used in market research, political polling, quality control, and academic surveys. The tool is jurisdiction-independent — it is pure statistics and applies anywhere.

How to Use It

Pick your confidence level (90%, 95%, or 99%), enter the margin of error you can tolerate (for example 5%), and provide an estimated proportion. If you have no prior estimate, use 50% — this is the most conservative value and yields the largest, safest sample. Optionally enter your total population size to apply the finite population correction, which reduces the required sample when the population is small.

Flat curve showing how required sample size rises steeply as target margin of error shrinks
Required sample size grows rapidly as the target margin of error gets smaller.

The Formula Explained

The core equation is $$n = \dfrac{z^2 \cdot p(1 - p)}{E^2}.$$ Here \(z\) is the standard normal critical value for your confidence level (1.645 for 90%, 1.96 for 95%, 2.576 for 99%), \(p\) is the expected proportion expressed as a decimal, and \(E\) is the margin of error as a decimal. The term \(p(1 - p)\) is largest at \(p = 0.5\), which is why 50% gives the maximum sample size. When a finite population \(N\) is supplied, the result is scaled down by the correction factor $$n = \dfrac{n_0}{1 + \dfrac{n_0 - 1}{N}}.$$

Advertisement

Worked Example

Suppose you want 95% confidence (\(z = 1.96\)), a 5% margin of error (\(E = 0.05\)), and you assume \(p = 0.5\). Then $$n = \dfrac{1.96^2 \times 0.5 \times 0.5}{0.05^2} = \dfrac{3.8416 \times 0.25}{0.0025} = \dfrac{0.9604}{0.0025} = 384.16,$$ which rounds up to 385 respondents.

Diagram showing how margin of error E forms a symmetric band around a sample proportion p on a number line
The margin of error E defines a symmetric interval around the estimated proportion p.

Z-Score Critical Values by Confidence Level

Two-sided confidence level Critical value z
80% 1.282
85% 1.440
90% 1.645
95% 1.960
98% 2.326
99% 2.576
99.9% 3.291

These are standard normal quantiles at probability \(1 - \alpha/2\), where \(\alpha = 1 - \text{confidence level}\). For 95% confidence, \(\alpha = 0.05\), so z is the 97.5th percentile of the standard normal distribution, about 1.960.

Advertisement

Interpreting the Required Sample Size

  • What the margin of error covers: the formula assumes a simple random sample and estimates a single proportion at the stated confidence level. It reflects random sampling error only. It does not account for nonresponse, coverage problems, or sampling bias, so the number is the count of completed, usable responses you need, not invitations sent. If you expect a 20% response rate, you must invite far more people than n.
  • What 95% confidence means: if you repeated the survey many times and built an interval each time with this method, about 95% of those intervals would contain the true population proportion. It does not mean there is a 95% probability that the true value lies in one specific computed interval.
  • Diminishing returns: n grows with \(1/E^2\), so tightening the margin gets expensive quickly. Going from 5% to 3% at 95% confidence raises n from 385 to 1,068, while going from 10% to 5% only adds about 288 responses.
  • Choice of p: \(\hat{p} = 0.5\) maximizes \(\hat{p}(1-\hat{p})\) and gives the largest, safest n. Use a different value only if you have a reliable prior estimate.
  • Finite population correction: the adjustment \(n = \dfrac{n_0}{1 + \dfrac{n_0 - 1}{N}}\) matters mainly when \(n_0\) exceeds about 5% of the population size N. For large populations it changes almost nothing; for small ones it can reduce the required sample noticeably.
  • Subgroups: the margin of error applies to the whole sample. Results for subgroups (for example, by age or region) have larger margins unless each subgroup has its own adequate sample size.

FAQ

What proportion should I use if I have no estimate? Use 50% — it maximizes the required sample and guarantees your margin of error will be met.

Why round up? Sample size must be a whole number, and rounding up ensures the margin of error is not exceeded.

When does population size matter? The finite population correction only meaningfully reduces the sample when your population is small relative to \(n_0\) (e.g. a few thousand or fewer).

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators