How to Calculate Sample Size

Determining the right sample size is one of the most important steps in research and statistics. Too small a sample gives unreliable results; too large wastes resources. The ideal sample size depends on your desired confidence level, margin of error, and population size.

The Formula (Unknown Population Size)

n = (Z² × p × (1 − p)) / e²

Where:

  • n = required sample size
  • Z = Z-score for your confidence level
  • p = estimated proportion (use 0.5 if unknown, for maximum sample size)
  • e = margin of error (as a decimal)

Common Z-Scores

Confidence LevelZ-Score
90%1.645
95%1.960
99%2.576

Step-by-Step Example

You want 95% confidence with a ±5% margin of error, and don't know the expected proportion.

  1. Z = 1.96 (for 95% confidence)
  2. p = 0.5 (conservative estimate)
  3. e = 0.05

n = (1.96² × 0.5 × 0.5) / 0.05² n = (3.8416 × 0.25) / 0.0025 n = 0.9604 / 0.0025 n = 384.16 → round up to 385

Adjusting for Finite Population

If your population is small (N < 10,000), use the finite population correction:

n_adjusted = n / (1 + (n − 1)/N)

Practical Considerations

  • A 95% confidence level with ±5% margin of error is the standard for most surveys
  • Increasing confidence to 99% or reducing error to ±3% significantly increases sample size
  • Increase sample by 10–20% to account for non-responses or dropouts

Use our sample size calculator to determine the right n for your study.