A/B test sample size calculator

How many visitors each version needs for a valid test, from your baseline and target lift.

Required sample size

8,150
visitors per variation
16,300
total visitors (both variations)

Humblytics splits the traffic for you and shows confidence as visitors arrive, so you see when a test has enough data. See A/B testing →

Why you need this many visitors

Every test result is a sample, and samples are noisy. Move across the figure to watch the two possible results pull apart as visitors add up. It uses the numbers in the calculator above.

A: controlB: variantEach ball is one possible result of the same test. Hopper A drops at your baseline (5.00%), hopper B at the lift you want to detect (6.00%); the pegs add the noise a finite sample really has. With few visitors the piles overlap and a real lift is easy to miss. At 8,150 visitors per version they sit far enough apart that 80% of tests would find it at 95% significance.

How sample size works

n = 2 × p̄(1 minus p̄) × (zα + zβ)² ÷ (p2 minus p1)²

n is visitors per version. p1 is your baseline rate, p2 is the rate you want to detect, p̄ is their average, zα is 1.96 at 95% significance and zβ is 0.84 at 80% power. The number that matters most is the lift: halve it and you need about four times the visitors.

Planning numbers from published research

Tests that win on the main metric
12%
Median lift of a winning test
7.5%
Realistic lift to plan for
5% to 10%
Shortest run
two full weeks

Sources: Optimizely, across 127,000 experiments; Analytics Toolkit, 1,001 tests, 2022; Convert; Analytics Toolkit median planned MDE 6%; CXL; Optimizely and VWO set a one-week floor.

How do I calculate sample size for an A/B test?

Enter your current conversion rate and the smallest lift you care about. The calculator uses the two-proportion formula at your chosen significance and power and returns visitors per version. At a 5% baseline and a 20% lift, that is 8,150 per version.

What is a minimum detectable effect?

The smallest relative change the test can reliably catch. A 20% MDE on a 5% baseline means detecting a move to 6%. Smaller MDEs need far more visitors.

What sample size do I need for 95% confidence?

It depends on the baseline and the lift. At a 5% baseline with 80% power: about 8,150 visitors per version for a 20% lift, and 31,200 for a 10% lift.

What is statistical power?

The chance the test finds a real effect when there is one. 80% is the usual setting: one real winner in five would still look like no difference.

Why does a lower conversion rate need more visitors?

Fewer visitors convert, so each one carries less information. The conversions you need stay roughly the same, so a site converting at 2% needs about twice the visitors of one at 4% for the same lift.

Can I stop the test once it reaches significance?

No. Checking daily and stopping at the first significant day raises false winners. Decide the sample size first and read the result once you reach it.

Worked example

  1. 1Your product page converts at 5%. You want to detect a 20% lift, from 5% to 6%.
  2. 2At 95% significance and 80% power the formula gives 8,150 visitors per version.
  3. 3Two versions: 16,300 visitors in total, about 408 conversions per version.
  4. 4Plan for a 10% lift instead and it rises to 31,200 per version.

Halving the lift you want to detect roughly quadruples the visitors. Put your daily traffic into the test duration calculator to turn this into days.

How to read your result

Per version
Each version needs this many visitors. With three versions, multiply by three.
Too many visitors for your traffic
Test a bigger change (a new offer or layout rather than a button colour), or test on a page with more traffic.
Conversions, not visitors
The conversions each version needs barely move with your baseline rate, so think in conversions a month when you plan a testing program.
After you reach it
Check the result once in the significance calculator. Reading it every day and stopping early inflates false winners.

Sources

Free to start · 5,000 data points, no card

Stop calculating. Start testing.

You know the sample size, now launch the test. Humblytics lets you create and run A/B tests visually, without writing code or filing developer tickets.

No card. Team plans from $79 a month. Book a demo