Tools / Analytics

A/B Test Sample Size Calculator

Calculate how many visitors your A/B test needs to detect a given lift, and how many days it will take at your traffic level.

%
%
  • Visitors needed per versioni–Enter your conversion rate and the lift to detect.
  • Total visitorsi–
  • Test lengthi–Add daily visitors
  • Conversion rate to detecti–

What these terms mean

Current conversion rate
How often visitors convert today, before any change. Take it from your analytics over a normal recent period. Example: 300 sales from 10,000 visitors is 3%.
Back to the calculator ↑
Minimum detectable effect (MDE)
The smallest improvement worth detecting, as a percentage of your current conversion rate. A 10% MDE on a 3% conversion rate means spotting a rise to 3.3%. Smaller effects need far more visitors, so pick the smallest lift that would actually change your decision.
Back to the calculator ↑
Daily visitors
How many visitors reach the page you are testing on an average day, across all versions combined. Used only to estimate how long the test will take.
Back to the calculator ↑
Confidence level
How sure you want to be that a winner is real and not luck. At 95%, you accept a 1-in-20 chance of calling a winner when there is really no difference. 95% is the usual choice. Use 90% for low-risk changes and 99% for big, expensive decisions.
Back to the calculator ↑
Statistical power
The chance your test will spot a real improvement if one exists, as long as it is at least as big as your minimum detectable effect. 80% is standard: one in five real improvements would still be missed. 90% catches more but needs more visitors.
Back to the calculator ↑
Versions, including control
How many versions you are testing, counting the original (the control). An A/B test has 2. Each extra version splits your traffic further and needs more visitors in total.
Back to the calculator ↑
Visitors needed per version
How many visitors each version must get before you look at the result. Stopping earlier, even if one version looks ahead, makes false winners much more likely.
Back to the calculator ↑
Total visitors
Visitors needed per version × number of versions: the traffic the whole test needs.
Back to the calculator ↑
Test length
How many days the test needs at your daily traffic. Run it for at least one full week, even if it reaches its sample size sooner, so every day of the week is included.
Back to the calculator ↑
Conversion rate to detect
The conversion rate your new version would need to reach for the test to reliably notice it: your current rate raised by the minimum detectable effect.
Back to the calculator ↑

How to use the sample size calculator

Enter your current conversion rate and the smallest lift that would be worth acting on. The calculator shows how many visitors each version needs. Add your daily traffic to see how many days the test will take.

Example

A checkout converts at 3% and you want to detect a 10% relative lift (to 3.3%) at 95% confidence and 80% power. You need about 53,000 visitors per version, or 106,000 in total. At 2,000 visitors a day, that's about 54 days. Aim for a 20% lift instead and the test needs about a quarter of the traffic.

The formula

n = (zα/2 × √(2p̄(1 − p̄)) + zβ × √(p₁(1 − p₁) + p₂(1 − p₂)))² ÷ (p₂ − p₁)²

Here p₁ is your current conversion rate, p₂ is the rate you want to detect, p̄ is their average, and the z values come from the confidence and power you choose.

If the number is too big

Low-traffic sites often can't reach the sample size for small lifts. Test bolder changes (which have bigger effects), test higher up the funnel where there's more traffic and a higher conversion rate, or accept 90% confidence for lower-risk decisions.

Frequently asked questions

Why do I need to calculate sample size first?
Without a set sample size, it is tempting to stop a test as soon as it looks good, which produces false winners. Deciding up front how many visitors you need keeps the result honest.
What is minimum detectable effect?
The smallest improvement you want the test to be able to spot, as a percentage of your current conversion rate. A 10% MDE on a 3% conversion rate means detecting a change to 3.3%. Smaller effects need far more visitors.
What do confidence and power mean?
Confidence (usually 95%) controls how often you would declare a winner that is not real. Power (usually 80%) is the chance the test spots a real improvement of at least your minimum detectable effect.
How long should an A/B test run?
Until each version reaches the sample size, and for at least one full week so every day of the week is included. Very long tests pick up noise from seasonality and cookie deletion.
What if I test more than two versions?
Each extra version needs its own share of traffic, and the calculator also raises the bar for significance so that comparing several versions against control does not inflate false positives.

Daily free limit reached