How long should you run an A/B test? The honest arithmetic, and what to do when you don’t have the traffic

“Two weeks” is the answer you’ll hear most. Sometimes it’s right. Often it’s far too short, and stopping the moment a test looks good is the surest way to ship a winner that isn’t one. Here’s how to work out the real number for your store.

By Michal Salwin, founder of Wavelynks7 min read

In short

  • Decide the length before you start: from your conversion rate, your daily visitors and the smallest lift worth finding. Then run whole weeks, never less than one.
  • A store converting 2% needs about 21,100 visitors per version to reliably spot a 20% lift. At 500 visitors a day, that’s about three months.
  • Don’t stop when it looks significant. Checking repeatedly and stopping at the first good result turned 5% false winners into 26% in one well-known example, and more checking makes it worse.
  • Short on traffic? Test bigger changes, measure add-to-cart instead of orders, test one change at a time, or skip the test and fix what’s plainly broken.
On this page (8)
  1. The short answer
  2. Step 1: work out the sample size
  3. Step 2: run whole weeks
  4. Step 3: don’t stop early
  5. Step 4: check the split before you read the result
  6. When you don’t have the traffic
  7. How long is too long?
  8. Before you press start

The short answer

An A/B test should run until it reaches the sample size you worked out before it started, rounded up to whole weeks, and for at least one full week. You read the result once, at the end. Not when it first looks good, and not “two weeks” because that’s what everyone says.

How long that takes depends on three things: how often your visitors buy now, how big a difference you want to be able to see, and how many visitors you have. The rest of this article shows the sums, then what to do when they come out longer than you’d like.

Step 1: work out the sample size

The sample size is the number of visitors each version needs before the result can be trusted. There’s a well-known rule of thumb for the number of visitors each version needs, at the usual 5% significance level and 80% power (Zhou et al. call it “a widely adopted rule of thumb”; Evan Miller popularized it):

visitors per version ≈ 16 × p × (1 − p) ÷ δ²

Here p is your current conversion rate and δ is the difference you want to detect, in absolute terms. The smaller the difference, the more visitors you need, and it grows fast: halve δ and you need four times the visitors.

Here’s the same store with different lifts in mind, using the full formula:

Visitors needed per version, for a store converting 2%
To detect a 10% lift
80,700
To detect a 20% lift
21,100
To detect a 30% lift
9,800

Source: two-proportion formula, 5% significance, 80% power

Lift you want to detectVisitors per versionAt 500 visitors/dayAt 2,000 visitors/day
+10% (2.0% → 2.2%)80,700about 47 weeksabout 12 weeks
+20% (2.0% → 2.4%)21,100about 13 weeksabout 4 weeks
+30% (2.0% → 2.6%)9,800about 6 weeksabout 2 weeks

The rule of thumb is fine for a first guess. The table uses the full formula, the same one in our free A/B test calculator, so your own numbers there will match. The terms are in the glossary: minimum detectable effect, statistical power, sample size.

What about “1,000 visitors per version”?

It’s a common rule, and it’s far too small for most stores. At a 2% conversion rate, 1,000 visitors per version is about 20 orders each. With that, the smallest difference you can reliably detect is more than +100%: the new version would need to more than double your sales before the test could tell. Few changes come anywhere near that. Run 1,000-visitor tests and you’ll mostly be reading noise.

Step 2: run whole weeks

People shop differently on a Monday morning than on a Sunday evening. A test that runs Tuesday to Friday sees only one kind of shopper. That’s why Optimizely advises running tests for a minimum of one business cycle (seven days). Adobe’s documentation rounds test lengths up to the nearest whole week. And Microsoft’s experimentation team, which runs thousands of tests, notes that “the typical duration of an A/B test is 7 days” and warns about day-of-week effects.

Whole weeks also help with the novelty effect: regular visitors sometimes click on something just because it’s new, and the effect fades. Microsoft’s team describes a “rapid decline of estimated treatment effect across date segments” as a sign of it. If your new version wins big in week one and less each week after, believe the later weeks. More in the glossary.

Step 3: don’t stop early

Peeking is checking a running test and stopping it as soon as the result looks good. It’s where most store-owner tests go wrong. You check the test every morning. On day 6 the new version is ahead and the tool says “significant”. You stop and ship it.

The problem: the 5% false-positive rate behind “significant” only holds if you look once, at the planned end. Every extra look is another chance for random noise to cross the line. In one of Evan Miller’s examples, checking repeatedly and stopping at the first significant result pushed the false-positive rate to 26.1%, instead of the 5% you think you have. The more often you check, the higher it goes. Spotify’s engineers found that even a single extra look makes a 5% test behave closer to 10%. Researchers at Stanford and Optimizely put it bluntly: standard results are “wholly unreliable” if you decide when to stop by watching them.

There are legitimate ways to look early, but they need statistics designed for it (sequential tests, which some tools use). With an ordinary test, the rule is simple: set the length, then leave it alone. The glossary calls this peeking.

