Two-Proportion Sample Size Calculator
Use this tool to estimate the required sample size for comparing two independent proportions (e.g., conversion rate, response rate, event rate).
Why sample size matters for two proportions
When your outcome is binary (yes/no, success/failure, converted/not converted), comparing two proportions is one of the most common study designs in clinical trials, public health, social science, and A/B testing. A sample size that is too small can miss a true difference. A sample size that is too large can waste time, money, and participant effort.
The goal is to choose a sample size that gives a high probability (power) of detecting a meaningful difference at a chosen false-positive rate (alpha).
Inputs used by this calculator
1) Proportion in each group (p1 and p2)
These are your expected event rates. For example, if you expect 10% conversion in control and 14% in treatment, then:
p1 = 0.10 and p2 = 0.14.
2) Significance level (α)
Alpha is the probability of a Type I error (finding a difference when none exists). A common setting is 0.05.
3) Power (1 - β)
Power is the probability of detecting the specified difference if it truly exists. Common values are 0.80 or 0.90.
4) Allocation ratio (n2/n1)
Equal allocation (ratio = 1) is often most efficient. Unequal allocation is used when one group is easier to recruit, less expensive, or ethically favored.
5) One-sided vs two-sided test
A two-sided test checks for any difference. A one-sided test checks only one direction and usually yields a smaller required sample size, but it must be justified before data collection.
6) Dropout inflation
If you expect attrition, inflate your sample size. For example, with 10% dropout, divide by 0.90 (or multiply by 1.111...).
Formula overview
This page uses the standard normal approximation for two independent proportions with optional unequal allocation ratio. The tool reports required participants in each group and total sample size after rounding up.
- Effect size:
|p1 - p2| - Critical values:
z(1-α/2)for two-sided orz(1-α)for one-sided, andz(power) - Outputs: required n for group 1, group 2, and total
Practical tips before finalizing your design
- Use realistic baseline rates: pull from pilot data, historical studies, or registry data.
- Define a meaningful difference: statistical significance is not the same as practical significance.
- Stress test assumptions: run best-case and worst-case scenarios for p1, p2, and dropout.
- Document choices: include your assumptions in a protocol or analysis plan.
- Consult a statistician for confirmatory work: especially for cluster designs, repeated measures, non-inferiority, or interim analyses.
Common mistakes
- Using an optimistic effect size that is unlikely in practice.
- Ignoring dropout/non-response in recruitment targets.
- Switching from two-sided to one-sided after seeing data.
- Confusing percentage points with relative changes (e.g., 10% to 12% is +2 points, not +2%).
Bottom line
A good sample size calculation is where scientific intent meets operational reality. Use this calculator to get a solid starting estimate for two-proportion comparisons, then refine with domain knowledge and study-specific constraints.