ScreenFlows Request access

A/B Test Sample Size & Duration Calculator

Calculate required visitors per variant and test duration from baseline conversion rate, minimum detectable lift, alpha, and power. Includes formulas.

Published · Updated

A/B testingsample sizestatistical significanceconversion rate

Three days into a test, a variant appears to lead by 20%. That estimate may change substantially. Planning the outcome, sample and follow-up beforehand helps determine whether the test can answer the question.

Before starting a test, estimate the sample you need.

Diagram illustrating how smaller minimum detectable lifts require sharply larger A/B test sample sizes

What this result answers

Suppose 5% of eligible visitors currently register, and a team considers a change worthwhile if the rate reaches 6%. With two independent, equally allocated groups, a two-sided test, α = 0.05 and 80% power, the calculator returns 8,158 per group, or 16,316 total. At a constant 1,000 eligible independent visitors assigned to the test per day, the arithmetic estimate is 17 days.

These are planning figures, not a prediction of the true effect. Traffic, allocation and data quality can change; the variant can perform worse. Even at the planned sample size, a result can be non-significant.

Choosing inputs

  • Baseline rate: use historical data with the same outcome, eligibility, assignment unit and follow-up window as the experiment. Note promotions or seasonality that affect that history. Enter 5 for 5%.
  • Minimum detectable effect (MDE): the difference the plan is designed to detect at the selected power. It is not a guaranteed detection threshold or the improvement a redesign will produce. Moving from 5% to 6% is a 20% relative lift: enter 20 in relative mode. It is also a one-percentage-point absolute increase: enter 1 in absolute mode.
  • Significance and power: for a fixed two-sided design, α = 0.05 controls the long-run false-positive rate at about 5% when the no-difference and model assumptions hold. Power of 80% means roughly an 80% chance of rejecting no difference if the true difference equals the planned effect and other assumptions hold. Neither is the probability that this particular result is correct.
  • Traffic: daily visitors means eligible independent units actually assigned across the test, not all page views. The page divides total sample by daily traffic and rounds up. It does not model fluctuations, holidays or delayed enrollment.

Formula and conditions

The calculator uses a normal approximation for a two-sided two-proportion z-test, assuming random assignment, equal group sizes and approximately independent binary outcomes. With control p₁, expected variant p₂ and p̄ = (p₁ + p₂)/2, the sample per group is rounded up:

n = [z(1−α/2)√(2p̄(1−p̄)) + z(power)√(p₁(1−p₁)+p₂(1−p₂))]² / (p₂−p₁)²

If workspaces are randomized, consider workspaces as the independent units. Repeated sessions by a person, members of the same household, or visitors competing for limited seats can be dependent; page views cannot simply be treated as independent samples. Unequal allocation, rare outcomes, stratification and cluster experiments require additional planning. See the R two-proportion power documentation.

The page currently accepts positive lifts only; it cannot enter an expected decline or calculate unequal group allocations. For more than two groups, it multiplies the same unadjusted two-group sample by the number of groups. It does not correct for multiple comparisons. Recalculate for the chosen multiple-testing procedure when variants share a control.

Using the duration and result

The day count does not replace a schedule. Even if traffic arrives early, account for a complete business cycle. Seven days cover one week, not every holiday, long decision cycle or traffic pattern. Each participant also needs a complete conversion window; reaching the total sample does not make a newly assigned person a non-converter.

If traffic is too low, fix confirmed faults first or identify a meaningful change with an effect large enough to test. A larger redesign does not guarantee a larger effect. “Started signup” occurs earlier than payment but is not a reliable substitute for it; monitor the business outcome too. For an ordinary fixed-sample test, repeatedly checking p-values and stopping at the first significant result changes the error rate. If continuous decisions are needed, design an appropriate sequential method in advance.

References

FAQ

Does a non-significant result rule out effects larger than the MDE?

No. It means the data did not reject the no-difference hypothesis at the chosen level. An effect larger than the planned MDE can still be missed. Review the difference interval against a business threshold chosen beforehand. The result calculator compares two rates when its independence and sample assumptions are appropriate.

Where does ScreenFlows help?

Use the journey map and flow network to inspect exits and differences between converter and non-converter paths, then select a hypothesis to investigate. Conversion levers model historical paths; an estimate does not prove the revenue effect of a proposed change. Sample planning and randomized testing remain separate work.