A/B Sample Size Planner

Design tool

Plan the required sample size for A/B tests that compare two independent groups — either two proportions (conversion rates) or two means (continuous metrics). Explore how detectable effect size, baseline rates or variability, power, and confidence level change the per-group and total sample size.

👨‍đŸĢ Professor Mode: Guided Learning Experience

New to sample size planning? Enable Professor Mode for step-by-step guidance through determining the right sample size for your A/B test!

OVERVIEW & WHAT THIS TOOL SOLVES

Ending an A/B test after a few hundred clicks almost guarantees you will either miss a profitable conversion lift (an underpowered test) or get fooled by early random noise. Before you launch a two-group experiment on conversion rates or average order value, you need to know how much traffic each arm requires. The A/B Test Sample Size Planner calculates the exact per-group sample size needed to reliably detect your Minimum Detectable Effect (MDE) at your chosen confidence and statistical power.

đŸŽ¯ Questions It Answers

  • How many visitors, emails, or orders do we need per group to detect a target conversion lift (e.g., 20% to 25%)?
  • How many transactions per arm are required to detect a dollar shift in Average Order Value (AOV)?
  • How steeply does required traffic climb if we demand 90% power instead of 80% or chase a smaller lift?

📂 What Data You Need

  • Baseline Benchmark: Current Group A conversion rate (for proportions) or baseline mean and standard deviation (for continuous metrics).
  • Minimum Detectable Effect (MDE): The smallest Variant B rate or mean shift that justifies rolling out the change.
  • Risk Tolerances: Confidence level (typically 95%, Îą = 0.05) and Statistical Power (typically 80% or 90%).

💡 What You'll Discover

  • Per-Arm & Total Sample Size: Exact headcount required in Control (Group A) and Treatment (Group B).
  • Power & Effect-Size Tradeoff Curves: Visual sensitivity charts showing how sample size scales with MDE, power, and confidence.
  • Range-to-Sigma Helper: Built-in estimator to approximate standard deviation when you only know the expected min and max.
🔍 Key Nuances & Common Traps to Watch For
  • The Inverse-Square Law of Lift: Required sample size is inversely proportional to the square of the effect size. Cutting your target lift in half (e.g., trying to detect a 1-point lift instead of a 2-point lift) requires 4× as much traffic.
  • Relative Lift vs. Absolute Percentage Points: Raising a 2.0% conversion rate by "10% relative lift" means moving from 2.0% to 2.2% (an absolute lift of 0.002), which requires a much larger sample than moving from 20% to 22%. Always verify the exact baseline and variant proportions entered.
  • No Peeking Without Adjustment: The sample size calculated here assumes you wait until both arms reach their target sample size before calling a winner.
📐 Under the Hood: Model Equations & Variable Definitions
1. Per-Group Sample Size for Two Independent Proportions & Two Independent Means
\[ n_{\text{per group, prop}} \approx \frac{\left[z_{1-\alpha^*}\sqrt{2\bar{p}(1-\bar{p})} + z_{1-\beta}\sqrt{p_1(1-p_1)+p_2(1-p_2)}\right]^2}{(p_2 - p_1)^2} \] \[ n_{\text{per group, mean}} \approx \frac{2\,(z_{1-\alpha^*} + z_{1-\beta})^2 \sigma^2}{\Delta^2} \quad (\text{where } \Delta = \mu_2 - \mu_1) \]
đŸ’Ŧ Read it in plain English: Required sample size per arm increases with higher outcome variability (pĖ„(1 − pĖ„) or ΃2) and stricter confidence/power multipliers (z1−α*, z1−β), and shrinks with the square of the target lift (p2 − p1 or Δ).
p1, p2, p˄
Baseline, Variant & Pooled Proportions YOUR DATA ⓘ
Control conversion rate (p1), target Variant rate (p2), and pooled average rate p˄ = (p1 + p2)/2.
Îŧ1, Îŧ2, Δ, ΃
Group Means, Minimum Lift & Standard Deviation YOUR DATA ⓘ
Expected group averages (Îŧ1, Îŧ2), target mean difference (Δ), and within-group standard deviation (΃).
z1−α*, z1−β
Confidence & Power Normal Critical Values INFERENCE ⓘ
Standard normal multipliers for significance threshold α* (e.g., 1.96 for 95% two-sided) and desired power 1 − β (e.g., 0.84 for 80% power).
nper group
Required Sample Size Per Arm OUTPUT ⓘ
Number of independent observations needed in Control and in Variant (multiply by 2 for total experiment traffic).

