A/B Test Calculator: Significance, Lift, Sample Size and Bayesian Odds
By FindMySum · Last reviewed
This A/B test calculator tells you whether the difference between two versions of a page, email or ad is likely to be real or just noise. Enter the visitors and conversions for the control (A) and the variant (B) to get both conversion rates, the absolute and relative lift, the z-score and p-value of a two-proportion test, a confidence interval for the difference and a check that traffic was split as planned. Switch to the Bayesian method for the probability that B is better, and open the planner to work out how many visitors a test needs before you start.
Worked example: 500 against 570 conversions
The calculator opens with 10,000 visitors in each group: 500 conversions in A and 570 in B.
- Conversion rates. A: 500 ÷ 10,000 = 5.0%. B: 570 ÷ 10,000 = 5.7%.
- Lift. B is 0.7 percentage points higher, a relative lift of 0.7 ÷ 5.0 = 14%.
- Pooled rate. If A and B were the same, the best estimate of the common rate is (500 + 570) ÷ 20,000 = 5.35%.
- Standard error. √(0.0535 × 0.9465 × (1/10,000 + 1/10,000)) = 0.318 percentage points.
- z-score. 0.7 ÷ 0.318 = 2.20.
- p-value. The chance of a z at least that far from zero in either direction is 0.028.
- Decision. 0.028 is below 0.05, so the lift is significant at 95% confidence. It is not significant at 99% (α = 0.01).
The 95% confidence interval for the difference, using each group's own variance, runs from 0.08 to 1.32 percentage points: the data support a real improvement, but it could be anywhere from tiny to about a 26% relative lift. The Bayesian method puts the probability that B's true rate is higher at about 98.6%.
The two-proportion z-test
Each visitor either converts or doesn't, so a conversion rate is a proportion. When the samples are large, the
difference between two sample proportions is close to normally distributed, and the z-test measures how many
standard errors the observed difference is from zero. Under the null hypothesis that both versions convert at the
same rate, the best estimate of that rate pools the two groups, which is why the standard error uses p̄. This is
the test in the NIST/SEMATECH e-Handbook, and its p-value is the same as a chi-square test on the 2 × 2 table
without Yates' continuity correction (R's prop.test(correct = FALSE)).
The confidence interval is built differently, around the observed difference rather than around zero, so it uses each group's own rate: √(pA(1 − pA)/nA + pB(1 − pB)/nB). That is the usual Wald interval. Because the two standard errors differ slightly, a result right at the edge of significance can have a p-value just under 0.05 and an interval that just touches zero, or the reverse.
One-sided or two-sided
A two-sided test asks whether B is different from A in either direction. A one-sided test asks only whether B is better, and its p-value is half as large. Use it only when you decided in advance that a worse B would be treated the same as no difference, and never switch after seeing the data. Most experimentation teams use two-sided tests by default.
Checking the traffic split
Before trusting any result, check that the groups are the sizes you planned. If a 50/50 test ends with 50,000 and 49,000 visitors, the gap of 1,000 is more than chance allows: a chi-square test gives p ≈ 0.0015. Ronny Kohavi and colleagues, who ran experimentation at Microsoft, Amazon and Airbnb, call this a sample-ratio mismatch and treat it as a sign of a bug, such as a redirect that loses some visitors, bots filtered in one version only, or tracking that fails on one design. The calculator flags p-values below 0.001, the threshold used in their book's examples; some platforms use 0.0005. A mismatch doesn't tell you which group is wrong, only that the comparison is no longer fair.
Planning the sample size
Running a test until it "looks significant" is the most common way to get false winners. Plan the size first: open
the planner and enter the baseline conversion rate, the smallest relative lift that would be worth acting on, the
confidence level and the power (the chance of detecting the lift if it is real). The formula is the standard normal
approximation in Fleiss, Levin and Paik's textbook, the one R's power.prop.test solves. A 5% baseline and a 10%
relative lift need 31,234 visitors per variant at 95% confidence and 80% power, and 41,813 at 90% power. Small
effects on low baselines need very large samples: a 5% lift on a 3% baseline at 99% confidence needs more than
309,000 visitors per variant.
The Bayesian view
The Bayesian option starts from a flat prior, treating every conversion rate as equally likely, and updates it with the data. Each rate's belief becomes a beta distribution, Beta(1 + conversions, 1 + non-conversions), and the calculator works out the exact probability that a draw from B's distribution beats one from A's, using a closed-form sum published by Evan Miller. It agrees with a two-million-draw simulation to four decimal places. Above 200,000 conversions the sum would be slow, so a normal approximation is used and labelled.
The probability is easier to explain than a p-value, but it is not a licence to stop whenever it crosses 95%: peeking inflates errors in Bayesian tests too, and a 95% chance that B is better says nothing about how much better.
What the calculator does not do
It compares two groups on a yes-or-no metric with a fixed sample. It doesn't correct for several variants or several metrics, handle revenue or other continuous measures, support sequential designs with planned interim looks, or apply variance-reduction methods such as CUPED. For those, use a dedicated experimentation platform or a statistician.
More questions
Why is 95% confidence the usual standard?
It is a convention from scientific practice: a 5% chance of a false positive when there is no real effect. Nothing makes 95% special. A team running dozens of tests a year will see some false winners at 95%, and for a costly or hard-to-reverse change 99% is safer. For a cheap, easily reversed tweak, 90% can be reasonable.
What does a confidence interval that crosses zero mean?
That the data are consistent with B being slightly worse, no different or better than A. With 100 conversions from 1,000 visitors against 120 from 1,000, the 90% interval for the difference runs from −0.30 to +4.30 percentage points, so the test can't rule out no effect. The interval also shows the plausible size of the effect, which a p-value alone does not.
Can I test more than two variants at once?
Yes, but each extra comparison against the control adds another chance of a false positive. With four variants compared at α = 0.05, the chance that at least one looks significant by luck is about 19%. A Bonferroni correction (divide α by the number of comparisons) is the simplest fix; this calculator compares two groups only.
Does this calculator work for revenue per visitor?
No. The z-test here is for conversion rates, where each visitor either converts or not. Revenue, order value and time on site are continuous and usually very skewed, so they need a t-test on the per-visitor values (or a bootstrap), not a test of proportions.
Why did my significant winner not hold up after launch?
Several reasons are common: the result was a false positive (one in twenty at 95%), the test was stopped early when it first looked good, the novelty of a change wore off, or the test ran in an unusual week. The measured lift of a winning test also tends to overstate the true effect, because the tests that happened to come out high are the ones that get picked.
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods, 7.3.3: How can we determine whether two processes produce the same proportion of defectives?
- Kohavi, Tang and Xu, Trustworthy Online Controlled Experiments (Cambridge University Press, 2020)
- Evan Miller: Formulas for Bayesian A/B Testing
- statsmodels documentation: proportions_ztest
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.