The short answer
An A/B test is a controlled experiment in which you randomly show half your visitors the current version of a page or element (the control) and the other half a modified version (the variation), then compare a chosen metric to see whether the change made a real difference. Randomization is the key. Because the two groups are alike in every way except the change, a difference in results can be credited to that change instead of to who happened to see which version.
Running a test properly means deciding in advance what you'll measure, how large a difference matters, and how many visitors you need. Then you let the test run to that size, covering whole weeks, and read the result with an understanding of what statistical significance does and doesn't tell you.
This is part seven of our CRO fundamentals series. If terms like MDE or power are new, the CRO glossary has plain definitions. The next article covers the mistakes that ruin A/B tests.
Key takeaways
-
Random assignment is what makes an A/B test a valid causal experiment.
-
Decide the primary metric, the minimum effect worth detecting, and the sample size before launching.
-
Statistical significance doesn't measure how big or valuable an effect is.
-
Underpowered tests miss real winners and produce unreliable "wins."
-
Run tests for full weeks, and long enough to cover your typical purchase cycle.
-
Many sites don't have the traffic to test small changes. That's okay: test bigger ideas, or use other methods.
How an A/B test works
The basic mechanics are straightforward.
-
You choose a goal metric, such as completed orders per visitor.
-
You create a variation that differs from the control in one or more ways you hypothesize will help.
-
The testing tool randomly assigns each eligible visitor to the control or the variation and keeps them in the same group on return visits.
-
Data accumulates on what each group does.
-
You compare the groups with a statistical method, and decide whether any difference is likely to be real.
Randomization protects you from misleading explanations. Without it, you might show the new version on Monday and the old on Tuesday, and attribute differences to the page when they came from the day of the week. Or you might show the new version to desktop visitors and the old to mobile ones. In a randomized test, all those factors are spread evenly across both groups.
Types of test
A/B test. One control against one variation. Simple, and the most efficient use of traffic.
A/B/n test. One control against several variations. It lets you try multiple ideas at once, but each additional variation needs its own share of traffic and increases the chance of a false positive, so use it with care.
Split URL test. The variants live on different URLs. It suits large changes such as a full page redesign.
Multivariate test. Tests combinations of multiple elements, such as headline and image together. It needs much more traffic because each combination is its own group, and is usually only practical on high-traffic sites.
Multi-armed bandit. Gradually shifts traffic toward the better performer during the test. It reduces the cost of showing a weaker version, and suits short campaigns or promotions, but it's less suited to learning cleanly about why something works.
For most sites and most questions, a simple A/B test is the right choice.
Choose the right metric
Your primary metric decides whether the test wins, so choose it before the test begins and don't change it afterwards.
For stores, revenue per visitor or conversion rate to purchase are sensible primary metrics. Micro metrics like clicks are tempting, because they accumulate quickly, but they're risky as the decision metric. A change can raise clicks and lower sales.
Add secondary metrics to help interpret results, and guardrail metrics to catch harm, such as refund rate, page speed, support contacts, or average order value. For more on measures, see how to calculate conversion rate.
The four numbers that determine your sample size
Sample size isn't a matter of opinion. It follows from four inputs.
-
Baseline conversion rate. How the control currently performs.
-
Minimum detectable effect (MDE). The smallest improvement you want the test to be able to detect.
-
Significance level (alpha). How willing you are to accept a false positive. The standard is 5%, which corresponds to 95% confidence.
-
Statistical power. The probability of detecting a real effect of the MDE size. The usual target is 80%.
Change any one and the required traffic changes. The relationship that surprises people most is with the MDE: halving the effect you want to detect roughly quadruples the sample size you need.
Worked examples
These figures use a standard two-sided test at 95% confidence and 80% power. Treat them as approximate, and use a calculator for your own numbers. Evan Miller's free sample size calculator is a popular choice.
| Baseline rate | Relative lift to detect | Approximate visitors per variation |
|---|---|---|
| 3% | 20% (3.0% to 3.6%) | about 14,000 |
| 3% | 10% (3.0% to 3.3%) | about 53,000 |
| 5% | 10% (5.0% to 5.5%) | about 31,000 |
Now consider what that means for a real site. If your store gets 20,000 visitors a week split between two versions, that's 10,000 per variation per week. With a 3% baseline, detecting a 10% relative lift needs about 53,000 per variation, so more than five weeks. Detecting a 20% lift needs about 14,000 per variation, so about a week and a half.
Notice what this implies. Small changes are hard to detect. If a button-text tweak might lift conversion by 2%, you'll need an enormous sample to find it, which most sites don't have. That's why experienced practitioners push toward bolder tests on smaller sites: bigger changes produce bigger effects that you can actually detect.
Absolute versus relative lift
People confuse these constantly. A move from 3.0% to 3.3% is a 0.3 percentage point (absolute) increase, but a 10% relative increase. Always state which you mean. Sample size calculators vary in what they ask for, so check the labels.
Statistical significance, explained properly
Significance is the most misunderstood idea in testing.
When you compare two groups, some difference will almost always appear by chance, even if the two versions are identical. Statistical significance is a way to ask: if there were truly no difference, how likely is it that I'd see a gap this big or bigger? That probability is the p-value.
If you choose a 5% significance threshold, you'll call a result significant when the p-value falls below 0.05. In other words, you accept that about one in twenty tests with no real effect will look like a win.
What a p-value is not
-
It is not the probability that your variation is better.
-
It is not the size of the effect.
-
It is not the probability that the result will replicate.
-
A p-value of 0.04 is not meaningfully different from 0.06. The threshold is a convention, not a cliff.
Confidence intervals matter more
A better habit is to look at the confidence interval around the measured lift. Suppose a test shows a 6% relative lift, with a 95% interval from -2% to +14%. That interval includes zero, so the result isn't significant, but it's also honest about the uncertainty: the true effect could be a small loss or a decent gain. Intervals communicate the range of plausible effects far better than a single "significant or not" label.
Statistical versus practical significance
A very large test can detect tiny differences that don't matter commercially. A 0.2% lift can be statistically significant with enough traffic, but if it's worth $300 a year and costs more than that to maintain, it isn't significant in any sense that counts. Always ask what the lift is worth.
Statistical power and why it matters
Power is the flip side of significance. If a real improvement of a given size exists, power is the probability that your test will detect it.
With 80% power, you'll find a real effect of the MDE size four times out of five. With a low-powered test, say 30%, you'll miss it most of the time and conclude "no difference" when there was one.
Low power causes two kinds of trouble. First, real winners get dismissed as inconclusive, so you give up on good ideas. Second, when an underpowered test does reach significance, the measured effect tends to be exaggerated, a bias sometimes called the winner's curse. You ship it, expecting a 15% lift, and later find the real effect was 4%.
The remedy is to calculate sample size before the test and run to that number.
How long should a test run?
Duration comes from two things.
1. The sample size you need, divided by your daily eligible traffic. If you need 30,000 visitors per variation and get 3,000 eligible visitors a day in total (1,500 per variation), you need about 20 days.
2. Business cycles. Behavior differs by day of the week, and often by time of the month. Run tests for whole weeks, so each weekday is represented equally, and cover at least one full purchase cycle. Two weeks is a common minimum, and for products with long consideration periods you may need longer.
Equally important, don't stop early just because the result looks significant. We explain why in A/B testing mistakes to avoid, but the short version is that repeatedly checking and stopping at the first significant moment inflates false positives dramatically.
You also shouldn't run tests indefinitely. Very long tests risk problems of their own: cookies expire, returning visitors get reassigned, and the world changes around you. If the required duration is unreasonably long, the answer is a bigger change or a different method, not a longer wait.
Frequentist and Bayesian approaches
Testing tools use one of two statistical frameworks, and it helps to know which yours uses.
Frequentist testing uses a fixed sample size, p-values, and confidence intervals. You decide the sample in advance, wait, and then evaluate. It's the traditional approach and is well understood, but it's strict about not peeking.
Bayesian testing reports the probability that a variation is better than the control, and often an expected loss if you pick the wrong one. Results can be monitored as data arrives and are often easier for non-specialists to read. But Bayesian approaches rely on prior assumptions, and they aren't a loophole for ignoring sample size or stopping rules. Poorly implemented Bayesian tests can be misread just as badly.
Sequential testing methods are designed to allow valid monitoring during a test, with adjusted thresholds. Some tools offer them. If yours does, learn exactly how it works.
Neither framework is "better." The right one is the one you understand and use correctly.
Before you launch: a checklist
Run through this before each test.
-
Hypothesis written, with evidence and mechanism (how to write one).
-
Primary metric chosen, plus secondary and guardrail metrics.
-
MDE decided and sample size calculated.
-
Duration estimated in whole weeks, and feasibility confirmed.
-
Audience defined: who's eligible, and on which devices.
-
Tracking verified: the conversion event fires correctly in both versions, and numbers match your backend.
-
QA done on real devices and browsers, in all supported languages and directions.
-
A/A check considered if you're new to a tool, or suspect tracking issues. An A/A test splits traffic between two identical versions to confirm the setup produces no false differences.
-
Other tests checked: make sure no overlapping experiment affects the same visitors in the same area.
-
Stopping rule agreed: the test ends at the planned sample size, not when it looks good.
Reading the results
When the test reaches its planned size, look at:
-
Data quality first. Is the traffic split close to what you intended? A noticeable mismatch signals a technical problem (see the sample ratio mismatch point in the next article).
-
The primary metric, with its confidence interval.
-
Guardrail metrics. Did anything get worse?
-
Consistency across days. A result driven by one unusual day deserves skepticism.
-
Segments, cautiously. It's valid to look at device and new versus returning as exploration, but segment results are noisier, and slicing many ways produces false patterns. Treat them as hypotheses for follow-up tests, not as conclusions.
Then make a decision with three possible outcomes.
-
Win: the variation reliably improves the primary metric without harming guardrails. Ship it, and monitor after launch.
-
Loss: the variation is worse. Don't ship it, and record what you learned.
-
Inconclusive: no reliable difference. That's information too: either the change doesn't matter much, or your test couldn't detect an effect of the size that exists. Decide whether the idea deserves a bolder second attempt.
Inconclusive results are common. Many programs see a minority of tests produce clear wins, and treating the rest as failure leads teams to cherry-pick or overstate results. Learning, not winning, is the real product of a testing program.
When you don't have enough traffic
Many sites can't test small changes. If calculating sample size tells you a test would take six months, you have options.
-
Test bigger changes, which produce larger effects and need smaller samples.
-
Use a higher-volume metric, such as add-to-cart, as a supporting measure, while recognizing it isn't the final goal.
-
Raise your tolerance, for example accepting 90% confidence for low-risk, easily reversible changes, with a clear understanding of the trade-off.
-
Combine pages or templates, such as testing across all product pages instead of one.
-
Rely on research. Usability testing and qualitative evidence can justify a change without a controlled experiment.
-
Make the change and monitor, acknowledging that before-and-after comparisons are weaker evidence.
The wrong answer is to run an underpowered test anyway and treat the result as meaningful.
Frequently asked questions
What is an A/B test?
An A/B test randomly splits visitors between the current version of a page (control) and a modified version (variation), and compares a chosen metric to see whether the change made a real difference.
How long should I run an A/B test?
Long enough to reach your pre-calculated sample size, and for whole weeks that cover a typical purchase cycle. Two to four weeks is common, but your traffic and conversion rate decide.
What is a good sample size for an A/B test?
It depends on your baseline conversion rate, the smallest effect you want to detect, your confidence level, and power. As an illustration, detecting a 10% relative lift on a 3% baseline needs roughly 53,000 visitors per variation. Use a calculator for your own figures.
What does 95% confidence mean?
It means you've set a 5% threshold for false positives. If there were no real difference, you'd wrongly call a result significant about one time in twenty. It doesn't mean there's a 95% chance your variation is better.
Can I stop a test when it reaches significance?
Not if you're using a fixed-sample method. Stopping at the first significant reading inflates false positives. Stop at the planned sample size, or use a method designed for sequential monitoring.
What is MDE in A/B testing?
Minimum detectable effect is the smallest improvement your test is designed to reliably detect. Smaller MDEs require much larger samples.
Is a Bayesian A/B test better than a frequentist one?
Neither is inherently better. Both work if used properly, and both can be misused. Use the approach your tool supports and that you understand.
Where to go next
Now you understand how a test should run. The next article, A/B testing mistakes to avoid, covers the errors that quietly invalidate results, from peeking to sample ratio mismatch.
You may also want to review CRO hypotheses and prioritization for what to test, or the CRO glossary for definitions.
Series contents
-
A/B Testing Explained (you are here)



