A/B Test Sample Size Calculator
Estimate sample size per variant for a conversion rate A/B test given baseline CVR, MDE, significance, and power.
A/B tests are easy to misread when samples are small. Planning sample size upfront helps you avoid false positives, false negatives, and endless tests.
This calculator estimates required sample size per variant for a conversion rate test using a standard normal approximation (two-sided).
Prefer an explanation- Read the guide.
A/B test sample size: how to plan conversion experimentsCPC (Cost Per Click): definition, formula, and how to calculateCPM (Cost Per 1,000 Impressions): definition, formula, and how to calculateCTR (Click-Through Rate): definition, formula, and how to improve
%
Minimum detectable effect as percentage points (e.g., 0.5 means 2.5% -> 3.0%).
pp
%
%
Tip: you can type commas (e.g., 10,000).
Example
Using the default inputs, the result is:
16,792
- Baseline conversion rate
- 2.5%
- MDE (absolute lift)
- 0.5pp
- Significance level (alpha)
- 5%
- Power (1 - beta)
- 80%
How to calculate
- Enter baseline conversion rate (CVR) and your minimum detectable effect (MDE).
- Choose significance level (alpha) and statistical power (1 - beta).
- Use the output as a baseline and add buffer for tracking loss and seasonality.
Formula
n ~ ((z_(1-alpha/2)sqrt(2p-(1-p-)) + z_(power)sqrt(p1(1-p1)+p2(1-p2)))2) / (p2-p1)2
- Two-sided z-test approximation for proportions.
- Independent samples and stable baseline rate.
- Does not adjust for multiple testing or sequential stopping rules.
FAQ
Why does sample size explode when CVR is low-
When conversion is rare, noise is high relative to the signal. Detecting small lifts requires much larger samples.
Should I run until I hit the sample size exactly-
Use it as a baseline and add buffer. Also avoid peeking; if you want to stop early, use sequential testing methods instead of naive p-values.
Common mistakes
- Stopping early when a result looks good (peeking inflates false positives).
- Using an MDE that's smaller than what you can act on (forces huge samples).
- Mixing click-based and session-based conversion rates (definition mismatch).
Related calculators
Paid Ads
ROAS Calculator
Calculate Return on Ad Spend (ROAS) and estimate contribution profit after ad spend.
Paid Ads
Break-even ROAS Calculator
Estimate the break-even ROAS based on contribution margin assumptions.
Paid Ads
Target ROAS Calculator
Estimate a target ROAS to cover variable costs plus a desired margin buffer.
Paid Ads
Paid Ads Funnel Calculator
Model CPM -> CTR -> CVR to estimate CPC, CPA, ROAS, and profit per 1,000 impressions (with margin and variable costs).
Paid Ads
ROI Calculator
Calculate Return on Investment (ROI) for a campaign or project.
Paid Ads
Incrementality Lift Calculator
Estimate incremental conversions, incremental ROAS, and incremental profit from a holdout test.
Quick checks
- Keep attribution model and window consistent when comparing campaigns.
- Pair efficiency metrics (ROAS/CPA) with profit assumptions (margin, refunds, fees).
- Validate tracking after site changes (pixels/events can silently break).