MoneyDigital Marketing

A/B Test
calculator.

Check whether version B of a page really beats version A, or plan how long a split test needs.

How it's worked out

In a split test, some visitors see the current version, A, and some see a change, B. You count visitors and conversions for each. Because people convert at random, B can look better by luck, so the question is how surprising the gap would be if the two were really the same.

p‾\displaystyle \bar{p}=cA+cBnA+nB\displaystyle {}= \frac{c_A + c_B}{n_A + n_B}
z\displaystyle z=pˆB−pˆAp‾(1−p‾)(1nA+1nB)\displaystyle {}= \frac{\hat{p}_B - \hat{p}_A}{\sqrt{\bar{p}(1 - \bar{p})\left(\frac{1}{n_A} + \frac{1}{n_B}\right)}}

Here c is conversions, n is visitors and each p with a hat is a conversion rate. The pooled rate, p with a bar, is the rate you would expect from both if they were equal. This is the two-proportion z-test in the NIST handbook. The p-value is the chance of a z at least this far from zero, in either direction, if A and B convert alike. The result is significant when the p-value is below 1 minus your confidence level.

The confidence interval for the gap uses each rate on its own standard error, not the pooled one. For the Bayesian view, each rate starts from a flat prior and becomes a beta distribution after the data. The chance that B beats A comes from the exact sum Evan Miller published, so it needs no simulation. Expected loss, as Chris Stucchio defines it, is how much conversion rate you give up on average by picking a version if it is really the worse one.

To plan a test, you choose the smallest lift worth finding, the confidence and the power. Power is the chance the test finds the lift if it is real. The sample size formula then gives the visitors each version needs, where p1 is your current rate, p2 the rate with the lift, and V the spread of the two.

V\displaystyle V=p1(1−p1)+p2(1−p2)\displaystyle {}= p_1(1 - p_1) + p_2(1 - p_2)
n\displaystyle n=(z1−α/2+z1−β)2V(p2−p1)2\displaystyle {}= \frac{(z_{1-\alpha/2} + z_{1-\beta})^{2}\, V}{(p_2 - p_1)^{2}}

Worked examples

A new checkout button

A shop shows the old checkout button to 5,000 visitors and gets 175 orders, 3.5%. The new button gets 220 orders from 5,000, 4.4%. The lift is +25.7%, with z = 2.310 and p = 0.0209, so the result is significant at 95%.

The 95% interval for the gap runs from 0.14 points to 1.66 points, so the true lift could be small. The Bayesian view gives B a 99% chance of being better, and shipping it risks an expected loss of only 0.0014 points. At 99% confidence the same data would not pass.

Open this example in the tool

A promising lift that is not proven yet

A landing page test has 96 and 110 sign-ups from 2,400 visitors each. B is ahead by +14.6%, but p = 0.3187 and the interval, −0.56 points to 1.73 points, includes zero.

B has an 84% chance of being better, which sounds good but leaves a real risk. With 2,400 visitors per version, this test could only expect to find a lift of about 43% or more, 80% of the time. It was too small to settle a gap like this one, so let it run to a planned size.

Open this example in the tool

Planning a headline test

A page converts at 2.8%, and the team wants to find a 15% lift, to 3.22%, with 80% power at 95% confidence. Each version needs 25,976 visitors, 51,952 in total. At 800 visitors a day that takes 65 days.

Aiming for a bolder change, a 30% lift, cuts the need to 6,930 per version and 18 days. Chasing 7.5% instead needs 100,399 per version. Halving the lift roughly quadruples the sample, which is why low-traffic pages should test big changes.

Open this example in the tool

Reading your result

Significant does not mean big. It means a gap this size would be rare if A and B were the same. Read the interval too: if its low end is a gain too small to matter, the change may not be worth shipping.

The two views answer different questions. The p-value asks how surprising the data would be with no real difference. The chance that B beats A asks how likely B is better, given the data and a flat prior. A test can give an 84% chance to win and still be far from significant, as in the second example.

More versions mean more false alarms. Each comparison at 95% confidence has a 5% chance of a false positive. Adobe's guide works through five offers, four compared with the control, and finds an 18.5% chance of at least one false positive. Name one main metric before you start, or test fewer versions.

Common mistakes

  • Peeking and stopping early. Evan Miller simulated a test with no real effect that is checked often and stopped at the first significant reading. It reported a winner 26.1% of the time, more than five times the 5% the threshold promises. Fix the sample size first, then read the result once.
  • Stopping partway through a week. Weekday and weekend visitors behave differently. Adobe rounds test length up to whole weeks to keep day-of-week effects out of the result.
  • Counting sessions instead of people. The test assumes each visitor is counted once and acts on their own. If one person visits ten times, count the person, not the visits.
  • Planning for a lift you cannot afford to detect. The headline test needs 65 days for a 15% lift. If your traffic cannot supply the visitors, test a bolder change or a step with a higher rate.

Questions people ask

Until it reaches the sample size you planned, rounded up to whole weeks. Divide the total visitors needed by the visitors who enter the test each day. Adobe recommends 95% confidence and 80% power as a general guideline when you plan it.

Sources