A/B Test Sample Size Calculator

Work out how many visitors each variant needs before an A/B test can detect the improvement you care about, and how long that will take.

%
%
Relative. 15% means 3.2% rising to 3.68%.
Visitors needed per variant 22,631
n per variant = (Z_α√(2p̄q̄) + Z_β√(p₁q₁ + p₂q₂))² ÷ (p₂ − p₁)²
Total visitors needed 45,262
Days at your traffic 38
Rate you are testing for 3.68 %
Absolute difference being detected 0.48 pp
Reading About 38 days — plan for 6 full weeks.

Everything you type here is processed on your own device. No input is sent to a server, logged, or stored.

What the A/B Test Sample Size Calculator does

The A/B test sample size calculator on this page will work out how many visitors each variant needs before an A/B test can detect the improvement you care about, and how long that will take. Fill in all 5 fields and the result updates as you type — there is no Calculate button to press and no page reload. It is most often used for deciding whether a test is worth starting at the traffic you have. If you want to cross-check the result, there is another A/B test sample size calculator on FreeToolsWorld.org.

How to use it

  1. Enter the conversion rate you get today.
  2. Set the smallest improvement that would actually change your decision.
  3. Read the per-variant sample, then the days it needs at your traffic.

How it works

The sample size of an A/B test is decided before it starts, not when the result looks good. That is the entire point of calculating it: the number tells you how much evidence is needed to distinguish a real effect of the size you care about from the noise that any two groups produce by chance. Watching a running test and stopping it the moment p drops below 0.05 is a different procedure with a much higher false-positive rate — somewhere around 20 to 30% rather than the 5% the number implies — because you have given yourself many chances to catch a random dip.

Three inputs drive the answer and one dominates it. Sample size scales with the inverse square of the effect you want to detect, so halving the detectable lift quadruples the visitors needed. A test looking for a 15% relative improvement on a 3.2% baseline needs a few thousand per variant; the same test looking for 3% needs twenty-five times as many. This is why small sites cannot meaningfully test small changes, and why the honest move is often to test a bolder change rather than to run an underpowered test on a subtle one.

Power is the input people skip and it is not optional. At 80% power — the convention — a test that runs to its full sample still misses a real effect one time in five. The confidence level governs false positives; power governs false negatives; and a test designed with neither in mind is simply a coin flip with extra steps. Run for whole weeks rather than whole days whatever the number says, because weekday and weekend traffic convert differently and a test that ends on a Wednesday is weighted towards whichever days it happened to cover.

When to use it

  • Deciding whether a test is worth starting at the traffic you have.
  • Working out how long a planned test needs to run before anyone looks at it.
  • Showing why an underpowered test cannot answer the question being asked of it.
  • Choosing between testing a subtle change and a bolder one.

Common mistakes to avoid

  • Stopping the test when the p-value first dips below 0.05. Peeking inflates the false-positive rate several times over.
  • Confusing relative and absolute lift. A 15% relative lift on a 3.2% baseline is 0.48 percentage points, not 15.
  • Ignoring power. At 80%, a real effect is missed one run in five.
  • Ending mid-week. Run whole weeks so every day of the week is represented equally.

Frequently asked questions

Why does a smaller lift need so many more visitors?

Sample size scales with the inverse square of the effect. Halving the lift you want to detect multiplies the sample by four, and a tenth of the lift needs a hundred times the traffic.

Can I stop early if the result looks clear?

Not without changing what the result means. Repeatedly checking a running test and stopping on a good number raises the false-positive rate from 5% to roughly 20–30%. Sequential testing methods exist for this, and they require planning in advance.

Is 80% power enough?

It is the convention rather than a rule. It accepts missing a real effect one time in five. If the change is expensive to implement or hard to re-test, 90% is a better trade even though it costs more traffic.

Should I count visitors or sessions?

Whichever your randomisation unit is — usually visitors. If a person can see both variants across sessions, the test is broken before the maths starts.

Related tools

See all math & statistics calculators →