Paritian

Statistics

Sample Size for Comparing Two Proportions

How many people you need in each group to detect a difference between two rates.

Results

People needed in each group 385
People needed in total 770
Effect size (Cohen's h) 0.2014
Same thing by the arcsine route 388
Difference 10.00 pp
How it changes
People needed in each groupShare in the second group 25 – 75. People needed in each group: 55 → 55People needed in each group0500010,00015,00020,0003040506070Share in the second group (%)

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

SymbolMeaningUnit
p1Share in the first group%
p2Share in the second group%
zaHow sure you want to be
zbChance of catching a real difference
NPeople needed in each group
TPeople needed in total
HEffect size (Cohen's h)
ASame thing by the arcsine route
DDifferencepp

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.