A/B Test Sample Size Calculator

Work out how many visitors an A/B test needs before you start, and roughly how many days that takes on your traffic.

How to use

What it checks and how it works

The tool uses the normal-approximation formula for comparing two proportions with an equal split, as documented in the NCSS PASS chapter on tests for two proportions: the sample per version grows with the spread of the two rates and with the square of the z-values for the significance level and the power, and shrinks with the square of the gap between the rates. Halving the change you want to detect roughly quadruples the visitors you need. It is a planning figure. It assumes two versions, one primary metric and a decision made once the planned sample is reached. More variants or metrics need a larger sample or a correction for multiple comparisons. Defaults of 5% significance and 80% power are conventions, not rules; choose values that match the cost of a wrong call.

What is power?

Power is the chance that the test detects a difference of the size you specified, if it really exists. At 80%, one test in five of that size of effect would still miss it.

Why does a small lift need so many visitors?

The sample needed grows with the square of how small the gap is. Detecting a 1% lift takes about a hundred times the visitors of detecting a 10% lift.

My site has too little traffic. What can I do?

Test a bigger change, test a page or step with more traffic, or measure a metric earlier in the funnel. A test that cannot reach its sample size is not worth starting.

Sources

Related tools

Privacy

Runs in your browser; nothing is uploaded. The interactive tool needs JavaScript.