Sample size for comparing two groups (proportions and means)
Last reviewed 16 October 2026
A two-group comparison needs enough participants to detect the smallest difference that matters, at the error rates you choose. Four inputs decide the answer: the size of the difference, how variable the outcome is, the significance level and the power.
Open the sample size calculatorTwo proportions
Suppose infection falls from 30% with standard care to 20% with the intervention. With a two-sided significance level of 0.05, 80% power and equal groups you need 294 per arm, 588 in total. At 90% power the figure rises to 392 per arm, 784 in total.
Two means
For a continuous outcome you also need the standard deviation. With a standard deviation of 15 mmHg and a smallest important difference of 5 mmHg, 80% power needs 142 per arm (284 in total) and 90% power needs 190 per arm (380 in total).
Why the difference matters most
Sample size grows with the inverse square of the difference. Halving the difference you want to detect roughly quadruples the sample. Moving the same trial from 30% versus 20% to 30% versus 25% raises the total from 588 to 2,502.
Choose the difference carefully
Use the smallest difference that would change practice, not the difference you hope to see. Reviewers challenge optimistic differences, because they produce small trials that miss real, smaller effects.
Then adjust
Inflate for dropout by dividing by the proportion you expect to retain, and for cluster designs multiply by the design effect. Report both adjustments separately so a reviewer can follow them.
Common questions
- What power and significance level should I use?
- A two-sided significance level of 0.05 and at least 80% power is the usual minimum. Definitive trials often use 90%.
- How do I choose the standard deviation?
- Take it from a similar earlier study or a pilot, and say where it came from. If it is uncertain, show how the sample changes with a larger value.
- Should groups be equal in size?
- Equal groups need the fewest participants in total. Unequal allocation, for example 2 to 1, can be justified when one arm is much cheaper or more informative, at the price of a larger total.
Keep reading
General methods guidance, not a substitute for advice from a statistician on your specific study.