A/B test sample size calculator
How many visitors does your test need before the result means anything? Enter your baseline conversion rate and the smallest lift worth detecting. The calculator returns visitors per variant, total visitors and, if you add your traffic, how many weeks to run it.
Calculator
Sample size reference table
Visitors needed per variant at 95% confidence (two-sided) and 80% power. Rows are baseline conversion rates; columns are the relative lift you want to detect. Double each number for the total traffic of a two-variant test.
| Baseline | 5% lift | 10% lift | 20% lift | 30% lift |
|---|---|---|---|---|
| 1% | 637,010 | 163,095 | 42,693 | 19,827 |
| 2% | 315,206 | 80,682 | 21,109 | 9,798 |
| 3% | 207,938 | 53,211 | 13,914 | 6,455 |
| 5% | 122,124 | 31,234 | 8,158 | 3,780 |
| 10% | 57,763 | 14,751 | 3,841 | 1,774 |
Read across a row and the pattern is the most important fact in A/B testing: halving the effect you want to detect roughly quadruples the traffic you need. Read down a column and the other one appears: low baseline rates need more visitors for the same relative lift.
How the calculation works
The calculator uses the standard sample size formula for a two-sided test comparing two proportions. With baseline ratep₁, target rate p₂ = p₁ × (1 + MDE) and their averagep̄, the visitors needed per variant are:
n = [ z1−α/2 √(2p̄(1−p̄)) + z1−β √(p₁(1−p₁) + p₂(1−p₂)) ]² ÷ (p₂ − p₁)²
z1−α/2 is 1.96 at 95% confidence andz1−β is 0.84 at 80% power. The result is rounded up. Duration is total visitors divided by weekly traffic, rounded up to whole weeks so every weekday is represented equally.
Two things the formula does not do. It does not correct for testing several variants against one control (with three or more variants, consider a stricter confidence level), and it assumes you decide the sample size before the test and do not stop early when the result looks significant.
For when testing is worth it in the first place, read ourguide to A/B testing. If you would rather have the program run for you, see what to expect from A/B testing and CRO agencies, or our approach to conversion rate optimization.
Common questions.
How many visitors do I need for an A/B test?+
It depends on your baseline conversion rate and the smallest lift you want to detect. At a 5% baseline, detecting a 10% relative lift (5.0% to 5.5%) at 95% confidence and 80% power takes 31,234 visitors per variant, or 62,468 in total for an A/B test. Halving the lift you want to detect roughly quadruples the sample.
What is minimum detectable effect (MDE)?+
The smallest true difference between variants your test is designed to detect reliably. This calculator uses a relative MDE: a 10% MDE on a 5% baseline means detecting a change from 5.0% to 5.5%. Smaller MDEs need far more traffic.
What confidence level and power should I use?+
95% confidence (a 5% false-positive rate, two-sided) and 80% power (a 20% chance of missing a real effect of your MDE) are the conventional defaults. Raise power to 90% when a missed winner is expensive; lowering confidence to 90% shortens tests but doubles your false-positive rate.
Can I stop the test as soon as it reaches significance?+
Not with a fixed-sample test like this one. Checking repeatedly and stopping at the first significant result inflates the false-positive rate well beyond 5%. Decide the sample size up front, run to it, and run for whole weeks so weekday and weekend behavior are both included.
What if I don't have enough traffic?+
Test bigger changes (a larger MDE needs far fewer visitors), test higher up the funnel where conversion rates are higher, or skip testing and ship the change your research supports, then monitor. Our A/B testing guide covers when not to test at all.
Not enough traffic to test?
Most B2B sites don't have it. We help teams decide what to ship without a test, and what is worth testing when they do.
Tell us about your funnel →