- Introduced by
- Ron Kohavi et al. (Microsoft); conceptual roots in R. A. Fisher's randomized experiments (1935)
- Year
- 1935
- Type
- Parametric comparison (frequentist or Bayesian)
What does it do?
An A/B test is a randomized controlled experiment in which users are split between a control variant (A) and a treatment variant (B), and the outcome is compared to judge whether the observed difference is larger than chance variation would produce.
The online form of the method was systematized by Ron Kohavi and colleagues at Microsoft in the early 2000s, building on R. A. Fisher's randomization principles. It is widely used to evaluate changes to web and digital products.
The intuition behind the method
Imagine splitting your website visitors at random: half see the current design (A) and half see a new design (B). Because the split is random, any systematic difference in conversion rates between the two groups can be attributed to the design change rather than to pre-existing differences in the visitors. The A/B test formalizes this intuition by asking whether the observed gap is large enough relative to the natural noise in the data to be taken seriously.
History
The conceptual foundation is R. A. Fisher's work on randomized allocation and significance testing, developed through the 1920s and 1930s; the year 1935 is given in this entry's facts as the reference date for that foundational work. Online controlled experiments became practical in the late 1990s and early 2000s as web companies began randomizing traffic at scale. Ron Kohavi and colleagues at Microsoft documented practical pitfalls such as sample ratio mismatch and novelty effects, and their 2020 book Trustworthy Online Controlled Experiments is the main reference cited here. Bayesian A/B testing is presented in this entry as an alternative framing that does not require a fixed stopping point.
When to use it
Use an A/B test when users or units can be randomly assigned to exactly two variants and there is one clearly defined primary metric. The design relies on several assumptions: assignment is independent and random, with no leakage between groups; the experiment runs long enough to cover the periods over which behaviour varies, such as weekly cycles; the realized split matches the intended split, which should be verified with a sample ratio mismatch check; and multiple metrics are corrected with Bonferroni or FDR procedures. The minimum of about 100 observations per group listed in this entry's facts is a floor, not a sufficient size. The required sample depends on the baseline rate and the minimum detectable effect, so a power analysis should be run before launch. Do not use this design when random assignment is impossible or unethical, or when users interact across groups (for example in social networks or marketplaces), because interference violates the independence assumption.
Limitations and considerations
- Requires large sample sizes to detect small effects; underpowered experiments produce unreliable results.
- Cannot be used when random assignment is impossible or unethical.
- Network effects and cross-group interference (e.g. social platforms, marketplaces) violate the independence assumption and bias estimates.
- Running many simultaneous tests inflates the family-wise error rate unless multiple-comparison corrections are applied.
- Looking at results before the pre-planned end date and stopping on a threshold inflates Type I error; sequential methods such as SPRT are designed for continuous monitoring.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Randomization balances measured and unmeasured confounders in expectation, so a difference in outcomes between randomized groups can be attributed to the change, up to sampling noise.
- Straightforward to interpret: when the groups are properly randomized, with no sample ratio mismatch or interference between them, a statistically significant difference can be attributed to the tested change, up to sampling noise.
- Flexible enough to cover binary outcomes (conversion rate), continuous outcomes (revenue, latency), and count outcomes (pages per session).
- Bayesian variants yield probabilistic statements (P(B > A)) that are often more actionable than a binary reject/fail-to-reject decision.
Applications
- Testing UI and UX changes on web and mobile products (button color, layout, copy) against a conversion or engagement metric.
- Evaluating new ranking or recommendation algorithms in search engines, content feeds, and e-commerce platforms.
- Measuring the causal impact of pricing changes, promotional offers, or onboarding flows on revenue or retention.
- Comparing two versions of an email campaign or advertisement against an open-rate or click-through metric.
- Assessing the effect of latency changes (performance experiments) on user engagement metrics.
How it works
How it works
The null hypothesis states that the true conversion rate in population A equals that in population B; the alternative states that they differ. The formula given for this step is written for proportions; for continuous outcomes such as revenue per user, the same logic applies to means. Before running the experiment, fix the significance level (commonly 0.05), the desired statistical power (commonly 0.80), and the minimum detectable effect, meaning the smallest lift that would matter in practice.
Formula
H_0:\ p_A = p_B \quad H_1:\ p_A \neq p_B
For binary outcomes such as conversion, a two-proportion z-test is the standard frequentist approach. Here the observed proportions p̂_A = x_A / n_A and p̂_B = x_B / n_B are compared, and the standard error uses the pooled conversion rate p̂ = (x_A + x_B) / (n_A + n_B), together with both sample sizes. For continuous outcomes, a two-sample t-test is used instead; when the variances or sample sizes of the two groups differ, the Welch variant is preferred, with t = (x̄_B − x̄_A) / sqrt(s_A²/n_A + s_B²/n_B) and Welch degrees of freedom. The resulting statistic is compared with the appropriate reference distribution (normal or Student t) to obtain a p-value.
Formula
z = \dfrac{\hat{p}_B - \hat{p}_A}{\sqrt{\hat{p}(1-\hat{p})\left(\dfrac{1}{n_A}+\dfrac{1}{n_B}\right)}}If the two-tailed p-value falls below the pre-set significance threshold, the null hypothesis is rejected and the treatment is reported as having a detectable effect. The observed lift (relative change) should be reported together with a 95% confidence interval for the difference between the two rates, computed from the standard error of that difference; for continuous outcomes an effect size such as Cohen's d is often added. Pre-experiment data can also be used to reduce variance and improve the sensitivity of the experiment, as discussed by Deng et al. (2013). A Bayesian framing computes the posterior probability that B outperforms A (P(B > A)), for example with conjugate Beta priors on conversion rates.
Formula
\text{reject } H_0 \text{ if } p < \alpha;\quad \text{lift} = \dfrac{\hat{p}_B - \hat{p}_A}{\hat{p}_A}Common pitfalls
- Stopping the experiment early because the p-value crossed 0.05 — this inflates the false-positive rate; commit to the pre-planned sample size or use SPRT.
- Ignoring the sample ratio mismatch (SRM): if the realized split differs materially from the intended 50/50, the randomization is broken and results are invalid.
- Testing multiple metrics without correction — at least apply Bonferroni or Benjamini-Hochberg FDR.
- Launching on a novelty effect: the first days of an experiment may show inflated engagement simply because the variant is new; run the test long enough to let novelty decay.
Frequently asked questions
How large does my sample need to be?
Run a power analysis before the experiment. Specify the baseline conversion rate, the minimum detectable lift you care about, the desired power (usually 0.80), and the significance level (usually 0.05). The two-proportion z-test formula then gives the required n per group. Because the required n grows rapidly as the detectable lift shrinks, small lifts on low baseline rates generally need far more data than the 100-per-group floor listed in this entry's facts.
Frequentist or Bayesian — which approach should I use?
Frequentist tests (z-test, t-test) control the Type I error rate at a specified level and are the classical approach. Bayesian tests compute P(B > A) and are often used by product teams that want probabilistic statements to inform decisions. The choice depends on whether error-rate guarantees or probabilistic statements are more useful to your stakeholders, and it should be settled before the experiment starts.
What is a sample ratio mismatch and why does it matter?
A sample ratio mismatch (SRM) occurs when the proportion of users assigned to each variant differs from the intended ratio. Even small deviations, such as a 50/50 split landing at 48/52, can indicate a broken randomization mechanism (e.g. bot filtering, caching, redirect bugs). An SRM invalidates the causal interpretation; run a chi-square test on the assignment counts before analyzing outcomes.
Can I run multiple A/B tests simultaneously?
Yes, provided the tests are on orthogonal segments or the platform implements proper interleaving controls. However, running many tests on the same population inflates the family-wise error rate. Apply Bonferroni or Benjamini-Hochberg FDR correction when monitoring several primary metrics, and be cautious about interaction effects between simultaneous experiments.
Related methods
Sources
Kohavi, R., Tang, D., & Xu, Y. (2020). Trustworthy Online Controlled Experiments: A Practical Guide to A/B Testing. Cambridge University Press.
ISBN: 9781108724265Deng, A., Xu, Y., Kohavi, R., & Walker, T. (2013). Improving the Sensitivity of Online Controlled Experiments by Utilizing Pre-Experiment Data. KDD '13.
Open publication reference