A/B Test Sample Size Calculator
Calculate how many visitors each variant needs before your A/B test can produce a statistically valid result. Enter your current conversion rate and the smallest lift you want to detect; the calculator returns the required sample per variant at 95% significance (two-sided) and 80% power. Use it before every test, an underpowered test wastes traffic and gives you an answer you cannot trust either way.
Worked example
Your landing page converts at 2% and you want to detect a relative lift of at least 20% (from 2.0% to 2.4%). The formula gives roughly 8,000 visitors per variant (about 16,000 total). If you only care about detecting a 50% lift (2.0% to 3.0%), the requirement drops to roughly 1,400 per variant, which is why deciding your minimum detectable effect honestly is the single most important input.
How the maths works
The calculator uses the standard two-proportion sample-size formula: n = 2 x (z_alpha + z_beta)^2 x p(1-p) / (p1-p0)^2, where p0 is your baseline rate, p1 is the baseline lifted by your minimum detectable effect, and p is their average. We fix significance at 95% (two-sided, z = 1.96) and power at 80% (z = 0.84), the conventional settings for conversion testing. Significance controls false positives; power controls false negatives. The result is rounded up.
Frequently Asked Questions
How is the sample size calculated?
We use the standard two-proportion formula: n = 2 x (z_alpha + z_beta)^2 x p(1-p) / (p1-p0)^2, with 95% significance (two-sided) and 80% power. You enter your baseline conversion rate and the minimum detectable effect; the calculator returns the visitors required per variant.
What is a minimum detectable effect (MDE)?
The smallest relative improvement you want the test to reliably detect. A 20% MDE on a 2% baseline means you want to detect a move to at least 2.4%. Smaller MDEs need much larger samples, so pick the smallest lift that would actually change your decision.
Why does a smaller effect need more visitors?
Random variation between visitors creates noise. The smaller the true difference you are trying to detect, the more visitors you need before that difference stands out from the noise with statistical confidence.
Can I stop the test early once it looks significant?
No. Checking repeatedly and stopping the first time the result looks significant inflates your false-positive rate well beyond 5%. Decide the sample size up front, run to completion, then read the result once.
What baseline conversion rate should I enter?
The current conversion rate of the specific page and goal you are testing, measured over a recent representative period, not your site-wide average.
Related tools
Also try our A/B Test Duration Calculator and A/B Test Significance Calculator. Not sure what to test or fix first? Run our free CRO audit tool for a scored, 6-pillar report on your page in 3-5 minutes. Explore all free CRO tools.