A/B Test Sample Size Calculator

Estimate sample size per variant for a conversion rate A/B test given baseline CVR, MDE, significance, and power.

A/B tests are easy to misread when samples are small. Planning sample size upfront helps you avoid false positives, false negatives, and endless tests.

This calculator estimates required sample size per variant for a conversion rate test using a standard normal approximation (two-sided).

Prefer an explanation- Read the guide.
 
%
Minimum detectable effect as percentage points (e.g., 0.5 means 2.5% -> 3.0%).
pp
 
%
 
%
Tip: you can type commas (e.g., 10,000).

Example

Using the default inputs, the result is:
16,792
Baseline conversion rate
2.5%
MDE (absolute lift)
0.5pp
Significance level (alpha)
5%
Power (1 - beta)
80%

How to calculate

  1. Enter baseline conversion rate (CVR) and your minimum detectable effect (MDE).
  2. Choose significance level (alpha) and statistical power (1 - beta).
  3. Use the output as a baseline and add buffer for tracking loss and seasonality.

Formula

n ~ ((z_(1-alpha/2)sqrt(2p-(1-p-)) + z_(power)sqrt(p1(1-p1)+p2(1-p2)))2) / (p2-p1)2
  • Two-sided z-test approximation for proportions.
  • Independent samples and stable baseline rate.
  • Does not adjust for multiple testing or sequential stopping rules.

FAQ

Why does sample size explode when CVR is low-
When conversion is rare, noise is high relative to the signal. Detecting small lifts requires much larger samples.
Should I run until I hit the sample size exactly-
Use it as a baseline and add buffer. Also avoid peeking; if you want to stop early, use sequential testing methods instead of naive p-values.

Common mistakes

  • Stopping early when a result looks good (peeking inflates false positives).
  • Using an MDE that's smaller than what you can act on (forces huge samples).
  • Mixing click-based and session-based conversion rates (definition mismatch).

Quick checks

  • Keep attribution model and window consistent when comparing campaigns.
  • Pair efficiency metrics (ROAS/CPA) with profit assumptions (margin, refunds, fees).
  • Validate tracking after site changes (pixels/events can silently break).