Home / Testing & CRO / A/B Test Sample Size Calculator

A/B Test Sample Size Calculator

Decide before you start how many visitors a test needs - so you do not stop early and ship a false winner.

%
%
20% means detecting 3% -> 3.6%.
%
%
Visitors needed per variant
-
Total visitors-
Test duration-
Variant rate to detect-
Conversions per variant (expected)-

The sample size formula

This calculator uses the standard two-sided test for the difference between two proportions:

n per variant = ( z(1-a/2) x sqrt(2 x p x (1-p)) + z(power) x sqrt(p1(1-p1) + p2(1-p2)) )^2 / (p2 - p1)^2

where p1 is the baseline conversion rate, p2 is the rate you want to be able to detect (baseline x (1 + lift)), p is their average, a is 1 minus the confidence level, and z(...) is the standard normal quantile - 1.96 for 95% confidence and 0.84 for 80% power.

Worked example

A product page converts at 3% and you want to reliably detect a 20% relative lift - from 3% to 3.6%. At 95% confidence and 80% power the formula gives 13,914 visitors per variant, or 27,828 for an A/B test. With 1,000 visitors a day the test needs 28 days. Each variant will see roughly 417 conversions over that time.

Why the lift you choose matters so much

Sample size grows with the square of the smaller difference. Halve the lift you want to detect and you need roughly four times the traffic:

BaselineLift to detectVisitors per variant (95% / 80%)
3%10%~53,200
3%20%~13,900
3%30%~6,500
10%10%~14,800
10%20%~3,800

That is why low-traffic sites should test bold changes - a new offer, a new page layout, a different price - rather than button colours. Small tweaks produce small lifts that need huge samples to prove.

Rules for a clean test

When the test finishes, check the result with the A/B test significance calculator, and translate the lift into money with the conversion rate calculator.

Frequently asked questions

How many visitors do I need for an A/B test?

It depends on your baseline conversion rate and the smallest lift you care about. A 3% baseline and a 20% relative lift needs about 13,900 visitors per variant at 95% confidence and 80% power.

What is statistical power?

The probability that the test detects a real effect of the size you specified. 80% power means that if the variant truly is 20% better, the test will show a significant result 8 times out of 10.

Can I stop a test early if it is already significant?

Not with this fixed-sample method. Repeatedly checking and stopping at the first significant result greatly increases the chance of a false winner. Decide the sample size up front and wait for it, or use a sequential testing method designed for peeking.

Embed this calculator on your site

Free for blogs, newsletters and client sites. Paste this HTML where you want the calculator - it resizes itself and works on any device. Please keep the credit line.

Get new calculators first

One short email when we add a tool or guide. No spam, unsubscribe any time.

Related tools

Testing & CROA/B Test Significance CalculatorIs your winning variant real or noise? Get confidence and uplift.Testing & CROConversion Rate CalculatorConversion rate, revenue per visitor and what a higher rate is worth.Paid adsCPM, CPC & CPA CalculatorAll your ad cost metrics - CPM, CPC, CTR, CPA, conversion rate - at once.