When I plan an experiment, sample size is a feasibility check: can the available traffic answer the question well enough to justify the work? Calculating it before building the variation makes the trade-off between sensitivity and runtime visible.
Start with the table below for a rough planning estimate. Then use a calculator that matches your analysis method to confirm the sample size and duration.
Sample Size Per Variant: A Quick Reference Table
A calculator returns a precise-looking number, but a table makes the trade-offs easier to compare. It shows how changing the baseline or relative MDE affects the traffic you need.
These are hypothetical, rounded planning values for a two-sided, fixed-horizon comparison of independent visitor-level conversion rates, with equal allocation, alpha = 0.05 and 80% power. Each cell is visitors per variant, not total traffic. Some values round down; use an unrounded calculation and round up before setting a stopping rule. The approximation uses a pooled variance under the null and separate variances under the alternative, as documented in statsmodels' two-proportion sample-size calculation.
| Baseline CVR | 5% MDE | 10% MDE | 20% MDE | 50% MDE |
|---|---|---|---|---|
| 1% | 637,000 | 163,000 | 42,500 | 7,700 |
| 2% | 315,000 | 80,500 | 21,000 | 3,800 |
| 3% | 208,000 | 53,000 | 14,000 | 2,500 |
| 5% | 122,000 | 31,000 | 8,200 | 1,500 |
| 10% | 58,000 | 14,500 | 3,800 | 700 |
Three things to read off this table before you build anything.
Double every number for an equally allocated two-arm test. These are per-variant figures. A control and one variant at a 3% baseline targeting a 10% relative lift need approximately 53,000 each, or 106,000 total. Reading the per-variant value as the total substantially reduces the test's power.
The relationship is roughly quadratic. Halving your MDE approximately quadruples the sample size. Look across the 3% row: approximately 53,000 at a 10% MDE becomes 208,000 at a 5% MDE. Greater sensitivity has a substantial traffic cost.
Lower baselines need more traffic for the same relative lift. A 1% baseline needs roughly eleven times the traffic of a 10% baseline in this table. A low-converting flow may therefore need a longer runtime, a less sensitive design, or a different research method.
If your traffic cannot support the cell you land in, revisit the design before launching. A larger MDE can shorten the test, but it also means less power to detect smaller effects that may still matter.
Keep the table in your test plan as a feasibility reference. Confirm the assumptions and calculate the final sample before launch.
Why Sample Size Matters: The Underpowered Test Problem
An underpowered test is one that doesn't have enough data to reliably detect the effect you're looking for — even if that effect is real.
Consider a hypothetical product-page test whose true improvement equals the MDE used for planning. If it stops at 40% of the planned sample, a nonsignificant result is more likely than it would be at the full sample. Treating that result as proof that the design has no benefit risks discarding a useful change.
Missing a real effect is a Type II error. In practice, you do not know the true effect, so report the estimated difference and its confidence interval rather than assuming a nonsignificant result means no change.
Power is the chance of rejecting the null hypothesis at a specified true effect, under the design's assumptions. In the hypothetical 3% to 3.3% example below, the planned sample gives approximately 80% power. At 40% of that sample, power is approximately 43%; at half the sample, it is approximately 51%. Sample size and power do not change in direct proportion. Statsmodels' power function explains the two-proportion calculation.
Calculate the sample requirement before building the variation. That makes the traffic commitment part of the decision to run the test.
Four Inputs for a Fixed-Horizon Sample Size Calculation
For the equal-allocation, two-arm design used in this table, the main inputs are baseline conversion rate, MDE, significance level, and power. Also confirm the randomization unit, allocation, number of comparisons, and analysis method. Calculators using different designs may ask for different inputs.
- Baseline conversion rate. Use the rate for the metric and eligible population the experiment will analyze. For a checkout test, that might be purchase completion among eligible checkout visitors. A site-wide rate with a different denominator answers a different question.
- Minimum detectable effect (MDE). Specify the relative change you want the design to detect at the chosen power. Compare that with the smallest effect worth acting on; a traffic-constrained MDE may be larger than your business threshold. Check whether the calculator expects relative change or percentage points. This guide uses relative MDE throughout; the guide to choosing an MDE explains that decision.
- Significance level. This table uses two-sided alpha = 0.05, often described as 95% confidence. Choose the level before launch according to the cost of false positives and the analysis plan. A stricter level usually requires more data.
- Statistical power. This table uses 80% power at the target effect. Higher power requires more traffic but reduces the chance of missing that effect. It does not mean an 80% probability that a particular treatment works.
Worked Example: A Hypothetical Checkout Test
Suppose you are testing a checkout layout. The following values are illustrative assumptions, not results from a company experiment.
Baseline CVR: 3.0%
MDE: 10% relative, corresponding to a target change from 3.0% to 3.3%: an absolute difference of 0.3 percentage points.
Significance level: alpha = 0.05, two-sided.
Power: 80%
Running this through a standard two-proportion z-test:
Required sample size: approximately 53,000 visitors per variant, or 106,000 across both arms. Using the unrounded normal approximation and rounding up gives 53,211 per arm. For the formula and substitution, see the A/B test sample-size calculation guide.
Now calculate test duration:
New eligible randomized visitors reaching checkout: approximately 10,000 per week across both arms. Count each visitor once in the experiment; repeated sessions do not add independent participants.
Split: 50/50 (5,000 per variation per week)
Recruitment time: approximately 53,000 / 5,000 = 10.6 weeks. The equivalent calculation is 106,000 total visitors / 10,000 total visitors per week.
That is a long commitment to one checkout design. Before approving it, I would check whether the traffic mix, implementation, and outcome window can remain interpretable over that period. Ten weeks is not a statistical expiry date, but it creates practical risks that a calendar estimate alone does not capture.
At a 15% relative MDE, the requirement falls to approximately 24,000 per variant, or 4.8 weeks of recruitment with the same traffic. That is a different sensitivity commitment: the test will have less power for a 10% effect. A shorter schedule is useful only if the team accepts that limitation.
Use a long projected runtime as a prompt to revisit the design. The decision is whether the sensitivity, observation window, and operational commitment fit the question, not whether the test clears a universal eight-week limit.
How MDE Changes the Traffic Requirement
Understanding how sensitive sample size is to MDE changes helps you make better tradeoffs.
Using the same hypothetical baseline of 3%, two-sided alpha = 0.05, and 80% power:
5% relative MDE → ~208,000 visitors per variation
10% relative MDE → ~53,000 visitors per variation
15% relative MDE → ~24,000 visitors per variation
20% relative MDE → ~14,000 visitors per variation
Going from a 5% to a 10% MDE cuts the required sample by roughly three-quarters. Doubling it again produces a similar reduction. This is an approximate inverse-square relationship; the conversion-rate variance also changes slightly as the target rate changes.
MDE is a powerful planning lever, but raising it does not make the treatment more effective. A larger MDE may be necessary given the traffic, even when a smaller lift would be worth shipping. Record that gap explicitly so a nonsignificant result is not mistaken for evidence that no worthwhile benefit exists.
Per-Variant Sample Size and Total Traffic
The per-variant sample size and the total sample size are different quantities. Check which one your calculator reports. For the equally allocated two-arm design used here, total sample is twice the per-variant value.
In the hypothetical 3% baseline and 10% relative MDE example, approximately 53,000 visitors are needed in each arm at 80% power. Planning for 53,000 total provides only half the intended sample per arm. Power falls to approximately 51%, rather than being halved from 80% to 40%.
The distinction also matters for A/B/n tests. With equal allocation, a four-arm test needs four times the per-arm sample. Comparing several treatments with one control also requires a multiple-comparison plan, which can change the per-arm requirement. Do not simply reuse the two-arm calculator output.
Before adding a variant, I would recalculate both the sample size and the calendar commitment under the intended analysis. Fewer variants can make a focused decision feasible, but a short deadline alone is not a reason to claim adequate sensitivity.
How to Read and Use the Sample Size Calculator in Optimizely
Optimizely's public sample-size calculator accepts a baseline conversion rate, relative MDE, and significance level. Its documentation describes a planning estimate for Stats Engine, which uses sequential testing and false discovery rate controls. It is not the same method as the fixed-horizon, 80%-power table above.
Read the output label carefully: the public calculator reports sample size per variation. Compare tools only after matching their assumptions; different methods can produce different planning estimates for the same baseline and effect.
A runtime forecast also needs a realistic count of new eligible visitors entering the experiment. Use traffic for the target population and allow for variation in recruitment and the time conversions take to mature.
Follow the multiple-comparison and stopping rules for the analysis method you actually use. Do not manually add a Bonferroni correction to a platform that already applies its own correction without checking what that would change.
Check the platform's current documentation and output units before transferring a number into your test plan. A fixed-horizon calculation is not an instruction to stop a sequential experiment at that exact count.
What to Do When Your Traffic Is Too Low
You run the calculation. The test would take 6 months. Your options:
Option 1: Revisit the MDE. A larger target effect reduces the required sample. Document which smaller effects the revised design will often miss and whether those effects would still be commercially useful.
Option 2: Test a higher-traffic page. A messaging experiment on a homepage may provide useful evidence before a lower-traffic product-page change. The audience and context differ, so a positive homepage result does not prove the same effect will transfer to checkout.
Option 3: Use qualitative research. If the sample requirement is impractical for the question, usability tests, interviews, or session recordings may identify changes worth making. Monitor a research-led redesign with analytics, while keeping before/after observations separate from randomized causal evidence.
Option 4: Plan a smaller experiment with explicit limits. A smaller fixed sample can still provide an estimate and confidence interval. Document the lower power before launch and assess the range of effects compatible with the result. A positive point estimate alone is not a reason to call the change a winner; do not stop opportunistically because the result looks favorable.
State the decision the available traffic can support before launch. If the interval is likely to remain too wide to distinguish useful benefit from meaningful harm, research or implementation work may be a better use of the time.
Sample Size and a Two-Week Deadline
Two weeks can be a practical constraint, but it is not enough information to establish a test's power. The baseline, target effect, eligible traffic, and planned analysis determine what that window can resolve.
A two-week experiment may collect the planned sample, or only a fraction of it. It must also cover the relevant behavior and allow outcomes to mature. Sample size and calendar time answer different parts of the planning question.
Calculate the per-variant sample, then divide it by new eligible visitors per variant per day or week. Alternatively, divide the total sample by total eligible traffic across both arms. Plan calendar coverage for relevant weekly cycles and the conversion window; finishing recruitment is not always the same as finishing observation.
If the calculated duration is longer than you have time for, that's a signal to revisit your MDE — not to run the test anyway and hope for the best.
Common Mistakes in Sample Size Planning
Mistake 1: Using total site traffic instead of traffic to the tested page.
For a hypothetical site receiving 100,000 new visitors per week, suppose 15% are eligible for the checkout experiment. That gives approximately 15,000 eligible visitors per week across its arms, before any further traffic allocation. A site-wide session count cannot substitute for that experiment-level count.
How to fix it: estimate new eligible randomized visitors for the experiment population, using the same eligibility rules and unit as the sample-size calculation. Do not sum returning sessions or weekly unique counts as if every entry were a new participant.
Mistake 2: Not accounting for multiple variations.
Adding variations doesn't just "split the traffic more." It requires you to adjust for multiple comparisons, or your false positive rate inflates.
With two variants, alpha = 0.05 controls the false-positive probability for the single comparison under its assumptions. With several treatments compared with one control, the chance of at least one false positive can increase. Those comparisons share data and are correlated, so the independent-tests calculation of 9.75% for two comparisons is not an exact error rate for this design.
For a fixed-horizon design using Bonferroni across two treatment-versus-control comparisons, the per-comparison alpha is 0.025. In the hypothetical 3% to 3.3% example, that raises the per-arm requirement by approximately 21%. With three equally allocated arms, total sample is approximately 1.8 times the two-arm design. Three comparisons across four equally allocated arms give approximately 2.7 times the total. Other allocation and correction methods produce different requirements.
Mistake 3: Reading the per-variant number as the total. In the worked example, that reduces power from approximately 80% to 51%. It does not halve power in a literal or universal sense.
Mistake 4: Choosing the target after inspecting the results. Set the effect, sample, and stopping plan before launch. If a legitimate operational change requires a revision, document it and use an analysis that accounts for that change rather than quietly redefining success.
Mistake 5: Treating the calculator's duration estimate as a guarantee. Traffic fluctuates. Campaigns change. A test that should take 4 weeks based on historical traffic might take 6 weeks during a slow period. Build buffer.
Mistake 6: Filtering users based on behavior the treatment can change. Excluding people because they did not scroll, click, or trigger a treatment-specific event can bias the analysis. Define eligibility before assignment where possible. A triggered analysis needs equivalent, trustworthy logging in both arms and a condition that preserves comparability. Microsoft's SRM diagnostic guidance explains why mismatched triggering can corrupt an experiment.
Mistake 7: Not checking the calculator's power assumptions. Some calculators default to 90% power instead of 80%. This isn't wrong, but it means you'll need more traffic. Know what your calculator assumes.
Keep the number of variants tied to the decision you need to make. Recalculate with the intended allocation and multiple-comparison method before adding another treatment.
How to Use a Free A/B Test Sample Size Calculator
For a two-arm fixed-horizon conversion test, begin with the four inputs above, then check allocation and output units. Here is how to turn a calculator result into a usable plan.
Step 1: Establish the baseline. Use conversion among the eligible population the experiment will analyze, with the same outcome definition and time window. In the hypothetical checkout example, the baseline is 3%.
Step 2: Set the MDE. A 10% relative lift from 3% means a target rate of 3.3%, a 0.3-percentage-point increase. Confirm that the calculator's relative or absolute setting matches your input, and document the power you want at that effect.
Step 3: Read the output units. The example needs approximately 53,000 visitors per variant, or 106,000 total for equal allocation. Use the calculator's unrounded result and round up for the final plan.
Step 4: Convert to duration. At 5,000 new eligible visitors per arm per week, approximately 53,000 per arm means 10.6 weeks of recruitment. Add the time needed for mature outcomes and relevant calendar coverage. The GrowthLayer sample-size calculator and MDE calculator offer complementary ways to check the sample requirement and the effect your available traffic can resolve.
What to Do Next
Calculate the sample and runtime for the next test you are considering. If they exceed the traffic or time available, compare a less sensitive design with a research-led approach. Record what the chosen method will and will not allow you to conclude.
FAQ
What is the minimum sample size per variant for an A/B test?
There is no universal minimum. The planned sample depends on the baseline, target effect, significance level, power, and design. In this guide's hypothetical two-arm example, a 3% baseline and 10% relative MDE need approximately 53,000 per variant; a 20% relative MDE needs approximately 14,000. Those values are planning estimates for the stated assumptions, not a guarantee of significance.
How many users do I need for a statistically significant A/B test?
No fixed visitor count guarantees statistical significance. A power calculation estimates the sample needed to detect a specified true effect with a chosen probability. At the planned endpoint, interpret the effect estimate and interval using the specified analysis. Reaching the sample target does not repair biased assignment, broken tracking, or an invalid stopping rule.
What sample size do I need for a 5% MDE?
For the hypothetical 3% baseline in this table, a 5% relative MDE needs approximately 208,000 visitors per variant at two-sided alpha = 0.05 and 80% power. At a 10% baseline, the estimate is approximately 58,000 per variant. Halving the MDE roughly quadruples the required sample, so check whether that sensitivity is worth the traffic and time.
Do I need to adjust sample size for more than two variants?
Yes. Recalculate using the number of comparisons, allocation, metric, and intended error-control method. Under equal allocation, adding arms increases the total sample; correcting multiple comparisons can also raise the per-arm requirement. Check what your platform already accounts for before adding a separate correction.
How do I calculate A/B test sample size?
For this fixed-horizon design, enter the baseline, MDE, significance level, and power, then check the output units. Divide per-variant sample by eligible traffic per variant, or total sample by total eligible traffic. Do not double the sample and then divide by per-variant traffic: that counts the allocation twice. Set the plan before collecting results.
Is a two-week A/B test long enough?
It depends on the planned sample, eligible traffic, outcome window, and relevant calendar cycles. Two weeks may be sufficient for one experiment and far too short for another. Estimate recruitment time first, then account for observation and conversion delays before setting the endpoint.
Start your next test plan with the GrowthLayer sample-size calculator to explore the traffic requirement, and the MDE calculator to work backward from the traffic you have. For a planning checklist covering sample size, stopping rules, and result documentation, see the Optimizely Practitioner Toolkit.
Correction (July 2026): an earlier version understated the worked-example sample needed per variant by roughly half. It also overstated the cost of adding a third variant. The table and examples above use per-variant sample sizes; total traffic also depends on the number of arms and the multiple-comparison method.