home / Math / sample size calculator

Sample Size Calculator

The Sample Size Calculator is a free online tool for survey design. It works out how many responses you need for a chosen margin of error and confidence level, and shows why polling a country accurately takes about the same number of people as polling a city.

Modify the values and click the Calculate button to use.

%
%
people

Related: Confidence Interval Calculator | Z-score Calculator | Statistics Calculator

How Many People You Actually Need

The required sample for estimating a proportion is:

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

where z is the critical value for the confidence level, p is the expected proportion and e is the margin of error. At 95% confidence, ±3% and an unknown proportion, that gives 1,067 — which is why national polls cluster around a thousand respondents.

Sample Size Chart

Margin of error90% confidence95% confidence99% confidence
±1%6,7659,60416,587
±2%1,6922,4014,147
±3%7521,0681,843
±5%271385664
±10%6897166

Assuming a 50% expected proportion and a very large population. Halving the margin of error quadruples the sample, because e is squared in the denominator.

Population Size Barely Matters

The most counterintuitive result in survey statistics: polling a city of 100,000 and a country of 300 million to the same precision requires almost the same sample. The finite population correction only bites when the sample is a large fraction of the population — above roughly 5%.

PopulationSample for ±5% at 95%
500218
1,000278
10,000370
100,000383
10,000,000385

Why 50% Is the Default

The term p(1−p) is maximised at p = 0.5, so assuming 50% gives the largest — and therefore safest — required sample. If prior work suggests the answer is near 10% or 90%, the required sample drops by nearly two-thirds.

The Response Rate Problem

These figures are completed responses, not invitations. At a 30% response rate, needing 385 completions means inviting about 1,300 people. Worse, low response rates introduce non-response bias — those who answer differ systematically from those who do not — and no sample size fixes that.

Frequently Asked Questions

Is a bigger sample always better?

Statistically yes, practically no. Beyond a point, extra respondents buy very little precision at substantial cost, and sampling quality matters far more than sampling quantity. A biased sample of 10,000 is worse than a representative sample of 500.

What about comparing subgroups?

Each subgroup needs its own adequate sample. A poll of 1,000 that reports on a subgroup of 80 respondents carries a margin of error above ±11% for that subgroup.

Does this apply to A/B testing?

Partly. A/B tests are about detecting a difference rather than estimating a value, so sample size there is driven by statistical power and the smallest effect worth detecting.