FreeStatisticalTools.com
Study planning and calculators

A/B Test Sample Size and Duration Calculator

Plan an experiment before you launch it. Enter the baseline conversion rate (or mean and SD), the smallest lift worth detecting and your daily traffic; the calculator gives the sample size per variant and how many days to run, or the smallest effect your traffic can detect.

Free · No sign-upReplaces Optimizely · Evan MillerCalculator
Updated · By Bibin Xavier

Variables and options

Results update automatically when you change an option.

Results

Calculated in your browser
Visitors per variant39,475
Total visitors78,950
Duration27 daysround up to 4 full weeks
Minimum detectable effect+10.00%4.00% → 4.40%
Table 1

Design summary

SettingValue
MetricConversion rate, baseline 4.00%
Minimum detectable effect10.00% relative (0.400 percentage points)
Significance levelα = 0.05 (two-sided)
Power80%
Variants2 (traffic split equally)
Visitors per variant per day1500.0
Sample size per variant39,475
Duration27 days (4 weeks recommended to cover weekly cycles)

Note. Two-proportion z-test: n = [zα√(2p̄(1 − p̄)) + zβ√(p₁(1 − p₁) + p₂(1 − p₂))]² / (p₂ − p₁)².

Table 2

Sample size for other effect sizes

Relative MDETarget ratePer variantTotalDays
1.0%4.04%3,785,5107,571,0202,524
2.0%4.08%950,8871,901,774634
3.0%4.12%424,620849,240284
5.0%4.20%154,304308,608103
7.5%4.30%69,379138,75847
10.0%4.40%39,47578,95027
15.0%4.60%17,94335,88612
20.0%4.80%10,31720,6347
25.0%5.00%6,74513,4905
30.0%5.20%4,7839,5664

Detectable effect by test duration

Power curve for this sample size

Interpretation

To detect a 10.0% relative change (from 4.00% to 4.40%) with 80% power at α = 0.05, you need 39,475 visitors per variant, 78,950 in total. At 3,000 test visitors a day that takes about 27 days; run for 4 full weeks so every weekday is covered, and decide the duration before you start rather than stopping when the result looks significant.

How to cite this tool

Using these results in a thesis, journal article, report or class assignment? Please cite this free tool so others can find it. It keeps the site free.

APA 7

Xavier, B. (2026). A/B Test Sample Size and Duration Calculator [Web application]. FreeStatisticalTools.com. https://freestatisticaltools.com/ab-test-sample-size-calculator/

BibTeX

