Overview
Before declaring a winner in an A/B test, you need to know whether the observed difference between variants is a real effect or just random noise in the sample. This article walks through exactly how to calculate statistical significance for a two-variant test โ the z-test formula, a worked example, and the most common mistakes that lead teams to false positives.
This guide is for product managers, growth marketers, and anyone running conversion rate experiments who needs to interpret test results correctly before shipping a change.
What You Need
Before calculating significance, gather:
- Number of visitors in Variant A (control) and Variant B (test)
- Number of conversions in each variant
- Your chosen confidence threshold โ conventionally 95% (p โค 0.05), though some teams use 99% for high-stakes decisions
- Ideally, a predetermined sample size or test duration decided before the test launched
Steps
Step 1: Calculate the conversion rate for each variant
Conversion Rate = Conversions / Visitors
| Variant | Visitors | Conversions | Conversion Rate |
|---|---|---|---|
| A (control) | 5,000 | 250 | 5.0% |
| B (new design) | 5,000 | 290 | 5.8% |
Step 2: Calculate the relative uplift
Relative Uplift = (Rate B โ Rate A) / Rate A = (5.8% โ 5.0%) / 5.0% = 16%
This tells you the size of the apparent effect, but not yet whether it's statistically reliable.
Step 3: Calculate the pooled conversion rate
Pooled Rate = (Conversions A + Conversions B) / (Visitors A + Visitors B) = (250 + 290) / (5,000 + 5,000) = 5.4%
Step 4: Calculate the standard error
Standard Error = โ[Pooled Rate ร (1 โ Pooled Rate) ร (1/Visitors A + 1/Visitors B)]
Plugging in the numbers: โ[0.054 ร 0.946 ร (1/5,000 + 1/5,000)] โ 0.00321
Step 5: Calculate the z-score
Z-Score = (Rate A โ Rate B) / Standard Error = (0.05 โ 0.058) / 0.00321 โ โ1.87 (magnitude โ 1.87)
Step 6: Convert the z-score to a p-value and compare to your threshold
A z-score of approximately 1.87 corresponds to a two-tailed p-value of roughly 0.061 โ above the conventional 0.05 threshold. Despite the visible 16% relative uplift, this result would not be declared statistically significant at the standard 95% confidence level; the test would need a larger sample or longer run to confirm whether the effect is real.
Use the A/B Test Significance calculator to run this calculation directly on your own test data without doing the arithmetic by hand.
Step 7: Decide whether to continue, conclude, or extend the test
If the result is significant, you can confidently roll out the winning variant. If it's close but not yet significant (as in the example above), consider continuing the test to gather more data โ provided you decided on a stopping point in advance โ rather than stopping as soon as the result looks favourable.
Common Mistakes to Avoid
- Peeking and stopping as soon as it looks significant โ checking results repeatedly and stopping at the first significant-looking moment inflates the false positive rate well above your nominal 5%.
- Ignoring sample size requirements before launching the test โ running an underpowered test that can never reliably detect the effect size you care about wastes traffic and time.
- Confusing statistical significance with practical significance โ a tiny, statistically significant effect on a huge sample may not be worth shipping; a large but not-yet-significant effect may simply need more data.
- Testing many segments and treating any single significant cut as conclusive โ segment-level "wins" found by chance among many comparisons should be treated as hypotheses for a follow-up test, not final results.
Formula & Methodology
Pooled Rate = (Conversions A + Conversions B) / (Visitors A + Visitors B)
Standard Error = โ[Pooled Rate ร (1 โ Pooled Rate) ร (1/Visitors A + 1/Visitors B)]
Z-Score = (Rate A โ Rate B) / Standard Error
The z-score is converted to a p-value using the cumulative standard normal distribution. This two-proportion z-test assumes a reasonably large sample size (typically at least a few hundred conversions per variant) for the normal approximation to hold reliably; for very small samples, a different statistical test (such as Fisher's exact test) may be more appropriate.
Key Terms
- Statistical Significance โ a measure of confidence that an observed difference is real rather than due to chance
- Conversion Rate โ the percentage of visitors who complete a desired action
- Standard Deviation โ a measure of data variability used in calculating the standard error for significance testing
- ROAS โ Return on Ad Spend; often the downstream business metric an A/B test is ultimately trying to improve