Ad Space — Top Banner

Sample Size Formula

Formula for calculating the minimum sample size needed for surveys and research studies at a given confidence level and margin of error.

Need to calculate, not just reference? Use the interactive version. Open Sample Size Calculator →

The Formula (Infinite Population)

n = (z² × p × (1 - p)) / e²

With Finite Population Correction

n_adj = n / (1 + (n - 1) / N)

Variables

SymbolMeaning
nRequired sample size
zZ-score for desired confidence level
pExpected proportion (use 0.5 if unknown)
eMargin of error (as a decimal)
NTotal population size
n_adjAdjusted sample size for finite population

Z-Values for Common Confidence Levels

Confidence LevelZ-Value
80%1.282
85%1.440
90%1.645
95%1.960
99%2.576

Quick Reference

Margin of Error95% Confidence99% Confidence
±1%9,60416,590
±3%1,0681,844
±5%385664
±10%97166

Example

How many people should you survey for ±5% margin at 95% confidence?

z = 1.960, e = 0.05, p = 0.5 (unknown proportion)

n = (1.96² × 0.5 × 0.5) / 0.05²

n = (3.8416 × 0.25) / 0.0025

n = 0.9604 / 0.0025 = 385 responses needed

Common Mistakes

  • Using p = 0 or p = 1 when the true proportion is unknown — always default to p = 0.5, which maximizes (and thus gives the safest) required sample size
  • Skipping the finite population correction for small populations — when N < 10,000, the adjusted n_adj is meaningfully smaller than the infinite-population n
  • Confusing margin of error with confidence level — they are independent: you can have a ±3% margin at either 90% or 99% confidence; more confidence simply requires a larger sample

Key Notes

  • Formula for means: n = (z × σ / E)²: z is the z-score for the desired confidence level (1.96 for 95%), σ is the population standard deviation, and E is the maximum acceptable margin of error. If σ is unknown, use a pilot study or a conservative estimate.
  • Formula for proportions: n = z²p(1−p)/E²: When the population proportion p is unknown, use p = 0.5 — it maximizes n and gives the most conservative (largest) sample size requirement. Any other p value gives a smaller required n.
  • Quadrupling for precision: Sample size scales as 1/E² — to halve the margin of error, you need four times the sample size. Cutting E from 5% to 2.5% requires 4× more respondents. This is why polling precision is expensive.
  • Finite population correction: n_adj = n / (1 + n/N): When the sample is more than 5% of the population N, the standard formula overcounts — the correction factor reduces the required sample size. For very small populations, even a small sample covers a large fraction.
  • Applications: Sample size formulas are used to design clinical trials (ensuring statistical power), opinion polls, quality control sampling plans, A/B tests, and any study where the cost of data collection must be balanced against the precision needed.

Ad Space — Bottom Banner

Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.