System: nominal

Lab // Unit Economics and Measurement / Proof that can't be faked

How long should you run an A/B test?

The short answer

Run an A/B test for as long as it takes each variant to reach its required sample size, rounded up to whole weeks. Work out the sample size from your baseline conversion rate and the smallest lift worth detecting, then divide by the daily visitors each variant receives.

Key takeaways
  • Duration is sample size divided by traffic, rounded up to whole weeks.
  • Decide the end date before the test starts, not while watching it.
  • Always run whole weeks, because weekdays and weekends convert differently.
  • A test that would take more than six weeks is asking the wrong question.

How do you calculate test duration?

Duration is the sample size each variant needs divided by the daily visitors each variant receives, rounded up to the next whole week.

The sample size comes first, and it depends on three decisions rather than on your traffic: the baseline conversion rate you are starting from, the smallest lift that would be worth acting on, and how strict you want to be about being wrong. The A/B test sample size calculator takes those and returns visitors per variant.

Only then does traffic enter. A test needing 13,900 visitors per variant, on a page getting 1,000 visitors a day split evenly, gives each variant 500 a day. That is 27.8 days per variant, which rounds up to 28 days, and 28 days is exactly four weeks, so no further rounding is needed.

Adding variants multiplies the wait rather than splitting it. Three variants on the same 1,000 daily visitors give each one 333 a day, so the same 13,900 requirement takes 42 days instead of 28. A fourth takes it to 56. Each extra variant also gives noise another chance to produce a winner, so a four-way test needs a stricter threshold than a two-way one to make the same claim.

What does a worked example look like?

A US landing page converts at 3 percent and you want to detect a 20 percent relative lift, which is a move from 3.0 percent to 3.6 percent.

At 95 percent confidence and 80 percent power, that needs about 13,900 visitors per variant. The page gets 1,000 visitors a day, so each variant gets 500, and the test runs 28 days.

Now halve the ambition. Detecting a 10 percent lift, from 3.0 percent to 3.3 percent, needs about 53,200 per variant, which at the same traffic is 107 days. The lift you are willing to call small is the single biggest driver of how long you wait, because the requirement grows roughly with the square of the inverse of the effect size.

Lift to detectVisitors per variantDays at 500 a dayWeeks to plan
20% (3.0% to 3.6%)13,900284
15% (3.0% to 3.45%)24,500497
10% (3.0% to 3.3%)53,20010716

Why run whole weeks?

Because a visitor on Tuesday and a visitor on Saturday are not the same visitor, and a part week silently overweights whichever days it contains.

Most B2B traffic converts better on weekdays; a good deal of consumer traffic converts better at the weekend. A test that runs 25 days contains four of some weekdays and three of others, so the difference it reports includes a day-mix difference you did not intend to measure.

Round up rather than down. A test that needs 25 days runs 28. The extra three days cost very little against the risk of a result you cannot trust.

Why does stopping early break the result?

Because every time you look at a running test and reserve the right to stop, you give random noise another chance to cross the significance line.

A p-value below 0.05 means a gap this large would appear about 5 times in 100 if the variants were identical. That guarantee applies to one look at a predetermined sample size. Check daily for four weeks and you have taken 28 looks, and the chance that at least one of them crosses the line by accident is far higher than 5 percent.

This is why the end date is decided before the test starts. Watching a test is fine. Acting on what you see before the planned sample arrives is what breaks it. When the planned visitors have arrived, read the result once with the A/B test significance calculator, which returns the p-value, the confidence and the interval around the difference.

What if the test would take too long?

Change the question rather than the statistics, because a test that needs four months will be overtaken by something else before it finishes.

Four options, roughly in order of how often they are the right one. Test a bolder change, since a redesigned offer moves conversion more than a button colour and therefore needs less traffic to detect. Test a higher-traffic page, because the same change on a page with five times the visitors resolves in a fifth of the time. Raise the lift you are willing to call small, accepting that you will miss genuine but tiny improvements. Or test a metric that happens more often, such as add-to-cart rather than purchase, while keeping an eye on whether the downstream rate held.

Loosening confidence from 95 to 90 percent is the option to use last and carefully. It does shorten the test, and it also doubles the rate at which you act on differences that are not real.

  • Test a bolder change, not a smaller one
  • Move the test to a higher-traffic page
  • Raise the minimum lift worth detecting
  • Measure an earlier step in the funnel

Does a longer test always give a better answer?

No. Past the planned sample size, extra days buy precision you are not using and add risks you did not have on day one.

A test left running for months spans seasonal shifts, pricing changes, creative refreshes and sometimes a site redesign. Every one of those changes what is being compared, so the clean comparison you set up decays into two variants measured under different conditions.

Cookie deletion and device switching also accumulate. The longer a test runs, the larger the share of visitors who have been counted in both variants, which pulls the measured difference toward zero.

Free tool / Clinical trials

How many visitors before a result is valid?

A/B Test Planner

Questions about Unit Economics and Measurement

How long should an A/B test run as a minimum?

One full week, even when the sample size arrives sooner. A shorter window overweights whichever days of the week it happens to contain.

Can I stop as soon as the result turns significant?

No. Checking repeatedly and stopping at the first good reading inflates false positives badly. Decide the sample size first, run to it, then read the result once.

What if I lack the traffic for any useful test?

Test bigger changes, move the test to a higher-traffic page, or accept a larger minimum detectable effect. Loosening confidence is the last resort, since it doubles your false positive rate.

Does the duration change if traffic is uneven between variants?

Yes. Duration is set by the slower variant, so a 90/10 split takes far longer than an even one to give the small side its required sample.

Should I run the test over a holiday period?

Avoid it where you can. Holiday traffic converts differently, so a test spanning one measures the holiday as much as the change.

Key terms

Written by

Kartikeya Awasthi, Co-founder, InTrendz Media

Kartikeya has 12 years of experience across Accenture, EY, Coforge and other enterprises. He holds an MBA from NMIMS Mumbai and has received CII National Gold and Silver awards for AI and Industry 4.0 work. He writes and reviews every article on the InTrendz blog. More about the author

How we write and review

Keep reading