Free tool · Sample size
Sample size calculator for comparing two proportions
Quick answer
To compare a yes/no outcome (e.g. complication rate, success rate) between two groups, enter the expected proportion in each group. For 40% vs 20%, with 95% confidence and 80% power, you need 82 per group, or 91 per group after allowing 10% drop-out.
How to choose p₁ and p₂
p₁ is usually the known rate with standard care, taken from a previous study or your hospital's records. p₂ is the rate you expect with the new intervention, or the rate in the exposed group. The difference between them is the effect you are powered to detect, so it must be realistic and referenced.
Worked example
Post-operative wound infection is 40% in a reference study; a new protocol is expected to reduce it to 20%. With 95% confidence and 80% power the formula gives 81.2, so 82 per group; with 10% loss to follow-up, 91 per group (182 in total).
Detecting a smaller improvement, say 40% to 30%, needs about four times as many participants. Small differences between proportions are expensive.
Tips for thesis studies
- Rare outcomes (under 5%) need very large samples; consider a composite or more common outcome.
- For case–control studies, the inputs are the proportion of exposure in cases and in controls.
- The analysis will usually be a chi-square or Fisher's exact test; see which test to use.
Frequently asked questions
Which formula does this calculator use?
The standard normal-approximation formula for two independent proportions (as in Fleiss): n = [Zα√(2p̄q̄) + Zβ√(p₁q₁ + p₂q₂)]² / (p₁ − p₂)², with p̄ the average of p₁ and p₂.
Does it work for case–control studies?
Yes, for unmatched case–control studies with equal numbers of cases and controls: enter the expected proportion exposed among cases and among controls. Matched designs need a different method.
My guide wants 90% power. How much bigger is the sample?
About a third bigger. Change Power to 90% above to see the exact number.
Written and reviewed by the Research Wing mentor team. Last updated 30 November 2026.