A/B Test Sample Size Calculator

Find out how many visitors you need per variation to reach statistical significance. Based on the Z-test for two proportions.

Test Parameters

%

Your current conversion rate

%

Relative improvement to detect (e.g. 20% = % → %)

Probability the result is not due to chance

Probability of detecting a real effect

To estimate test duration

Required Sample Size

Per Variation

visitors needed

Total (Both Variations)

visitors needed

Estimated Duration

at visitors/day

enter daily visitors above

Baseline Rate

Target Rate (to detect)

Effect Size Comparison

How sample size changes with different minimum detectable effects at your current settings.

MDE Target Rate Per Variation Total Visitors Days

The Formula

This calculator uses the Z-test for two proportions, the standard method for determining sample size in A/B tests comparing two conversion rates.

n = (Zα/2 + Zβ)2 × [p1(1 - p1) + p2(1 - p2)] / (p2 - p1)2

n = required sample size per variation

p1 = baseline conversion rate (your current rate)

p2 = expected conversion rate after the change (p1 × (1 + MDE))

Zα/2 = Z-score for the confidence level (two-tailed)

90% confidence → Z = 1.645

95% confidence → Z = 1.960

99% confidence → Z = 2.576

Zβ = Z-score for the statistical power

80% power → Z = 0.842

90% power → Z = 1.282

Source: Chow, S., Shao, J., & Wang, H. (2008). Sample Size Calculations in Clinical Research, 2nd Edition. Chapman & Hall/CRC Biostatistics Series. Also described in: Wikipedia — Sample size determination (Proportions) and Evan Miller's A/B Testing Sample Size Calculator.

Need a better baseline to test against?

A higher baseline conversion rate means smaller sample sizes and faster tests. Build landing pages that convert from the start.

Try Punapai Free

Frequently Asked Questions

How many visitors do I need for an A/B test?

It depends on your baseline conversion rate, the minimum effect you want to detect, your confidence level, and statistical power. A typical test with a 5% baseline, 20% minimum detectable effect, 95% confidence, and 80% power needs around 1,530 visitors per variation (3,060 total).

What is statistical significance in A/B testing?

Statistical significance means the difference between your two variations is unlikely to be caused by random chance. A 95% confidence level means there is only a 5% probability the observed difference happened by accident. This is the industry standard for A/B tests.

What formula is used to calculate A/B test sample size?

The standard formula is based on the Z-test for two proportions: n = (Zα/2 + Zβ)2 × [p1(1-p1) + p2(1-p2)] / (p2-p1)2. This is the same formula used by tools like Optimizely, VWO, and Evan Miller's calculator.

What is the minimum detectable effect (MDE)?

The minimum detectable effect is the smallest relative improvement over your baseline that you want to be able to detect. For example, if your baseline is 5% and your MDE is 20%, you are looking to detect a change to at least 6%. Smaller MDEs require larger sample sizes because the difference is harder to distinguish from noise.