Back to blog
Bayesian A/B Testing: How It Works and How to Read the Results

Bayesian A/B Testing: How It Works and How to Read the Results

Analyst comparing Bayesian test result distributions

A Bayesian A/B test answers the question marketers actually ask: given the data so far, how likely is it that variant B beats A, and how much could we lose if we are wrong? It starts from a prior belief about each conversion rate, updates it with every visitor and conversion, and reports a probability instead of a p-value. That makes results easier to explain to stakeholders. It does not make early stopping free, and that is where most teams get hurt.

This guide covers the mechanics, one worked example, the three numbers worth reading in a result, and the stopping rules that keep your win rate honest. When you want to run the numbers on your own test, our Bayesian A/B test calculator does it in seconds.

TL;DR

  • A Bayesian test turns a prior belief plus your conversion data into a posterior distribution for each variant, then compares the two distributions.
  • Read three outputs together: probability to beat control, expected uplift and expected loss. Probability alone ignores how costly a wrong call would be.
  • Peeking is not solved by going Bayesian. With a flat prior, "stop when P(B > A) exceeds 95%" behaves like stopping at p < 0.05 on every look.
  • Fix your threshold, minimum sample and prior before launch, and use a realistic prior for your baseline conversion rate.
  • Bayesian output is a good fit for small and mid-size traffic, where a clear risk statement beats a binary verdict.

Table of Contents

What a Bayesian A/B test actually does

Every A/B test has an unknown true conversion rate for each variant. A frequentist test asks how surprising your data would be if the two rates were identical. A Bayesian test instead treats each rate as a quantity with a probability distribution, and tells you how that distribution shifts as evidence comes in.

The standard model for conversion tests is simple. Each variant's conversions follow a binomial distribution, and each variant's rate gets an independent Beta prior. The PyMC example gallery describes this setup and notes that the Beta prior is conjugate to the binomial, which means the posterior has a closed form and needs no heavy computation. The outcome of interest is relative uplift, defined as the rate of B divided by the rate of A, minus one.

The academic treatment by Hoffmann, Hofman and Wagenmakers gives a handy way to read the prior's two parameters: α and β act as hypothetical prior successes and failures. After you observe s conversions and f non-conversions, the posterior is Beta(α + s, β + f). That is the entire update. No black box.

Priors in plain terms

The prior is what you believe before the test starts. According to PyMC, a weak prior such as Beta(1,1) implies the two variants could be very different, while a strong prior implies they are probably similar. For a landing page that converts around 3% to 4%, a prior that spreads weight over 50% conversion rates is not neutral. It is simply unrealistic, and it lets early noise swing the result.

A sensible prior for a marketer is anchored in your own baseline. If a page historically converts near 3.5%, a Beta(35, 965) prior encodes roughly 1,000 visitors' worth of belief. A lighter version, such as Beta(21, 479), carries 500. The weight you choose should reflect how much you trust history: a stable checkout page earns a stronger prior than a brand-new campaign page.

A worked example with real arithmetic

Take the landing-page example from Paolo Gironi's walkthrough. Variant A converts 90 of 1,000 visitors (9.0%). Variant B converts 120 of 1,000 (12.0%). With a flat Beta(1,1) prior, the posteriors are:

VisitorsConversionsObserved ratePosterior
A1,000909.0%Beta(91, 911)
B1,00012012.0%Beta(121, 881)

The posterior mean of a Beta(a, b) is a divided by (a + b). That gives about 9.1% for A (91 / 1,002) and about 12.1% for B (121 / 1,002). Those are nearly the observed rates, because a flat prior barely moves anything.

The point Gironi makes is the useful one: compare the two full distributions, not the two point estimates. Each posterior has width. The question is how much they overlap.

From posteriors to a probability

To get the probability that B beats A, draw many random values from each posterior and count how often B's draw is larger. If B wins in 97 of 100 draws, the probability to beat control is 97%. If you prefer no simulation, Evan Miller's formulas for Bayesian A/B testing give an exact closed-form expression for P(B > A) between two beta posteriors.

Sampling posterior rates to estimate chance B wins

Because the result is a statement about the thing you care about, it reads naturally: "there is a 97% chance B is better." Credible intervals work the same way. A 95% credible interval means there is a 95% posterior probability the true rate sits inside it, which is the sentence many people wrongly attach to a frequentist confidence interval.