@software{xavier_abtestsamplesize_2026,
  author = {Xavier, Bibin},
  title = {A/B Test Sample Size and Duration Calculator},
  publisher = {FreeStatisticalTools.com},
  year = {2026},
  url = {https://freestatisticaltools.com/ab-test-sample-size-calculator/},
  note = {Web application}
}
Download citation:

Suggested sentence for your methods section: “The analysis was carried out with the free A/B Test Sample Size and Duration Calculator tool on FreeStatisticalTools.com (Xavier, 2026).”

What is A/B test sample size planning?

This calculator plans A/B and multivariate tests. Enter the baseline conversion rate (or mean and standard deviation), the minimum detectable effect, significance level, power and daily traffic, and it returns the sample size per variant and how many days to run, or the smallest effect your traffic can detect in a given time.

When to use A/B test sample size planning

Use it when planning an A/B or multivariate test: to set the sample size and duration in advance, to check whether a test is feasible with your traffic, or to agree on the smallest effect worth detecting.

Assumptions

  • Visitors are randomised independently and split equally between variants.
  • The baseline rate (or mean and SD) is a good estimate of the control group; use recent data from the same pages and audience.
  • The test runs to the planned sample size without peeking; sequential monitoring needs other methods.

How to set up your data

No data upload: enter the baseline, the minimum detectable effect or the planned duration, daily traffic and the test settings.

Why plan the sample size?

An A/B test that is too small cannot detect realistic effects: it will usually end “not significant” even when the variant is genuinely better, wasting traffic and time, and the few significant results it produces will overstate the true effect. A test that is much larger than needed delays decisions. Planning the sample size before launch, and sticking to it, is the single most effective way to make experiments trustworthy. It also forces a useful conversation: what is the smallest improvement that would be worth acting on?

The ingredients

  • Baseline: the current conversion rate of the control (for example 4% of visitors buy), or for continuous metrics such as revenue per visitor or time on site, the current mean and standard deviation. Take these from recent data for the same pages and audience.
  • Minimum detectable effect (MDE): the smallest relative change you want the test to detect reliably, for example a 10% lift from 4.0% to 4.4%. Smaller MDEs need dramatically larger samples: halving the MDE roughly quadruples the sample size.
  • Significance level (α): the false-positive rate you accept, usually .05 two-sided.
  • Power (1 − β): the probability of detecting the MDE if it is real, usually 80% (90% for important decisions).
  • Number of variants: each additional variant needs its own sample, and with several comparisons against the control the significance level is adjusted (Bonferroni) to keep the overall false-positive rate at α.
  • Traffic: eligible visitors per day and the share of them included in the test, which turn a sample size into a duration.

The formulas

For conversion rates, the tool uses the standard two-proportion z-test formula for the sample size per variant:

n = [zα√(2 p̄(1 − p̄)) + zβ√(p1(1 − p1) + p2(1 − p2))]² / (p2 − p1)²

where p1 is the baseline, p2 = p1(1 + MDE), p̄ their average, zα the critical value for α (α/2 for two-sided tests) and zβ the quantile for the chosen power. For continuous metrics it uses n = 2(zα + zβ)² σ² / δ², where δ is the absolute difference to detect. Duration is the total sample (n × number of variants) divided by daily test traffic, rounded up to whole days, and the tool recommends rounding up to full weeks so that every day of the week is represented equally.

In the second mode, you enter a planned duration and the tool solves for the MDE your traffic can detect, which is often the more honest question for low-traffic sites.

Worked example

With a 4% baseline conversion rate, a 10% relative MDE (4.0% → 4.4%), α = .05 two-sided and 80% power, each variant needs 39,475 visitors, 78,950 in total. With 3,000 visitors a day split between two variants, that takes 27 days, so the recommendation is to run four full weeks. The table of other effect sizes shows how quickly requirements grow for smaller effects: detecting a 5% lift needs about 154,000 visitors per variant (103 days), while a 20% lift needs about 10,300 (7 days). The detectable-effect chart shows that after two weeks only lifts of about 14% or more can be detected reliably with this traffic.

Choosing a sensible MDE

The MDE is a business decision, not a statistical one. Ask what lift would justify the cost of building and maintaining the change, and what lift is plausible: most successful website changes improve conversion by a few percent, not by 30%. If the sample size for a realistic MDE is unachievable, consider testing bigger changes, using a metric closer to the change (click-through rather than purchases), increasing the traffic share, running fewer variants, or using variance-reduction methods such as CUPED.

Common mistakes

  • Peeking: checking results daily and stopping as soon as p < .05 inflates the false-positive rate far above 5%. Decide the sample size in advance, or use a sequential or Bayesian method designed for monitoring.
  • Stopping too early: even if the sample size is reached in three days, run at least one full week to cover weekday and weekend behaviour, and beware of novelty effects.
  • Using the wrong baseline: site-wide conversion rates are often different from the rate on the tested page or segment.
  • Ignoring multiple variants: testing five variants at α = .05 each without correction gives about a 19% chance of at least one false winner.
  • Underpowered tests reported as “no effect”: a non-significant result from a small test means “not enough evidence”, not “no difference”.

After the test

Before analysing results, run the sample ratio mismatch checker to confirm the traffic split worked. Then analyse two variants with the A/B test significance calculator or the Bayesian A/B test calculator, and three or more with the A/B/n test calculator with multiple-comparison correction.

Reporting a test plan

A test plan should state the primary metric, baseline, MDE, α, power, number of variants, sample size per variant, expected duration and the decision rule. Example: “With a baseline conversion rate of 4.0%, detecting a 10% relative lift with 80% power at α = .05 (two-sided) requires 39,475 users per variant; at 3,000 eligible users per day the test will run for four weeks.”

Glossary of experiment-planning terms

  • Baseline rate: the conversion rate the control is expected to have during the test, estimated from recent traffic to the same page or flow.
  • Absolute vs relative MDE: a 10% relative MDE on a 4% baseline is an absolute change of 0.4 percentage points; always state which one you mean.
  • Type I error (α): declaring a difference when none exists. With α = .05, one in twenty tests of a useless change will look significant.
  • Type II error (β): missing a real effect of the size of the MDE. With 80% power, one in five such effects goes undetected.
  • Allocation: the share of test traffic sent to each variant. Equal splits are the most efficient; unequal splits need more total traffic for the same power.
  • Unit of randomisation: users, sessions or devices. Plan and analyse with the same unit; counting sessions when users were randomised understates uncertainty.
  • Novelty effect: a temporary change in behaviour because something is new. Running for full weeks and checking the effect over time helps detect it.

Key references: Kohavi, Tang and Xu (2020), Trustworthy Online Controlled Experiments; Fleiss, Levin and Paik (2003), Statistical Methods for Rates and Proportions; Deng, Xu, Kohavi and Walker (2013) on CUPED.

How to use this calculator

  1. Enter the values. Fill in metric, calculate, baseline conversion rate (%) and minimum detectable effect (relative %).
  2. Read the results. Results update automatically. Read the plain-English interpretation, then use Copy table to paste APA-style tables into Word and Copy for the results sentence.

How to report A/B test sample size planning in APA style

Report the baseline, MDE, α, power, number of variants, sample size per variant and planned duration in the test plan.

Frequently asked questions

What is the minimum detectable effect?

The smallest relative change, for example a 10% lift, that the test is designed to detect with the chosen power.

How is the sample size calculated?

With the two-proportion z-test formula for conversion rates, or the two-sample z formula for means, for the chosen α and power.

Why run tests for full weeks?

Behaviour differs by day of the week; full weeks make every day equally represented and reduce novelty bias.

How do multiple variants affect sample size?

Each variant needs its own sample, and with Bonferroni adjustment the significance level per comparison is α/(k − 1).

What power should I use?

80% is standard; use 90% for important decisions or when a missed effect is costly.

Can I stop the test early if it is significant?

Not with a fixed-sample design: peeking and stopping early inflate false positives. Run to the planned sample size.

Related tools

See also

Learn this method step by step in the free course Customer and Marketing Analytics, with exercises and a certificate.

Browse all categories