You change a button, run the new version against the old one for a week, and the new one converts a little better. Is it actually better, or did you get lucky? The answer depends almost entirely on how many visitors saw each version, and on a small site the honest answer is often “not enough to tell”.
The fix is to work out the sample size before you start. Our free A/B Test Sample Size Calculator does the arithmetic; this guide explains what goes into it.
The four numbers that decide it
- Your current conversion rate. For example, 3% of visitors buy or sign up.
- The smallest lift worth detecting. Not the lift you hope for: the smallest change that would make you act. Expressed as a relative change, so a 20% lift on 3% means 3.6%.
- Confidence, usually 95%. It controls how often you’d declare a winner when there’s really no difference: about 1 test in 20 at 95%.
- Power, usually 80%. The chance that the test detects a real lift of the size you chose. At 80%, a real lift of that size is missed about 1 time in 5.
Leave confidence and power at 95% and 80% unless you have a reason. The number you should think hardest about is the second one.
Worked examples at a 3% conversion rate
Two versions, 95% confidence, 80% power:
| Lift to detect | New rate | Visitors per version | Total | Days at 1,000 visitors a day |
|---|---|---|---|---|
| 40% | 4.2% | 3,758 | 7,516 | 8 |
| 20% | 3.6% | 13,887 | 27,774 | 28 |
| 10% | 3.3% | 53,182 | 106,364 | 107 |
| 5% | 3.15% | 207,909 | 415,818 | 416 |
The pattern is the most useful thing to remember: halving the lift you want to detect roughly quadruples the visitors you need. Small improvements are expensive to prove.
Rules that keep the result honest
- Fix the sample size in advance. If you check the result every day and stop the first time it looks significant, you’ll declare more false winners than your confidence level suggests.
- Run whole weeks. Even if you reach the number sooner, include every day of the week; weekday and weekend visitors can behave differently.
- One primary metric. Pick the conversion you sized the test for, and judge the test on it. Look at others for context, not to find a winner.
- More versions need more visitors. Each extra version needs its own sample, and comparing several versions with the original raises the chance of a false winner.
When your traffic is too low
If the calculator says your test needs six months, don’t run a smaller test and hope. Instead:
- Test a bigger change. A new offer or a redesigned page is more likely to move the rate by a large amount than a new button colour is.
- Test where conversions are frequent. An add-to-cart click or an email sign-up usually happens more often than a purchase, and a higher base rate needs fewer visitors for the same relative lift.
- Don’t test; decide. For low-risk changes, ship the version you believe in and watch the trend in your KPI tree. Not every decision needs an experiment.
- Tag your traffic first. Whatever you test, make sure you know where visitors came from; our UTM Link Builder helps.
How the calculator works
It uses the standard approach for comparing two conversion rates: a two-sided test of two proportions, using the normal approximation with Cohen’s h as the effect size. The statsmodels Python library provides the same method, and we check the calculator’s results against it. It assumes visitors are split evenly between versions and that each visitor is counted once.
Run your numbers in the calculator before your next test, and write the result down before you start.