Sample size calculator for A/B tests
Find how many visitors each variant of an A/B test needs to detect the lift you care about, with a frequentist or a Bayesian calculation.
Visitors needed per variant
- Total across both variants
- 29,502
- Variant conversion rate
- 11%
How the sample size is calculated
The calculator runs a two-sided two-proportion z-test. For a baseline rate p₁ and a variant rate p₂ that is p₁ plus the effect you enter, p₁ × (1 + lift) when the effect is relative, each variant needs n visitors, where p̄ is the average of the two rates, zα is the normal quantile for the confidence level, and zβ is the normal quantile for the power.
n = (zα·√(2p̄(1 − p̄)) + zβ·√(p₁(1 − p₁) + p₂(1 − p₂)))² ÷ (p₂ − p₁)²
Read the result once, after every variant has reached n, because stopping the first time the test looks significant raises the false positive rate above the confidence level you chose.

