Calculators · §1
Form MS-C1
Chi-square / z test

Sample size for comparing two proportions

How many participants you need to detect a difference between two percentages — two trial arms, exposed vs unexposed, screened vs not.

Uses the standard normal approximation, which is accurate at typical sample sizes. A planning estimate, not a substitute for a statistician.

Method & formula

This calculator uses the standard normal-approximation (z) formula for two independent proportions with pooled variance under the null — the sample-size counterpart of the uncorrected chi-square test. Per group, n = (z1−α/2·√((1+1/k)·p̄(1−p̄)) + z1−β·√(p₁(1−p₁)+p₂(1−p₂)/k))² / (p₁−p₂)², where p̄ is the allocation-weighted average proportion and k the allocation ratio.

With the defaults — 30% vs 15%, α = 0.05, 80% power, equal groups — you need about 121 per group. Small absolute differences between small proportions are expensive: detecting 5% vs 3% takes thousands, not hundreds.

Source: Fleiss JL, Levin B, Paik MC. Statistical Methods for Rates and Proportions, 3rd ed. Wiley, 2003.

Inputs, explained

Proportion in group 1 / group 2
Your best estimates of the outcome percentage in each group, as decimals (30% → 0.30). Take them from a pilot study, published rates, or the smallest difference that would change practice.
Alpha (two-sided)
The false-positive rate you'll tolerate. 0.05 is conventional; use 0.01 if the claim needs to be stronger.
Target power
The chance of detecting the difference if it is real. 0.80 is the common minimum; grant reviewers increasingly ask for 0.90.
Allocation ratio (n2/n1)
1 means equal groups. 2 means the second group is twice the size — common when controls are cheap and cases are scarce.

A sample size is one line of a statistical plan. MedStatica turns a plain-language description of your study into the full plan — design, recommended analysis, power, causal diagram, methods paragraph, and runnable R, Python, SAS, and Stata code. The first plans are free, no card required.

Plan my study free →

Related calculators: one proportion vs a reference · comparing two means · survival analysis (log-rank / Cox) · all calculators