Ali Demirbaş
Calculators

A/B Test Sample Size Calculator

Work out how many visitors per variant a test needs before it can detect the lift you care about.

Required sample size per variant

29,827

Enter your numbers and press Calculate.

Sample size per variant = 2 × (z-values for power and significance, summed)² × Baseline rate × (1 − Baseline rate) ÷ (Baseline rate × Relative MDE)²

Worked example

What this number tells you

Run a test on too few visitors and a real effect can pass undetected; there was not enough data to tell a genuine lift from noise. This works backward from four inputs to the sample size that gives the test a reasonable chance of catching one.

MDE here is relative, not an absolute percentage-point move. Entering 10 means detect a 10% relative improvement: from a 5% baseline that is a move to 5.5%, not to 15%. At a 2% baseline it means about 2.2%; at 40%, about 44%.

The result is a requirement, not a target to stop at. Run to it, then check significance once.

When to use it

Before launching, to find out whether the test is even feasible on your traffic. If the number is out of reach in a reasonable window, that is the signal to raise the MDE or reconsider the test.

Where it misleads

Setting MDE to the lift you are hoping for rather than the smallest one that would change a decision demands an enormous sample. And if another tool disagrees with this result, check whether it treats MDE as relative or absolute before assuming either is wrong.

Frequently asked questions

Should I use 80% or 90% power?

80% is the conventional default and needs less traffic to reach. 90% lowers the chance of missing a real effect, but costs meaningfully more sample size to get there - worth it for decisions where a missed effect is expensive, less necessary for lower-stakes tests.

What if I don't have enough traffic to reach this sample size?

You can raise the MDE (accept that only a larger lift will be detectable), lower statistical power, or extend the test duration - see the test duration estimator for how sample size translates into calendar time at your actual traffic level.

Related calculators