The three numbers to read in a result

A single win probability is a thin basis for a launch decision. The Avira paper on Bayesian A/B testing for business decisions defines three quantities computed from posterior samples, usually for each treatment against the control:

  1. Probability to be best: the share of sample pairs in which the treatment's rate exceeds the control's.
  2. Expected uplift: the mean of the percentage increase across sample pairs, or a credible interval around it.
  3. Expected loss: the average amount you would lose by shipping the treatment in the cases where it turns out worse than control.

Read them as a set. A variant with a 96% win probability and an expected uplift of 8% is a different proposition from one with a 96% win probability, a 0.4% uplift and a tiny expected loss. The first is worth shipping for the gain. The second is worth shipping only if the change is free and you want to stop thinking about it.

Why expected loss matters

Win probability treats all mistakes alike. A 3% chance of being worse by 0.01 points and a 3% chance of being worse by 2 points look identical to it. DataInterview's explanation makes this point and works a checkout example in which the expected loss of choosing B is 0.0078 points against 1.257 points for choosing A. Expected loss lets you set a decision rule in the unit you care about: ship when the expected loss falls below a conversion-rate amount you could live with, for instance a hundredth of a percentage point.

The same page describes a stricter option, a region of practical equivalence (ROPE) around zero effect. At 2,400 visitors per arm, a test can be undecided under that rule even when P(B > A) is 0.97, because the plausible effect range still includes differences too small to matter. For ecommerce owners, this is a useful filter against shipping changes that win on paper and move nothing.

Bayesian versus frequentist, without the tribalism

The two approaches report different things. Frequentist output is a p-value and confidence interval tied to a fixed sample plan. Bayesian output is a probability statement about the variants given the data and the prior. Most marketers find the second easier to act on, and that is a real advantage when you present to a team that does not speak statistics. For a longer side-by-side, see our guide to Bayesian vs frequentist testing.

The academic picture is more nuanced than the debate suggests. An overview of Bayesian inference procedures for A/B testing by Schultzberg and Frånberg argues the two families are more alike than commonly believed. Under a flat prior, the posterior mean equals the maximum-likelihood estimate. And a frequentist sequential test that uses a normal mixing distribution is, in Bayesian terms, placing a normal prior on the treatment effect. The practical lesson: the label on the method matters less than the stopping rule, the prior and the discipline around both.

The peeking problem does not disappear

The most common myth is that Bayesian tests can be checked and stopped at any time with no penalty. The same overview reports that with a flat prior, optional stopping is identical to naive frequentist peeking: stopping when P(B > A) exceeds 0.95 is the same rule as stopping when p falls below 0.05, and its simulation shows a false-positive rate of 0.303 in both cases.

That is roughly one false winner in three tests when you check repeatedly and take the first crossing. Teams who adopt Bayesian reporting because "we can look whenever we want" often discover their winners do not replicate.

A practical way to stay safe:

  • Decide the threshold before launch. Changing a threshold after you have seen the results leaves the error rate of your stopping rule unknown.
  • Set a minimum sample or minimum duration. Run at least one or two full weekly cycles so weekday and weekend behavior both appear.
  • Use a prior that fits your baseline. A realistic prior keeps early results stable, because a handful of early conversions cannot drag the estimate far.
  • Stop on expected loss plus a minimum sample, not on win probability alone.
  • Pre-register what "win" means. Write down the metric, the threshold and the maximum run time in your test brief.

For larger programs, the overview describes a stricter option: an empirical Bayes prior calibrated on a corpus of your past experiments, which controls the false discovery rate across experiments. It needs a real history of tests, so it suits mature teams rather than a first experiment.

How much traffic do you need?

Bayesian tests do not remove the need for data. They change how you describe uncertainty, not how much of it a given sample leaves behind. Low-traffic pages will produce wide posteriors, and wide posteriors yield modest win probabilities and non-trivial expected loss. That is the method working correctly.

Understanding a Bayesian Model for A/B Testing

What the Bayesian framing gives low-traffic teams is a more useful report. Instead of "not significant," you can say "B is 82% likely to be better, and the expected loss if we ship it is small." For a low-risk change like button copy, that may be enough to act on. For a pricing change, it is not. Setting the bar by cost of being wrong, rather than by a universal 95%, is the strongest practical argument for Bayesian decisions. If you want ideas worth that kind of low-risk testing, our list of A/B test ideas for marketers is a good place to start.

