Sample Size for Comparing Two Proportions
How many people you need in each group to detect a difference between two rates.
Results
The dashed line marks the value you entered.
What this tool does
This is the question behind every A/B test and every two-arm trial: if one group converts at 50 % and you hope the other converts at 60 %, how many people do you need before that gap means anything? The answer is driven by the size of the gap far more than by the rates themselves — halving the difference you want to detect roughly quadruples the sample you need, which is why small improvements are so expensive to prove. The tool works it out twice, by the ordinary normal approximation and by Cohen's arcsine route, and the two should land within a percent or two of each other. If they do not, something in the numbers is unusual and worth a second look.
Formula
n per group = (z for confidence + z for power)² × [p₁(1−p₁) + p₂(1−p₂)] ÷ (p₁ − p₂)²
Variables
| Symbol | Meaning | Unit |
|---|---|---|
p1 | Share in the first group | % |
p2 | Share in the second group | % |
za | How sure you want to be | — |
zb | Chance of catching a real difference | — |
N | People needed in each group | — |
T | People needed in total | — |
H | Effect size (Cohen's h) | — |
A | Same thing by the arcsine route | — |
D | Difference | pp |
Worked example
- Share in the first group50 %
- Share in the second group60 %
- How sure you want to be1.959963984540054
- Chance of catching a real difference0.8416212335729143
- People needed in each group385
- People needed in total770
- Effect size (Cohen's h)0.2014
- Same thing by the arcsine route388
- Difference10.00 pp
Limitations
- The result is an estimate based only on the values you type. Real situations often include factors this calculator does not know about.
- Standard deviation and variance are calculated for a sample (dividing by n − 1). For a full population, divide by n instead.
- The calculation runs at full precision and only the display is rounded. If you copy an intermediate value and retype it, small differences can appear.