Sample Size Calculator

Too small a sample produces inconclusive results; too large wastes time and money. Calculate the sample needed to estimate a proportion or mean within a margin of error, or to detect a real difference between two groups.

How it works

Calculate the sample size needed to estimate a proportion or mean within a margin of error, or to detect a difference between two proportions or two means with a chosen statistical power.

Proportion: n = z² × p(1 − p) ÷ E²;   Mean: n = (z × σ ÷ E)²
Finite population: n′ = n ÷ (1 + (n − 1) ÷ N)
Two proportions (per group): n = [z(α/2)√(2p̄q̄) + z(β)√(p₁q₁ + p₂q₂)]² ÷ (p₁ − p₂)²
Two means (per group): n = 2(z(α/2) + z(β))² σ² ÷ Δ²

Common uses

  • Survey and patient-experience studies
  • A/B tests for pricing, marketing and product changes
  • Research proposals and grant applications

Worked example

The calculator above opens with this example. Change any input to see the results update instantly, or select Reset to return to these figures.

Study typeSurvey: estimate a proportion
Confidence level95%
Margin of error (± percentage points)3%
Expected proportion50%
Example inputs
Required sample size1,068
z critical value1.96
Sample for half the margin4,269
Results

Plan for non-response: divide the required sample by the expected response rate to get the number to invite.

Interpreting the results

  • Use 50% as the expected proportion when you have no prior estimate; it produces the largest, safest sample.
  • 80% power is a common minimum; 90% is used when missing a real effect is costly.
  • Small differences are expensive to detect: halving the detectable difference roughly quadruples the sample.

Frequently asked questions

How many survey responses do I need?

For a large population, about 385 responses give a margin of error of ±5 percentage points at 95% confidence, and about 1,068 give ±3 points. Smaller populations need fewer responses after the finite population correction.

What is statistical power?

Power is the probability that a study detects a real effect of the specified size. With 80% power, there is a 20% chance of missing a true difference. Higher power requires a larger sample.

Why does a smaller difference need a much larger sample?

Required sample size grows with the inverse square of the difference you want to detect. Detecting a difference half as large requires roughly four times as many observations.

Browse all 13 Statistics & Forecasting calculators