All tools
Interactive calculator · free · no signup

A/B test sample size calculator

Enter your baseline conversion rate, the minimum relative effect you want to detect, your statistical power, and your daily eligible traffic. You get the required sample size per variant and an estimated test duration.

e.g. 10 = detect a 10% relative lift.

About 39,476 visitors per variant.

Per variant
39,476
Both variants
78,952
Detecting change to
4.40%
Est. duration
26.3 days

Two-proportion z-test at 5% two-tailed significance. Run at least one full weekly cycle and do not stop early on a significance blip.

How it works

The calculator uses the standard two-proportion z-test approximation: n per variant equals 2 times the squared sum of the z-scores for significance and power, times the pooled rate p-bar times one minus p-bar, divided by delta squared. Here p-bar is the average of your baseline rate and the expected variant rate, and delta is the absolute difference between them, which is your baseline rate times the relative minimum detectable effect.

The z-scores come from your chosen error tolerances. Significance is fixed at 5% two-tailed, meaning a 5% chance of declaring a winner when there is no real difference. Power of 80% or 90% is your chance of detecting the effect if it truly exists; higher power costs more sample. The delta-squared term in the denominator is why small effects are so expensive: halving the effect you want to detect roughly quadruples the required sample.

Duration is the total required sample across both variants divided by your daily eligible traffic. Eligible means visitors who actually enter the experiment, not total site traffic. This is the number that turns an abstract sample size into a calendar answer: whether the test takes a week or a quarter.

Assumptions and limitations

Frequently asked questions

How many visitors do I need for an A/B test?

It depends on three things: your baseline conversion rate, the smallest effect you care to detect, and the power you want. Low baseline rates and small effects both push the requirement up sharply, since sample size scales with the inverse square of the effect size. Enter your numbers above and the calculator gives the per-variant requirement directly.

What is statistical power in an A/B test?

Power is the probability your test detects a real effect of the size you specified, if it exists. At 80% power, one in five truly winning variants will still come back as inconclusive. Choosing 90% reduces that risk but requires a larger sample, so it is a tradeoff between confidence and test duration.

What is minimum detectable effect (MDE)?

The MDE is the smallest improvement your test is designed to reliably detect, usually stated as a relative change to the baseline. A 10% relative MDE on a 4% baseline means detecting a move to 4.4%, an absolute difference of 0.4 points. Effects smaller than your MDE can still exist; your test just is not powered to distinguish them from noise.

How long should I run an A/B test?

Divide the total required sample across both variants by your daily eligible traffic to get a minimum duration, which this calculator does for you. Then run at least one or two full weekly cycles even if the sample fills faster, because conversion behavior differs by day of week. Do not stop early just because a dashboard briefly shows significance.

Is my traffic data sent to a server by this calculator?

No. The computation runs entirely client-side in your browser, and none of the rates or traffic figures you type are transmitted or stored anywhere.