DEV Community

NetEngineerLab
NetEngineerLab

Posted on

A/B Test Sample Size Math: Why Minimum Detectable Effect Dominates Runtime

Product teams often ship a checkout or onboarding experiment, check the dashboard three days later at 800 visitors per arm, see "Variant B is +12% ahead," and ship it—only to watch conversion revert to baseline the following week.

Before launching an A/B test behind a feature flag, computing the required sample size tells you whether your traffic can even detect the change you care about in a reasonable timeframe. The single number that controls runtime more than anything else is the Minimum Detectable Effect (MDE).

Absolute percentage points vs. relative lift

Mix-ups between relative lift and absolute percentage-point lift skew sample size plans by an order of magnitude.

Suppose your current signup conversion rate is 10%:

  • An absolute lift of 2 percentage points tests whether the variant reaches 12% (10% + 2 pp).
  • A 2% relative lift tests whether the variant reaches 10.2% (10% × 1.02)—a tiny shift that needs dramatically more traffic to separate from random noise.

Always confirm which unit your formula or feature-flag calculator expects before reading the visitor count.

Why halving MDE nearly quadruples required visitors

Under a standard two-sided z-test for two independent proportions with equal group sizes, unpooled variance, no continuity correction, alpha = 0.05 (95% confidence), and power = 0.80:

n = (z_(α/2) + z_β)² × [p₁(1 − p₁) + p₂(1 − p₂)] ÷ (p₂ − p₁)²
Enter fullscreen mode Exit fullscreen mode

Because the absolute difference (p₂ - p₁) sits squared in the denominator, shrinking the lift you want to detect explodes the sample size. Keep the same 10% baseline and check three MDE targets:

Baseline (p₁) Variant (p₂) Absolute lift (MDE) Visitors per variation (rounded up) Total visitors (2 arms)
10% 14% 4 pp 1,033 2,066
10% 12% 2 pp 3,839 7,678
10% 11% 1 pp 14,749 29,498

Moving from a 2 pp MDE (3,839 per variation) to a 1 pp MDE (14,749 per variation) requires 3.84× more traffic.

(Note: calculators that use pooled variance under the null hypothesis—such as Evan Miller's sample size tool—can differ slightly by a few visitors per arm from unpooled-variance formulas, though the 1 / MDE² scaling behaves identically.)

Translating visitor counts into calendar weeks

Suppose your pricing page gets 1,000 eligible visitors per day, split 50/50 (500 visitors per variation per day):

  • Detecting a 2 pp shift (10% -> 12%) takes 3,839 ÷ 500 = 7.68 days—so you plan a 14-day run to cover two clean weekly cycles.
  • Detecting a 1 pp shift (10% -> 11%) takes 14,749 ÷ 500 = 29.50 days—nearly five weeks before you even reach statistical power.

Seeing that calendar math upfront prevents teams from launching tests that either drag on for a quarter or get called early out of impatience.

Three rules to keep experiments honest

Once you have a pre-computed target count per variation:

  1. Do not stop early on a lucky p-value: Checking results daily and declaring a winner at 900 visitors when your planned sample is 3,839 inflates false positives well past 5%. Wait until both groups reach the planned count.
  2. Remember sample size is not win probability: A required count of 3,839 visitors does not mean the variant has an 80% chance of winning. It means if the true lift is at least 2 percentage points, the test has an 80% chance of detecting it at alpha = 0.05.
  3. Run full weekly cycles: Even if a high-traffic page reaches 3,839 visitors per arm in 36 hours, weekend vs. weekday traffic mixes differ. Extending to at least one full 7-day cycle avoids baking Tuesday-only behavior into a permanent rollout.

If your daily traffic shows that detecting a 1 pp lift takes six months, you know upfront to either test a bolder change or optimize a higher-volume upstream step instead of running an underpowered experiment.

I maintain AI MarkTool, where the A/B Test Sample Size Calculator runs locally in your browser using this two-sided unpooled z-test (alpha = 0.05, power = 0.80) and reports visitors per variation rounded up to whole visitors.

Top comments (0)