CompoundPage

Sample Size Calculator

Set a margin of error and a confidence level, and this sample size calculator says how many responses a survey needs, corrected for a small population. For an experiment, it sizes each group from the power and alpha.

For a comparison, alpha is 1 minus this: the false-positive rate you accept.

%Survey only: plus or minus this many percentage points.

%Survey only. Leave it at 50% if you have no estimate: that is the largest, safest answer.

Survey only. 0 for a large or unknown population; enter the total to apply the finite population correction.

Comparisons only: the chance of detecting the difference if it is real. 80% is the usual default.

Comparisons only. Two-sided unless a difference in one direction is all that could change the decision.

%Two proportions: the baseline rate.

%Two proportions: the smallest different rate worth detecting.

Two means: the SD of the outcome in each group, from a pilot or past data.

Two means: the smallest difference worth detecting, in the outcome's units.

Sample size385

Sample size needed z² × p(1 - p) / e² = 1.96² × 0.5 × 0.5 / 0.05² = 384.146, rounded up. Completed responses, not invitations.
385
Formula The normal approximation for estimating a proportion. Enter a population size to apply the finite population correction.
z² p(1 - p) / e²
Critical value The z with 95% of the standard normal between -z and z.
z = 1.96
Margin of error with 385 What the rounded-up sample achieves at the expected proportion. At or just inside the target, because the sample was rounded up.
± 4.994 points
Quadruple it to halve the margin The margin of error shrinks with the square root of the sample size.
± 2.5 points needs 1,537
Sample size at 95% confidence and an expected proportion of 50%, by margin of error and population size
Margin of errorN = 1,000N = 10,000N = 100,000Large population
± 1%9064,9008,7639,604
± 2%7071,9372,3452,401
± 3%5179651,0561,068
± 4%376567597601
± 5%278370383385
± 10%88969697
  • The formula counts completed responses from a random sample. A larger sample does not fix non-response or a biased list: if the people who answer differ from those who do not, more of them only measures the bias more precisely.
  • Reporting results for subgroups? Each subgroup needs its own sample of this size for the same margin of error.

How the Sample Size Calculator works

A survey's sample size comes from three choices: the margin of error, the confidence level and a guess at the answer. The formula 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, z is 1.96. For a ±5% margin and p = 50% that is 1.96² × 0.5 × 0.5 / 0.05² = 384.15, rounded up to 385. That is where the familiar 385 comes from.

The expected proportion matters because p(1 - p) is largest at 50%. If you have no estimate, 50% gives the biggest and safest sample. If a past survey says the answer is near 20%, the same margin needs only 246.

The margin of error shrinks with the square root of the sample. A ±3% margin takes 1,068 responses and ±2.5% takes 1,537, four times the sample for half the margin of ±5%.

The finite population correction, n0 / (1 + (n0 - 1) / N), scales the answer down when the sample would be a noticeable share of the population. For a population of 10,000 the 385 becomes 370; for 1,000 it becomes 278. For a population of a million it is 384, one fewer than for an unlimited population, which is why a national poll needs about the same sample as a city one.

Comparing two groups adds power. Alpha is the false-positive rate you accept (0.05 at 95% confidence) and power is the chance of detecting a difference that is really there, usually 80%. For two proportions the formula is n = [z_a √(2p̄q̄) + z_b √(p1q1 + p2q2)]² / (p1 - p2)² per group, where z_a is 1.96 for a two-sided 0.05, z_b is 0.8416 for 80% power and p̄ is the average of the two rates. Detecting a rise from 10% to 15% takes 686 per group, 1,372 in all. The A/B test calculator uses the same formula for website experiments and also reads the result once the test is done.

For two means it is n = 2(z_a + z_b)² σ² / Δ² per group. With an SD of 10 and a difference of 5 worth detecting (an effect size of 0.5), that is 63 per group at 80% power and 85 at 90%.

These are normal approximations, and they assume a random sample and independent observations. They size the sample you analyze, so plan for drop-outs and non-response on top.

Sample Size Calculator FAQ

Why do so many surveys use a sample of 385?

It is the answer for a ±5% margin of error at 95% confidence with an expected proportion of 50%: 1.96² × 0.25 / 0.05² = 384.15, rounded up. It applies to any large population, which is why it turns up everywhere.

What is the finite population correction?

An adjustment for sampling a large share of a small population: n = n0 / (1 + (n0 - 1) / N). For a population of 1,000, the 385 drops to 278. For populations in the hundreds of thousands it changes almost nothing.

Does a bigger population need a bigger sample?

Barely. At ±5% and 95% confidence, a population of 10,000 needs 370 and a population of a million needs 384. Precision depends on the size of the sample; the share of the population it covers hardly enters.

What power should I use?

80% is the usual convention. Raising it to 90% costs about a third more sample: for two means with an effect size of 0.5, it goes from 63 to 85 per group.

What if I don't know the expected proportion?

Use 50%. The variance p(1 - p) is largest there, so the sample size is the largest it can be, and the margin of error you get will be at least as good as the one you asked for.

Related calculators

Embed this calculator
<div id="compoundpage-sample-size-calculator"></div>
<script src="https://compoundpage.com/embed/sample-size-calculator.js" async></script>

The same calculation as JSON