MARKETING SCENARIOS

Use presets to explore realistic A/B testing questions a marketing analyst might face, such as subject line experiments, landing page redesigns, or new upsell offers at checkout. Each scenario sets a baseline rate or mean, a minimum effect that would justify a rollout, and default confidence/power so you can see how many impressions, visits, or orders you would need before calling a winner.

INPUTS & SETTINGS

Specify the A/B test

Two proportions (e.g., A/B conversion rates)

Use last campaign's conversion rate or open rate as your baseline.

Minimum effect you care about (e.g., from 20% to 25%).

The detectable lift is \(\Delta_p = p_2 - p_1\). The planner will compute the per-group sample size needed to detect at least this difference with your chosen power and confidence.

Two means (e.g., order value or time on site)

Use prior data or a pilot to approximate variability.

Help me estimate \(\sigma\) from a range

If you only have a rough sense of the minimum and maximum values you expect, you can use the rule-of-thumb that, for approximately bell-shaped data, most observations fall within about \(\pm 2\sigma\) of the mean. That implies the total range is roughly \(4\sigma\), so \(\sigma \approx \frac{\text{max} - \text{min}}{4}\).

This will set \(\sigma\) to \((\text{max} - \text{min}) / 4\). Use it as a starting point and refine with pilot data when available. This is especially handy for bounded marketing survey scales (for example, a 1–7 satisfaction rating), where the minimum and maximum are known.

The detectable difference in means is \(\Delta_\mu = \mu_2 - \mu_1\). The planner will estimate the per-group sample size needed to detect at least this shift.

Confidence and alpha are linked: confidence = 1 - alpha (for two-sided tests).

Common choices are 80% or 90% power.

Advanced settings

Two-sided tests are standard when any increase or decrease is important. One-sided tests focus on a directional improvement but assume you would not act on a decrease.

Use unequal allocation when you want to expose more traffic to the new variant or limit exposure to a risky treatment. Equal allocation is simplest and most efficient when costs are similar.

Additional info about these settings

Confidence level & alpha: Alpha (for example, 5%) is the false-alarm rate you accept: if the variant truly made no difference, about 5% of tests like this one would still come out "significant" by chance alone. The matching confidence level (95%) is how often intervals built this way would contain the true effect.

Power: Power is the probability that your test will detect the specified effect size if it is really present in the population. Higher power reduces the risk of a false negative but requires more observations.

Test type: A two-sided test checks for any difference between groups (better or worse). A one-sided test checks only for an improvement (or only for a decline), which can lower the required sample size but must be justified by the decision context.

Allocation ratio: The ratio controls how many observations are assigned to Group B relative to Group A. A 1:1 ratio is typical for clean comparisons; unbalanced designs can be useful when one variant is more expensive, riskier, or more interesting to over-sample.

VISUAL OUTPUT

Required total sample vs. effect size

This chart shows how required total sample size changes as the effect size gets larger. For proportions, the x-axis is \(|p_2 - p_1|\) (difference in rates); for means, it is \(|\mu_2 - \mu_1|\).

Required total sample vs. power

This chart plots required sample size against desired power, holding other inputs fixed. Higher power (greater sensitivity) always requires a larger sample size.

Required total sample vs. variability

This chart shows how assumptions about variability affect the required sample size: for proportions, different baselines \(p_1\); for means, different values of the common standard deviation \(\sigma\).

DESIGN SUMMARY

Required n (Group A): –
Required n (Group B): –
Total sample size (N): –
Outcome type: –
Test / Power: –

APA-Style Planning Statement

Provide baseline values, effect size, confidence, and power above to generate an APA-style statement summarizing the required sample size per group.

Managerial Interpretation

This panel will translate the design into plain language, explaining how many observations you need in each arm of the A/B test, and how that depends on the effect size, baseline, power, and confidence.

DIAGNOSTICS & ASSUMPTIONS

Diagnostics & Assumption Checks

These sample size formulas assume independent observations in each group, stable baselines, and that the two groups only differ through the treatment / variant. When outcomes are rare, highly skewed, or overdispersed, or when you use repeated measures or clustering, consult more advanced designs (e.g., mixed models or cluster-randomized power calculations).

If the smallest lift worth acting on needs more traffic than you have, you can run the test longer, knowingly accept lower power (a higher chance of missing a real lift), or decide not to run the test. Do not raise the target lift just to make the sample fit.