A/B test significance and sample size calculator
Check if an A/B test result is statistically significant, with the p-value and lift, or work out the sample size a test needs before you start it.
Result
B wins at 95% confidence
If A and B truly converted the same, a gap this large would show up by chance 1.75% of the time. That is below the 5% you allowed.
- Conversion rate A
- 3.00%
- Conversion rate B
- 3.60%
- Relative lift
- +20.0%
- +0.60 pts absolute
- p-value
- 0.0175
- z = 2.38
95% interval for the difference (B − A): +0.10 pts to +1.10 pts.
An A/B test is significant when the gap between the two conversion rates is too large to be likely by chance: here, when the p-value of a two-proportion z-test is below 1 minus your confidence level (0.05 at 95%). The sample size mode answers the question to ask first: how many visitors each variant needs before that test can find the change you care about.
Enter visitors and conversions for each variant to get the p-value, the relative lift and its interval. Switch to sample size before a test starts, and to significance once it has reached the size you planned.
How do you calculate A/B test significance?
With a two-proportion z-test, the standard test for comparing two conversion rates. It asks how far apart the rates are, measured in standard errors, if both variants really converted at the same rate.
Formula
rate A = conversions A ÷ visitors Arate B = conversions B ÷ visitors Bpooled rate = (conversions A + conversions B) ÷ (visitors A + visitors B)standard error = √(pooled × (1 − pooled) × (1 ÷ visitors A + 1 ÷ visitors B))z = (rate B − rate A) ÷ standard errorp-value = 2 × (1 − Φ(|z|)) two-sided= 1 − Φ(z) one-sided, B better than A
Φ is the standard normal cumulative distribution. The result is significant when the p-value is below your alpha: 0.10, 0.05 or 0.01 for 90%, 95% or 99% confidence. The calculator also gives a confidence interval for the difference, using the unpooled standard error.
A worked example
| Row | Variant A | Variant B |
|---|---|---|
| Visitors | 10,000 | 10,000 |
| Conversions | 300 | 360 |
| Conversion rate | 3.00% | 3.60% |
- Pooled rate. 660 ÷ 20,000 = 3.3%.
- Standard error. √(0.033 × 0.967 × (1 ÷ 10,000 + 1 ÷ 10,000)) = 0.00253.
- z. (0.036 − 0.030) ÷ 0.00253 = 2.38.
- p-value. Two-sided, 2 × (1 − Φ(2.38)) = 0.0175.
- Verdict. 0.0175 is below 0.05, so B wins at 95% confidence. It is not below 0.01, so it would not pass at 99%.
B’s relative lift is 20%: 0.6 percentage points on a 3% baseline. The 95% interval for the difference runs from about +0.10 to +1.10 points, so the true lift could be much smaller than the 20% you observed.
How many visitors does an A/B test need?
It depends on three choices: your baseline conversion rate, the smallest change worth detecting (the minimum detectable effect), and how sure you want to be in both directions. The sample size mode uses the normal approximation for two proportions:
Formula
n per variant = (z₁ × √(2 × p̄ × (1 − p̄)) + z₂ × √(p₁(1 − p₁) + p₂(1 − p₂)))² ÷ (p₂ − p₁)²p₁ = baseline rate, p₂ = the rate you want to detect, p̄ = (p₁ + p₂) ÷ 2z₁ = 1.96 at 95% two-sided, z₂ = 0.84 at 80% power
| Baseline | Change to detect | Visitors per variant (95%, 80% power) |
|---|---|---|
| 10% | To 12% (20% relative) | 3,841 |
| 3% | To 3.3% (10% relative) | 53,211 |
| 3% | To 3.6% (20% relative) | 13,914 |
Halving the effect you want to detect roughly quadruples the visitors you need: on a 3% baseline, a 5% relative lift takes 207,938 visitors per variant against 53,211 for 10%. That is why tests on small changes to low-converting pages take so long, and why a test of a bold change is often the better use of your traffic.
To turn the sample size into a run time, enter your daily visitors: the calculator divides the total by them. Round up to whole weeks, so weekday and weekend visitors are both in the test.
How do you read the result?
A p-value of 0.03 means: if A and B truly converted the same, a gap at least this large would appear about 3% of the time. It is not the chance that B is better, and it says nothing about how large the lift is. Read the relative lift and its interval for that.
- Significant, lift worth having. Ship B. Expect the real lift to be somewhere in the interval, often lower than observed.
- Significant, lift too small to matter. A large sample makes tiny differences significant. Significance is not importance.
- Not significant at the planned size. You have not shown a difference. Either it is smaller than your minimum detectable effect, or there is none.
- Not significant, test cut short. You have learned little. Run it to the planned size.
What CrispStats does and does not do here
CrispStats does not run A/B tests: it does not split traffic, assign variants or pick winners. Use your testing tool for that. What it can do is count the outcome: a goal or a custom event for the conversion, and funnels to see where each step loses people. To get each variant’s rate from raw counts, use the conversion rate calculator; to put a value on a lift, the revenue per visitor calculator shows what a higher conversion rate is worth a month.
Terms used here
Guides
- Conversion funnel analysis: how to find the step where visitors leaveA conversion funnel is the ordered steps to a goal. How to define one, read step and overall conversion, pick the step to fix, and avoid the usual mistakes.
- How to calculate conversion rate, with worked examplesConversion rate is conversions divided by visitors, times 100. Worked examples for funnels, delayed conversions, channel mix and how many visitors you need.
- Which marketing channel drives revenue? Answer it with revenue per visitorHow to find which channel drives revenue: compare revenue per visitor by source, not totals, with a worked example, a cost check and a test for small numbers.
More free tools
All free tools- Conversion rate calculatorTurn visitors and conversions into a conversion rate, and see how many more conversions a target rate needs.
- CTR calculatorGet click-through rate from clicks and impressions, plus cost per click and CPM when you add the spend.
- CPC calculatorGet the cost of one click from the spend and the clicks, and see what a budget still buys.
- CPM calculatorSolve for CPM, total cost or impressions: enter any two and get the third.
- ROAS calculatorWork out return on ad spend, the ROAS you need to break even, and the profit left after the ads.
- ROI calculatorSee the profit on a spend as a percentage of the cost, from the revenue and the cost.
- Revenue per click calculatorSee what one click is worth in revenue, then set it next to the cost of that click.
- CPL calculatorGet the cost of one lead from the spend and the number of leads that spend produced.