Marketing calculator
A/B test sample size calculator
Before a test, work out visitors per version from your baseline rate and the smallest change worth detecting. At 3% conversion, finding a 20% lift at 95% confidence and 80% power takes 13,914 visitors per version.
Your control's rate today
Relative: 20% turns 3% into 3.6%
1 − significance level (α)
Chance of detecting a real effect
All versions together
Visitors per version
13,914
- Total visitors
- 27,828
- Days at this traffic
- 14
- Target conversion rate
- 3.6%
- Conversions per version at the baseline
- 417
Everything is calculated in your browser; nothing you enter is sent anywhere.
How it's calculated
p₁ = baseline rate, p₂ = p₁ × (1 + relative MDE) or p₁ + absolute MDE p̄ = (p₁ + p₂) ÷ 2 n per version = (z_α/2 × √(2p̄(1 − p̄)) + z_β × √(p₁(1 − p₁) + p₂(1 − p₂)))² ÷ (p₂ − p₁)²
This is the standard sample size for a two-sided two-proportion z-test, rounded up. z_α/2 is 1.960 at 95% confidence and z_β is 0.842 at 80% power. It's the same test the A/B test significance calculator runs when the data is in.
Decide the sample before you start, run until each version has it, and check significance once at the end. Stopping when the p-value first dips below 0.05 inflates false winners.
Worked example
A pricing page converts 3% of visitors and gets 2,000 visitors a day. The team wants to detect a 20% relative lift with the usual 95% confidence and 80% power, testing one new version against the control.
- Target rate: 3% × 1.2 = 3.6%, and p̄ = 3.3%.
- n = (1.960 × √(2 × 0.033 × 0.967) + 0.842 × √(0.03 × 0.97 + 0.036 × 0.964))² ÷ 0.006² = 13,914 per version.
- Total: 2 × 13,914 = 27,828 visitors.
- Duration: 27,828 ÷ 2,000 a day = 14 days.
Two full weeks also covers weekdays and weekends twice. To detect a 10% lift instead, the page would need about four times as many visitors, which at this traffic is close to two months.
When you don't have the traffic
Small sites often need more visitors than they get. Options that still give a usable answer:
- Test bigger changes: a new offer or page, not a button color. Larger effects need far fewer visitors.
- Test higher in the funnel, where the baseline rate is higher.
- Accept 90% confidence for low-risk changes, and say so in the result.
Size for conversions, judge on revenue
Sample size is calculated on a conversion rate, but the version you keep should be the one that brings revenue. In MetricRaven, send the variant as a goal property such as experiment, and each goal shows, for every value, how many people completed it, how many paid afterwards and what they paid (revenue per property value).
Questions
- How many visitors do I need for an A/B test?
- It depends on your conversion rate and the smallest change you want to detect. At a 3% baseline, detecting a 20% relative lift (to 3.6%) at 95% confidence and 80% power takes 13,914 visitors per version.
- What is the minimum detectable effect?
- The smallest real change the test can reliably find. Relative MDE is a share of the baseline (20% of 3% is 0.6 points); absolute MDE is in percentage points. Halving the MDE roughly quadruples the sample.
- What do power and confidence mean?
- Confidence (1 − α) limits false winners: at 95%, a test with no real difference calls a winner 5% of the time. Power is the chance of detecting a change as large as the MDE when it's real; 80% is the usual minimum.
- What about more than two versions?
- Each version needs the per-version sample, so total traffic grows with every variant. Comparing several variants with the control also raises the chance of a false winner; some teams use a stricter confidence level to offset it.