How long should an A/B test run?
A rule of thumb for sample size
A widely used approximation for a test with two versions (95% confidence, 80% power) gives the visitors needed for each version:
Visitors per version ≈ 16 × p × (1 − p) ÷ d²
where p is your current conversion rate and d is the smallest change you want to detect, both written as fractions (5% is 0.05).
Worked examples
- Page converts at 5%, you want to spot a rise to 6% (d = 0.01): 16 × 0.05 × 0.95 ÷ 0.0001 ≈ 7,600 visitors per version.
- Same page, but you only care about a rise to 7.5% (d = 0.025): ≈ 1,220 visitors per version.
- Page converts at 2%, you want to spot a rise to 3% (d = 0.01): ≈ 3,140 visitors per version.
Two lessons follow: small improvements need far more traffic than big ones, and a page with little traffic should test bold changes, not small tweaks.
How to work out how many days a test needs
The page’s visitors are shared between the versions, so multiply first, then divide:
Days ≈ visitors per version × number of versions ÷ visitors per day
- A page with 500 visitors a day that needs 1,220 visitors per version, with 2 versions: 1,220 × 2 ÷ 500 ≈ 5 days, so run a full week.
- The same page, needing 7,600 visitors per version: 7,600 × 2 ÷ 500 ≈ 31 days.
- Testing 4 versions at once instead of 2 doubles the days, because each version gets a quarter of the traffic instead of half.
Round the answer up to whole weeks. A multivariate test counts every combination as a version, which is why it needs much more traffic than an A/B test.
Run whole weeks
People behave differently on a Monday morning and a Saturday night. A test that runs Tuesday to Thursday only hears from weekday visitors. Run at least one full week, and stop on the same weekday you started, even when the visitor count is reached sooner.
Signs a test was stopped too soon
- The "winner" was declared after a day or two, or after a handful of conversions.
- The result flips back and forth from one day to the next.
- The difference is huge for a small change, such as a doubled conversion rate from new button text.
- The split of visitors is off: you asked for 50/50 and got 60/40. That points to a tracking problem, called a sample ratio mismatch, and the result cannot be trusted.
How long is too long?
Longer is not always safer. Over many weeks, people clear cookies or switch devices and come back counted as new visitors, and the season or your ads change underneath the test. If the formula above says a test needs months, the change you are testing is too small for the traffic you have: test a bolder change, or test on a page that gets more visitors.
How Avenue Lift decides when a test is done
Avenue Lift uses Bayesian statistics, which answer the question you actually ask: how likely is each version to be the best, and how much would you lose by picking it if it is not. By default a version is only called the winner when all of these hold:
- the test has run at least 7 days;
- each version has at least 500 visitors and 10 conversions;
- the version has at least a 95% chance of being the best;
- the expected loss from picking it is small enough to ignore.
Every result also shows a 95% credible interval, and Lift flags a sample ratio mismatch on its own. Details in Experiments and the bandit.