How to Work Out Sample Size

How many people or items do you need? Too few and your results are too vague to be useful, or you miss a real effect. Too many and you waste time and money. The answer depends on what you want to learn and how precisely.

For a survey: estimating a percentage

You need three things:

  1. Margin of error. How close to the truth do you need to be? ±5 percentage points is common for general surveys.
  2. Confidence level. Usually 95%.
  3. A guess at the percentage. If you have no idea, use 50%. It gives the largest sample size, so you are covered whatever the real answer is.

n = z² × p(1 − p) ÷ E² = 1.96² × 0.5 × 0.5 ÷ 0.05² = 384.2, so 385

Try it in the sample size calculator

Margin of errorConfidenceExpected %Sample size
±5%95%50%385
±3%95%50%1,068
±5%99%50%664
±5%95%20%246

Going from ±5% to ±3% nearly triples the sample. That is why most national polls stop at around 1,000 people.

Population size barely matters once it is large. A sample of 385 gives ±5% whether the population is 20,000 or 20 million. It only starts to matter when your sample would be a sizeable share of the population, say more than 5%. The calculator applies the finite population correction if you enter a population size.

For comparing groups: power analysis

If you are testing whether two groups differ, the question changes to: how many do I need to have a good chance of detecting a real difference? You need:

  • The smallest effect worth detecting, often as Cohen’s d (difference in means ÷ SD). Rough guides: 0.2 small, 0.5 medium, 0.8 large.
  • α, usually 0.05.
  • Power, the chance of detecting the effect if it is real. 80% is the usual target.

For a two-group t-test with d = 0.5, α = 0.05 and 80% power, you need 64 per group. For a small effect, d = 0.2, you need 394 per group. Small effects need big studies.

Run this power analysis

The power analysis calculator also covers paired tests, ANOVA, two proportions, correlations and chi-square tests.

Where do I get the numbers from?

The effect size and expected percentage are guesses, and that’s fine. Good sources: earlier studies on the same topic, a small pilot study, or the smallest effect that would change a decision. If a new teaching method must raise scores by at least 5 points to be worth the cost, and scores have an SD of 10, plan for d = 0.5.

What about Slovin’s formula?

Slovin’s formula, n = N ÷ (1 + Ne²), is common in some textbooks and theses. It gives nearly the same answer as the 50% survey calculation with a population correction, but with z rounded to 2, so about 95% confidence. For a large population it gives 400 where the standard method gives 385. It has no way to account for a different confidence level or an expected proportion other than 50%, and it doesn’t apply to comparing groups. The Slovin’s formula calculator is there if your course requires it, but the standard method above is more flexible.

Plan for people dropping out

The calculated number is how many you need to analyse, not how many to recruit. If you expect 20% not to respond or to drop out, divide by 0.8: 385 ÷ 0.8 = 482 invitations.

Check yourself

You need ±4% at 95% confidence with no idea of the percentage. How many?

1.96² × 0.25 ÷ 0.04² = 600.25, so 601.

A study with 20 per group found no significant difference. The researchers expected a medium effect (d = 0.5). Was the study well designed?

No. With 20 per group and d = 0.5, power is only about 34%, so the study was more likely to miss the effect than find it.