Last updated: March 2026
How to Calculate A/B Test Sample Size
Determining the right sample size is the most important step in A/B testing. Too few visitors and your results are unreliable. Too many and you waste time that could be spent on the next test. This calculator uses the two-proportion z-test to find the exact number of visitors you need per variant.
The required sample size depends on four factors: your baseline conversion rate, the minimum detectable effect (how small an improvement you want to catch), your significance level (how sure you want to be), and statistical power (probability of detecting a real winner).
Frequently Asked Questions
How do I calculate sample size for an A/B test?
Use the two-proportion z-test formula. Enter your baseline conversion rate, the minimum improvement you want to detect (MDE), your desired significance level (typically 95%), and statistical power (typically 80%). The calculator determines the minimum visitors needed per variant.
Why does a smaller MDE require more samples?
Detecting a small difference between two groups requires more data points to distinguish the signal from noise. A 5% relative improvement needs about 4x more samples than a 10% improvement.
What sample size do I need for 95% confidence?
It depends on your baseline conversion rate and MDE. For example, a site with 3% conversion rate wanting to detect a 10% relative improvement at 95% confidence and 80% power needs roughly 12,500 visitors per variant.
Can I use this for multivariate tests?
Yes. Select 3 or 4 variants to see the total sample needed. More variants mean a larger total sample and longer test duration, since each variant needs the same minimum sample size.