
An A/B test only helps if it has enough people to tell a real difference from chance. Too small, and a good idea looks like a failure. Too big, and you waste time and money. This A/B test sample size calculator tells you how many people each version needs to detect the smallest lift you care about. It works for website conversion tests, email tests, and survey-based concept or ad tests.
A/B test sample size calculator
How many people per version do you need to detect a real difference between two conversion or preference rates?
Two-sided test of two proportions: n = (zₐ √(2p̄(1−p̄)) + zβ √(p₁(1−p₁)+p₂(1−p₂)))² / (p₂−p₁)², per version. With more than two versions, the confidence level is split across comparisons (Bonferroni).
The four inputs that set sample size
- Baseline rate. The rate you expect for the current version, such as 20% conversion or 20% top-2-box purchase intent.
- Smallest lift worth detecting. The smallest improvement that would change your decision. This drives the sample size more than anything else.
- Confidence. How sure you want to be that a difference is not chance. 95% is standard.
- Power. The chance of detecting the lift if it is really there. 80% is standard. 90% is safer but needs more people.
The formula
For two proportions with a two-sided test:
n per group = [zα/2√(2p̄(1 − p̄)) + zβ√(p₁(1 − p₁) + p₂(1 − p₂))]² ÷ (p₂ − p₁)²
p₁ is the baseline, p₂ the expected rate with the lift, and p̄ their average. In the example, detecting a move from 20% to 24% at 95% confidence and 80% power needs about 1,680 people per version.
Why small lifts are expensive
Sample size grows with the square of the effect you want to detect. Halving the lift roughly quadruples the sample:
- Detecting 20% vs 28% needs about 450 per version.
- Detecting 20% vs 24% needs about 1,680 per version.
- Detecting 20% vs 22% needs about 6,500 per version.
Be realistic. If a 2-point lift would not change what you do, do not size the test to detect it.
Testing more than two versions
With three or four versions, the chance of a false winner rises because you make several comparisons. The calculator applies a Bonferroni correction, splitting the confidence level across comparisons with the control. This makes each version need a larger sample. If budget is tight, test fewer versions.
Survey tests vs live tests
Live tests on a website, app or email measure real behaviour. Traffic is often the limit: a page with 500 visitors a week cannot detect small lifts in a reasonable time.
Survey-based tests show concepts, packs or ads to separate groups of respondents (a monadic design) and compare their reactions. They work before launch, when there is no live traffic. Each cell needs a matched sample, which our concept and product testing and communication testing projects set up with quotas.
Sample size for preference tests
In a paired preference test, where the same person tastes two products and picks one, the question is different: is the share preferring product B different from 50%? To detect a 60:40 preference at 95% confidence and 80% power, you need around 200 respondents. To detect 55:45, you need around 800. Many product tests in Indonesia use 100 to 150 per cell, which is enough only for clear winners.
Common A/B testing mistakes
- Stopping early. Checking results every day and stopping when one version looks ahead inflates false positives. Decide the sample size first and stick to it.
- Testing many metrics. Pick one primary metric before the test. Others are secondary.
- Uneven groups. Make sure groups are similar in age, region and device. In survey tests, use quotas.
- Ignoring novelty. New designs sometimes win at first because they are new. Run tests long enough to cover normal behaviour.
When the test is done, check the result with the significance test calculator, which gives the p-value and confidence interval of the difference. To estimate first-year sales from a winning concept, try the purchase intent to trial calculator.
Frequently asked questions
How many people do I need for an A/B test?
It depends on the baseline rate and the lift you want to detect. Detecting 20% vs 24% at 95% confidence and 80% power needs about 1,680 per version.
Why do small lifts need large samples?
Sample size grows with the square of the effect. Halving the lift roughly quadruples the sample.
Can I stop a test early?
Stopping as soon as one version leads inflates false positives. Decide the sample size first.