About the A/B Test Sample Size
This calculator determines how many users or observations each variant of an A/B test needs before the test can reliably detect a chosen minimum effect. It takes a baseline conversion rate, the smallest relative change worth detecting, and a desired statistical power, then returns the required sample size per group. It is built for planning experiments before launch, not for analyzing results after the fact.
How It Works
You provide the current baseline conversion rate, the minimum relative lift you want the test to be able to detect, for example 10% means detecting a move from 5% to 5.5%, and a statistical power level of either 80% or 90%. The calculator converts the target power into a z-score, fixes the significance level at a two-sided 95% confidence with z=1.96, and combines these with the variance of both the baseline and target conversion rates to compute the minimum sample size per variant. The result is rounded up to the nearest whole visitor or observation, since a fractional sample size cannot be recruited.
Examples
Standard 10% lift at 80% power
With the defaults, a 5% baseline, a 10% relative minimum detectable effect, and 80% power, the target conversion rate is 5.5% and the calculator returns a required sample size of roughly 31,232 visitors per variant.
Larger effect at 90% power
For a 20% baseline conversion rate, a 15% relative minimum detectable effect with a 23% target rate, and 90% power, the required sample size drops to about 3,936 per variant, since a larger effect and higher baseline rate are both easier to detect with fewer observations.
Advantages
- Converts a business question, how big a change matters, directly into a concrete recruitment or traffic target before an experiment starts.
- Prevents underpowered tests that run out of data before they can distinguish a real effect from noise.
- Shows the resulting target conversion rate alongside the sample size, so the assumed effect stays visible, not just the output number.
Common Mistakes
- Treating the minimum detectable effect as an absolute percentage-point change rather than a relative one; a 10% MDE on a 5% baseline means detecting a move to 5.5%, not to 15%.
- Ending an experiment early because results look flat, without checking whether the planned sample size was actually reached yet.
- Underestimating how much smaller detectable effects inflate the required sample size, since the sample size grows roughly with the square of how small the effect is.
Edge Cases to Watch For
- The baseline conversion rate must be strictly between 0% and 100%; a rate of exactly 0% or 100% makes the variance term meaningless.
- The minimum detectable effect can't be 0%, since that would make the denominator, the gap between the two rates, zero and leave the required sample size undefined.
- The significance level is fixed at a two-sided 95% confidence test with z=1.96 and can't be changed in this calculator; only the power level, 80% or 90%, is adjustable.
- The reported figure is the sample size needed per variant, not the combined total across both groups.
Common Use Cases
- Product managers and growth teams planning how long a conversion rate experiment needs to run before it launches.
- UX researchers and marketers sizing landing page or pricing tests against realistic traffic volumes.
- Data teams setting stopping rules in advance so experiments aren't peeked at and stopped prematurely.