What is AB testing? A plain-English guide with an example

What is AB testing? A plain definition, a worked example, the steps to run one, and what to do when you lack the traffic for a test.

By the betaproof team6 min read
Illustration of what is AB testing: two page versions side by side with a results chart

The short answer to what is AB testing: you show two versions of something to different groups at the same time, then compare how each group behaves on a metric you chose beforehand. You can call a winner only when statistical testing shows that the gap is unlikely to be random chance. The hard part is setting the test up well.

What is AB testing in practice

Version A is usually what you have now. Version B is the change you want to try: a different email subject line, a new landing page headline, a different price.

The version people already see is the control, and the changed one is the variation. On a web page, traffic is split so some visitors get the control and others get the variation. Two principles underpin the test: random selection and statistical significance.

Random assignment helps balance factors such as seasonality, traffic mix and market conditions across the groups. That makes it more credible that a difference in outcomes came from your change. Show A in March and B in April instead, and you cannot separate the effect of the change from the effect of timing.

A worked example, with the numbers

A company has a customer database of 2,000 people. It writes two emails with different calls to action and sends each one to 1,000 people chosen at random.

Email A gets 50 responses out of 1,000, a 5% response rate. Email B gets 30 out of 1,000, or 3%. You then need statistical testing to see whether that difference is significant or just chance.

People skip that step. A is ahead by 20 responses and two percentage points, and it feels like a clear win. But send the same email to two random halves of a list and you won't get identical counts either. Before rolling A out to everyone, run a statistical test to check whether the difference is significant rather than chance.

The metric you pick also shapes the answer. In the same example, if the goal had been click-through rate rather than purchases, the result might have flipped: email B brought more people to the site but lacked the urgency to make them buy. Judge on clicks and you could back the email that sells less.

That's why the outcome has to be defined and measurable before you start. Sales, click-through and sign-ups are all valid. Pick one.

The structure carries over to anything. Say you want to know whether a landing page headline that names the benefit beats one that names the product. Half your visitors see each, everything else stays identical, and you compare the share who start a free trial.

How to run an A/B test, step by step

  1. Start from a real problem. Look in your analytics for a page where people drop off or a step that underperforms. A test with no problem behind it is a guess with extra paperwork.
  2. Turn your idea into a hypothesis. "Make the button yellow" is an idea. The hypothesis is the reason it should work: higher contrast between button and background makes it easier to spot, so more people click. That reason is what you learn from, even when the test loses.
  3. Choose one primary metric, plus guardrail metrics that warn you when a winning variant is hurting something else. A checkout button that lifts clicks but raises refunds has cost you money.
  4. Change only what you need to test the hypothesis. If you alter the headline, image and layout together, you can judge the combined version but not identify which change caused the result.
  5. Settle the traffic split and duration in advance. An even split gathers data from both versions at the same rate. A weighted split can limit exposure if the variation performs poorly, but it will take longer to collect enough data for the smaller group. Your risk tolerance decides.
  6. Check both versions display properly on mobile and desktop, then split traffic randomly and launch.
  7. Monitor for breakage, such as broken tracking or a variation that won't load. Resist stopping the moment one version pulls ahead.
  8. Write down what you tested, what happened and what you now believe.

What A/B testing is good for

It answers narrow questions with behaviour instead of opinion. Headlines, calls to action, subject lines, ad copy, images, page layouts and pricing are the usual candidates.

Marketing, product, design and engineering teams can use it to make a specific decision with behavioural evidence.

Why A/B tests go wrong

A few mistakes recur in poorly run tests.

Traffic is the big one. A/B tests are sensitive to variance and need a large sample to reach significance, and small samples throw up noisy results and false positives.

Then there's stopping early. One version may pull ahead soon after launch, but ending the test before the planned duration can skew the data.

The other three are quicker to describe:

  • picking the metric after you've seen the results, which lets you find a "win" in almost anything
  • changing too much at once, so you see a difference but can't say what caused it
  • forgetting that a test shows what people chose, never why (pair it with interviews or session recordings)

When not to use A/B testing

Sometimes a split test is the wrong tool. GrowthBook lists several cases, and these are the ones that come up most:

  • You're still searching for product-market fit. A/B testing is unlikely to be the right tool at that stage.
  • Too few people pass through the page, so the test would run for months or give an underpowered answer.
  • The right answer is obvious. Accessibility improvements, critical bug fixes and security patches should just ship.
  • You're making a significant brand change, and showing different people different identities creates inconsistency.
  • Your team can't agree on what success looks like. Sort that out first, or no result will settle anything.

Regulated fields such as healthcare, financial services and edtech put constraints on how users can be treated. You can still test, but randomly assigning people to different experiences needs extra care over ethics and privacy. Testing the wording of an appointment reminder is a very different matter from giving patients different information about their treatment. Bring in whoever handles compliance before you design anything.

What to do if you don't have the traffic to test

If your site or launch has limited traffic, a live test may not reach a reliable result. How much traffic you need depends on your current conversion rate and the size of lift you hope to detect. Small lifts on low rates need more visitors than large lifts on high ones.

A sample size calculator will give you the figure for your case. If it says months, park the live test for now.

There are other ways to learn in the meantime. Talk to real customers about where they get stuck and why. Go through your analytics, find where people leave and fix obvious breaks first. Our guide to conversion rate optimisation covers this with low traffic in mind. You can also put the options side by side and ask people which they'd choose before you ship anything.

If you have several headlines, a quick directional pre-check can help narrow the shortlist. Our free headline tester asks five simulated AI personas which headline they would click and why.

Those personas are not real people, so use the output as a filter and confirm important decisions with real users or a live test once the traffic exists. For page variants, see AI A/B testing and testing a landing page before launch.

Keep a simple log of the hypothesis, method, result and lesson for every piece of research, including persona studies and conversations. Record the evidence source so you do not treat simulated feedback as equivalent to real-user research.