Step 4: check the split before you read the result

Before you look at which version won, check that each one got its share of visitors. If a 50/50 test shows 10,000 visitors on one side and 9,400 on the other, that gap is far too large to be chance (the odds are well under 1 in 10,000). Something is broken: a redirect, a script that fails on some phones, bots counted on one side.

Microsoft’s team is clear that such a sample ratio mismatch “typically invalidates the A/B test”. Don’t try to rescue the result. Find the cause, fix it, and run the test again.

When you don’t have the traffic

Most small stores will look at the table above and wince. Thirteen weeks for one test is a long time. You have five honest options:

1. Test bigger changes. A redesigned product page can plausibly move conversion by 30%; a new button colour can’t. In the table, going from +20% to +30% cuts the sample size by more than half.

2. Measure a step closer to the change. Far more visitors add to cart than buy, so add-to-cart reaches a reliable answer much sooner. At an 8% add-to-cart rate, spotting a 20% lift takes about 4,900 visitors per version, against 21,100 for orders at 2%. At 500 visitors a day that’s about 3 weeks instead of 13. Optimizely’s advice for low-traffic sites is the same. One catch: more add-to-carts don’t always mean more orders, so keep an eye on orders too.

3. Test one change against the original. Every extra version needs its own share of visitors. In one worked example by Seer Interactive, a test needed 61,000 visitors with two versions, 91,000 with three and 122,000 with four. More versions also mean more chances of a false winner: Adobe calculates an 18.5% chance of at least one false positive with five versions.

4. Fix the length, then see what you can detect. Turn the sum around. A store with 500 visitors a day can give each version about 7,000 visitors in four weeks. At a 2% conversion rate, that’s enough to detect a lift of roughly +36%, and no smaller. If the change you have in mind won’t plausibly do that, testing it for four weeks will only tell you “no clear difference”.

5. Don’t test. A broken checkout button, a missing delivery cost or a page that’s unreadable on a phone doesn’t need a test; it needs fixing. And when you don’t know what to change, research works on small traffic where tests can’t: ask the shoppers who leave, or watch recordings of real visits.

How long is too long?

Long tests have their own problems. People clear their cookies and switch between phone and laptop, so over months the same person can end up seeing both versions. Seasons change, and a test that straddles Black Friday measures Black Friday. Shopify’s own Experiments end after 90 days by default.

A practical limit: if your sums say a test needs more than about two months, don’t run it. Change the plan instead, using the options above.

Before you press start

  • Write down your current conversion rate, the smallest lift worth finding, the visitors per version and the length in whole weeks.
  • Pick one main metric (orders per visitor, or add-to-cart on a small store) and one guardrail, such as revenue per visitor, so a “win” that loses money gets caught.
  • Read the result once, at the end.
  • Check the split first. If it’s off, the result doesn’t count.

If the arithmetic says most of your ideas can’t be tested, that’s useful too: it tells you to spend your time on the changes big enough to show. This guide to raising your conversion rate shows how to find them.

Questions people ask

Can I stop an A/B test as soon as it’s significant?

Not with an ordinary test. Its 5% false-positive rate assumes you look once, at the planned end; stopping at the first significant result pushed false winners to 26% in one well-known example. Only stop early if your tool uses sequential statistics built for continuous monitoring.

How many visitors do I need for an A/B test?

It depends on your conversion rate and the lift you want to detect. At a 2% conversion rate, finding a 20% lift takes about 21,100 visitors per version; finding a 10% lift takes about 80,700. A calculator turns your own numbers into a sample size and a test length.

What if my test never reaches significance?

Then any real difference is probably smaller than the lift you planned for (a test can also miss one, about 1 time in 5 at the usual settings). Keep whichever version is simpler or cheaper to maintain, and move on to a bigger change. Extending the test again and again until it crosses the line is just peeking in slow motion.

Is two weeks long enough for an A/B test?

Only if two weeks of traffic reaches the sample size you calculated. One full week is the floor and two are safer, because they cover every day of the week twice, but on a small store the real answer is often much longer.

Sources

  1. Evan Miller, How Not To Run an A/B Test: 2010
  2. Zhou, Lu & Shallah, All about sample-size calculations for A/B testing (arXiv 2305.16459)
  3. Johari, Pekelis & Walsh, Always valid inference: continuous monitoring of A/B tests (arXiv 1512.04922)
  4. Spotify Engineering, Choosing a sequential testing framework: March 2023
  5. Microsoft Research (ExP), Patterns of trustworthy experimentation: during-experiment stage
  6. Optimizely, How long to run an experiment
  7. Optimizely, Test tips for low-traffic sites
  8. Adobe Target, Sample size determination
  9. Shopify Help Center, Rollout types (Experiments)
  10. Seer Interactive, Not enough traffic for A/B testing?: March 2022

Quit guessing.
Start knowing.

Paste your URL. In about a minute you’ll know where your store loses sales. Worst case, it’s perfect. (It isn’t.)