A/B test sample size and duration calculator
Find out before you build a test whether your page has enough visitors to give a clear answer, and how many weeks it will take.
Your numbers
Change the numbers; the answer updates as you type.
Fixed assumptions: 95% confidence (alpha 0.05, two-sided) and 80% power. With more than one variant, alpha is split across the variants (Bonferroni). Weeks are rounded up to full weeks, with a minimum of 2, so every weekday is counted at least twice.
How to use it
- Weekly visitors: the visitors who will see the test each week, not your whole site. For a product page test, count visitors to product pages.
- Current conversion rate: the share of those visitors who do the thing you measure now, such as ordering.
- Smallest change worth detecting: the minimum detectable effect (MDE), as a relative change. 10% on a 3% conversion rate means 3.0% → 3.3%. Smaller changes need many more visitors.
- Number of variants: each extra variant splits your traffic further, so the test takes longer.
Reading the answer
- Yes, you can test this: the test finishes in four weeks or less.
- Possible, but slow: five to eight weeks. Doable, but sales, campaigns and site changes in that time make the result less clean.
- Not with this traffic: more than eight weeks. Test a bolder change, a page with more visitors, or a step closer to the click (such as add to cart). Or skip the test and fix the problem directly when the research is clear.
The maths
The calculator uses the standard formula for comparing two conversion rates (normal approximation), per version:
n = (z₁₋α/₂ + z₁₋β)² × [p₁(1 − p₁) + p₂(1 − p₂)] / (p₂ − p₁)²
Here p₁ is the current conversion rate, p₂ = p₁ × (1 + MDE), z₁₋α/₂ = 1.96 for 95% confidence and z₁₋β = 0.84 for 80% power. With more than one variant, alpha is divided by the number of variants (Bonferroni). Some calculators use a slightly different variance term, so their answers can be a few percent (up to about 10%) lower. The duration is the total sample divided by weekly visitors, rounded up to whole weeks, with a minimum of two.
More on planning and reading tests: how to read A/B test results.