A/B Test Sample Size Calculator

Find out how many visitors each variant needs, and how many days your test has to run. Updates live, no signup.

Your test

MDE is measured as
Hypothesis
Total sample size
-
Control (A)-
Variant (B)-

Estimated test duration
-

How to use this A/B test sample size calculator

Baseline conversion rate

The current rate of the metric you want to improve, from the last few weeks of data. Signup rate, purchase rate or click-through rate all work.

Minimum detectable effect

The smallest lift worth detecting. Pick it from business value, not from what feels achievable. Relative means a share of the baseline (10% of 5% is 0.5 points); absolute means percentage points.

Significance, power and hypothesis

Alpha is the false-positive rate you accept (5% is standard). Power is the chance of catching a real effect of at least the MDE (80% is standard). One-sided tests need fewer visitors but ignore the downside.

Traffic split and daily visitors

An uneven split makes the test longer. Daily visitors is how many people actually enter the experiment, not site-wide traffic. We divide the total by it to estimate duration.

Worked example

A checkout converts at 5%. You want to detect a 10% relative lift (5.0% to 5.5%) with a 50/50 split, two-sided alpha 0.05 and 80% power. The calculator gives about 31,200 visitors per variant, roughly 62,500 in total. At 5,000 visitors a day, that is 13 days, so run it for 14 to cover two full weeks.

Baseline 5%, 80% powerPer variant

Note how a smaller MDE blows up the requirement: halving it roughly quadruples the sample size.

The formula

n = ( zα·√((1 + 1/r)·p̄(1 − p̄)) + zβ·√(p1(1 − p1) + p2(1 − p2)/r) )² / (p2 − p1)²

Here p1 is the baseline, p2 the baseline plus the MDE, r the variant-to-control traffic ratio, and p̄ = (p1 + r·p2)/(1 + r). The result n is the control size; the variant gets r·n. Everything runs in your browser. Nothing is sent anywhere.

A/B test sample size FAQ

How do you calculate A/B test sample size?

Use the two-proportion formula above, or this calculator. You supply the baseline rate, the minimum effect you care about, alpha and power; it returns visitors per variant.

What is a minimum detectable effect (MDE)?

The smallest change you want the test to reliably detect. A 10% relative MDE on a 5% baseline means moving from 5.0% to 5.5%. Smaller MDEs need much more traffic.

What significance level and power should I use?

Alpha 0.05 and 80% power are the common defaults. Use 90% power when missing a real win is costly. Higher power or lower alpha means more visitors.

One-sided or two-sided test?

Two-sided is the safer default because it catches harm as well as gain. One-sided needs about 20% fewer visitors at the same alpha and power but cannot show the variant is worse. Choose before the test starts.

How long should I run an A/B test?

Total sample size divided by daily eligible visitors, rounded up to whole weeks so each weekday is represented equally. Do not stop early on a lucky p-value; peeking inflates false positives.

What if I do not have enough traffic?

Test a bolder change, use a metric higher in the funnel with a higher baseline, accept lower power, or run longer. Tiny tweaks on low-traffic pages rarely give a reliable answer.