When Bayesian is the right call

Bayesian analysis fits well when:

  • You run tests on pages with modest traffic and want a clear statement of risk.
  • Your stakeholders need a plain-language result.
  • You have solid historical baselines to build a prior from.
  • You want to compare several variants and rank them by probability of being best.

It is no magic fix for unclear hypotheses or for tests stopped on a gut feeling. Good experiments still start with a hypothesis, one primary metric and a run plan. If you are building your testing roadmap, these conversion rate optimization tips cover the wider context of landing pages, ads and conversion flows, and our high-impact A/B testing examples show what well-scoped tests look like.

A step-by-step routine for your next test

  1. Define the metric. Pick one primary conversion event, such as purchase or signup, and the population it applies to.
  2. Set the prior. Use your baseline rate and decide how many past visitors' worth of belief to encode. Document it.
  3. Set the decision rule. For example: ship B if expected loss is below 0.05 percentage points and at least two full weeks have passed.
  4. Launch and split traffic evenly. Keep targeting identical for both variants.
  5. Read the three numbers at the planned checkpoint: win probability, expected uplift and expected loss.
  6. Decide and log. Record the result, the posterior and what you shipped, so the next prior has real data behind it.

A visual editor and clean goal tracking make steps 4 and 5 much faster, because you can launch variants without waiting on developers and watch the metric update in real time.

Our perspective

We think Bayesian reporting is the right default for marketers, because it speaks the language of decisions: how likely is B to be better, and what does it cost if we are wrong?

But the statistics only help if the test itself is cheap to launch and fast to load. A heavy testing script can distort the very conversion rate you are trying to measure. That is why we built Stellar around a lightweight 5.4KB script, a no-code visual editor and real-time analytics, so that marketers can run experiments without developer time and without slowing the page.

Our advice is the same whatever tool you use: pick a realistic prior, write your stopping rule before launch, and judge a result by uplift and expected loss, not by a single probability.

Juan

Run your first Bayesian test with Stellar

Stellar is an A/B testing platform for marketers and growth teams. It includes a no-code visual editor for web and mobile, advanced goal tracking, real-time analytics dashboards and direct integrations with WordPress, Shopify, Webflow, Wix, Squarespace, Framer and Bubble. Pricing is based on monthly tracked users: the Sandbox plan is $0 per month, Plus is $29 per month, Pro is $99 per month and Scale is $399 per month, with Enterprise available on request. The free tier is built for businesses under 25,000 monthly tracked users, so you can start on a real page with real traffic. See the plans at gostellar.app.

Gostellar

If you want to sanity-check numbers from an existing experiment first, paste them into our Bayesian A/B test calculator. For more on stopping rules, our guide to Bayesian probability and stopping rules for product teams goes deeper, and interpreting statistical significance helps when your stakeholders still think in p-values.

FAQ

What is a Bayesian A/B test?

It is a split test analyzed with Bayes' rule. You start with a prior belief about each variant's conversion rate, update it with observed visitors and conversions, and get a posterior distribution for each. You then compare the distributions to get the probability that one variant beats the other.

What is the difference between Bayesian and frequentist A/B testing?

Frequentist testing reports a p-value and confidence interval based on a fixed sample plan. Bayesian testing reports probabilities about the variants themselves, such as the chance B is better and the expected loss. Research suggests the two are closer than they look: with a flat prior, stopping at 95% win probability behaves like stopping at p < 0.05.

Can I stop a Bayesian test as soon as it hits 95%?

Not safely. A simulation in a 2026 overview of Bayesian A/B procedures found a false-positive rate of 0.303 for flat-prior optional stopping. Set your threshold and minimum run time before launch, use a prior suited to your baseline, and consider expected loss as the stopping quantity.

How do I choose a prior?

Anchor it on your historical conversion rate. If a page converts near 3.5%, a Beta(35, 965) prior carries about 1,000 visitors' worth of belief, while Beta(21, 479) carries 500. Use a stronger prior for stable pages and a lighter one for new ones, and write the choice into the test brief.

Sources

Recommended