The most common A/B testing mistake is stopping too early. Deciding the sample size before the test starts, and sticking to it, is the simplest protection. The calculator runs in your browser and sends nothing anywhere.
The inputs
- Current conversion rate: the rate of the page or step you are testing today, from your own data.
- Smallest relative change to detect: the minimum detectable effect, as a share of the current rate. 20% on a 5% rate means detecting a move to 6%. Smaller changes need far more visitors.
- Confidence: how sure you want to be that a "significant" result is not a false alarm. 95% is the usual choice.
- Power: the chance of detecting the change if it really exists. 80% is a common choice.
The formula
The calculator uses the standard sample size formula for comparing two proportions with a two-sided test:
p1 = current rate
p2 = p1 × (1 + relative change)
p̄ = (p1 + p2) ÷ 2
zα = Φ⁻¹(1 − (1 − confidence) ÷ 2)
zβ = Φ⁻¹(power)
n per version = ( zα × √(2 × p̄ × (1 − p̄)) + zβ × √(p1 × (1 − p1) + p2 × (1 − p2)) )² ÷ (p2 − p1)²Φ⁻¹ is the inverse of the standard normal distribution; the result is rounded up to a whole visitor. The total is twice the per-version figure, since there are two versions with equal traffic.
Worked example
Hypothetical inputs: a 5% conversion rate, a 20% relative change to detect, 95% confidence and 80% power.
- p1 = 0.05, p2 = 0.06, p̄ = 0.055
- zα ≈ 1.960, zβ ≈ 0.842
- n = (1.960 × √(2 × 0.055 × 0.945) + 0.842 × √(0.05 × 0.95 + 0.06 × 0.94))² ÷ 0.01² ≈ 8,157.7, rounded up to 8,158 visitors per version
- Total: 16,316 visitors, to detect a change from 5% to 6%
Halving the change you want to detect roughly quadruples the sample. With the same inputs and a 10% relative change (5% to 5.5%), you need 31,234 visitors per version.
How to use the result
- Turn it into a duration. Divide the total by the visitors who reach the tested page in a typical week, and round up to whole weeks so every weekday is covered.
- If the number is out of reach, change the test, not the maths. Test a bigger change, test on a page with more traffic, or measure a step earlier in the funnel where conversion rates are higher.
- Pick the change you would act on. The minimum detectable effect should be the smallest improvement worth shipping, not the one that makes the sample convenient.
- Stop at the planned size, then check significance once with the A/B test significance calculator, which uses the matching two-sided test.
The formula assumes visitors are split evenly, that each visitor counts once and that conversion rates stay steady while the test runs. Launches, sales and seasonal swings break the last assumption.
Getting the inputs from Reveata
Your current conversion rate is the starting point, and it should be the rate of the exact step you are testing:
- Goal conversion rate (visitors who completed a goal out of all visitors) on the dashboard, filtered to the page under test. See custom goals.
- Funnels show conversion from one step to the next, which is the right baseline when you test a single step such as the checkout page.
- Visitors per week on that page, for turning the sample size into a duration.