The formula
Conversion rates: p_A = conversions_A ÷ visitors_A; p_B = conversions_B ÷ visitors_B
Pooled rate p = (c_A + c_B) ÷ (n_A + n_B); SE = √(p(1 − p)(1/n_A + 1/n_B))
z = (p_B − p_A) ÷ SE; two-sided p-value = 2 × (1 − Φ(|z|))
Relative lift = (p_B − p_A) ÷ p_A; 95% CI for the difference = (p_B − p_A) ± 1.96 × √(p_A(1 − p_A)/n_A + p_B(1 − p_B)/n_B)
Worked example
- A: 420 conversions from 10,000 visitors (4.20%). B: 495 from 10,000 (4.95%).
- Pooled rate = 915 ÷ 20,000 = 4.575%; SE = √(0.04575 × 0.95425 × 0.0002) = 0.002955.
- z = 0.0075 ÷ 0.002955 = 2.54, so the two-sided p-value is 0.011: significant at 95%.
- B's relative lift is +17.9%, with a 95% confidence interval of about 0.17 to 1.33 percentage points.
What statistical significance means
When two versions of a page, email or app screen get different conversion rates, some of the difference is due to chance: which visitors happened to see each version. A significance test asks how likely a difference at least this large would be if the two versions actually performed the same. That probability is the p-value. If it's below your chosen threshold, such as 5% for 95% confidence, the result is called statistically significant. It doesn't prove B is better by exactly the observed amount; it means the difference is unlikely to be pure noise.
The two-proportion z-test
For conversion rates, the standard method is the two-proportion z-test. It compares the difference between the two rates with the standard error you'd expect from random variation, given the sample sizes. A z-score of about ±1.96 corresponds to a two-sided p-value of 0.05. The test works well when each variant has at least a few dozen conversions and non-conversions. For very small numbers, Fisher's exact test is more reliable; for revenue per visitor or other continuous metrics, a t-test is appropriate.
Confidence intervals and lift
The p-value tells you whether there's a difference; the confidence interval tells you how big it might be. A 95% interval of 0.17 to 1.33 percentage points means the true improvement could plausibly be small or quite large. Relative lift expresses the difference as a percentage of the control rate: going from 4.2% to 4.95% is a 17.9% lift. Always look at the interval as well as the headline lift, especially when deciding whether a change is worth the cost of implementing it.
Power and sample size
Statistical power is the probability that a test detects a real effect of a given size. Tests with too few visitors are underpowered: they often miss real improvements and, when they do find a significant result, tend to exaggerate its size. Aim for at least 80% power for the smallest improvement you care about. The calculator shows the power for the observed effect and the visitors per variant needed for 80% power. Detecting small lifts on low conversion rates often requires tens of thousands of visitors per variant.
Common A/B testing mistakes
The biggest mistake is peeking: checking results repeatedly and stopping as soon as they look significant, which dramatically increases false positives. Decide the sample size or duration in advance and run full weeks to cover weekday and weekend behaviour. Other pitfalls include testing many metrics or variants without adjusting for multiple comparisons, ending tests during unusual periods such as sales, and failing to check that traffic was split evenly between variants (sample ratio mismatch). For more on sample sizes, see our sample size calculator.
One-sided versus two-sided tests
A two-sided test checks for any difference, better or worse, and is the safer default. A one-sided test only checks whether B is better, which gives more power but can't detect harm, so use it only when you'd never ship a worse variant anyway and decided before the test. The confidence level is your tolerance for false positives: 95% is standard, 90% is sometimes used for low-risk changes and 99% for important decisions. For related statistics, try the margin of error calculator and the standard deviation calculator.