A/B Test Sample Size Calculator
Calculate the number of visitors needed per variant for an A/B test from your baseline conversion rate, the smallest lift you want to detect, confidence and power.
Calculate the number of visitors needed per variant for an A/B test from your baseline conversion rate, the smallest lift you want to detect, confidence and power.
Running a test with too few visitors gives noisy results, and running it too long wastes time. The right sample size depends on your current conversion rate and how small an improvement you want to be able to detect.
Enter your baseline rate and the lift you care about. The calculator returns the visitors needed in each variant and in total.
Baseline 10%, detect a 20% relative lift (10% -> 12%), 95% confidence, 80% power: about 3,841 visitors per variant.
The calculator uses the standard formula for comparing two proportions. It converts your baseline and minimum detectable effect into two rates, averages them, and combines a confidence term and a power term, then divides by the squared gap between the rates. Example: a 5 percent baseline and a 20 percent relative lift means detecting 5 versus 6 percent. At 95 percent confidence and 80 percent power that needs about 8,158 visitors per variant, or 16,316 in total. Halving the detectable lift roughly quadruples the requirement.
The results are sensitive to your inputs. A low baseline rate needs far more traffic than a high one for the same relative lift, because the absolute difference is tiny. Raising power from 80 to 90 percent, or confidence from 95 to 99 percent, increases the sample as well. The formula assumes a fixed sample size, equal traffic split, independent visitors and a two-sided test. It does not account for peeking, sequential testing methods, or seasonality, so treat the number as a minimum rather than a guarantee.
The smallest improvement you want the test to reliably catch. A smaller effect needs many more visitors.
Confidence limits false positives. Power is the chance of detecting a real effect of the size you chose. 95% and 80% are common defaults.
Divide the total visitors by your daily traffic to the page, and run for whole weeks to cover weekday patterns.
It uses the standard normal-approximation formula for two proportions, which is a good planning estimate.
Relative means a percentage of your baseline, so 20 percent on 5 percent gives 6 percent. Absolute means percentage points, so 1 point gives 6 percent too. Pick whichever your team uses, but state it clearly.
Test a bigger change, use a higher-traffic page, accept lower power, or measure a metric earlier in the funnel that has a higher base rate. Running an underpowered test mostly produces noise.