A/B Test Sample Size Calculator

Run a test on too few visitors and a lucky week looks like a winner. This calculator tells you, before you launch, exactly how many visitors each variation needs — so you commit to a test you can actually finish.

Sample size answers one question: how many visitors must each variation collect before a real difference can be told apart from noise? It comes from the standard two-proportion z-test driven by four numbers — your baseline rate, the minimum detectable effect (MDE), your confidence level, and statistical power. Lower baselines and smaller lifts demand far larger samples; required size scales with roughly the inverse square of the effect, so halving the lift you chase quadruples the visitors you must buy.

The calculator

A/B Test Sample Size Calculator inputs and result

Control’s current conversion or click rate.
Smallest relative lift you want to detect.
Control plus challengers (2 = A/B).
95% is the common default.
Chance of catching a real effect.
✓ Sample size computed
Visitors per variation
0
0variations
0total sample
Export

Walkthrough

How to use this calculator

  1. Enter the control’s baseline rateUse the variation you are testing against — conversion rate for a landing page, click rate for an ad. The lower this rate, the bigger the sample you will need.
  2. Name the minimum detectable effectDecide the smallest relative lift worth detecting. This single choice drives most of the sample size, so pick it on business value, not statistical convenience.
  3. Set variations, confidence, and powerTwo cells is a classic A/B; each extra challenger adds another full sample. Keep 95% confidence and 80% power unless you have a reason to change them.
  4. Read the per-variation and total figuresThe big number is visitors per variation; the total multiplies it by your number of cells. That total is what your traffic and timeline must supply.
  5. Check the confidence table, then exportSee how 90%, 95%, and 99% change the cost before you commit. Copy a share link, download the CSV, or print the plan.

From the desk

RGM Expert Says

Real Growth Matters — Experimentation practiceHow we use this tool with clients

The single most common reason a test ‘fails’ is that it was never powered to succeed. A team ships a variation, watches a noisy dashboard for ten days, sees the lines cross, and calls a winner that evaporates on rollout. We size the test first so that does not happen — the number this tool returns is the price of an answer you can trust, and it is far cheaper to know it before launch than to relearn it after a bad decision.

What surprises clients most is how punishing small lifts are. Going from a 20% detectable effect to a 10% one does not double the sample — it roughly quadruples it, because the math scales with the inverse square of the effect. That is why we push hard on the MDE conversation up front: the honest question is not ‘how small a lift can we find?’ but ‘how big a lift is worth the traffic it would take to prove?’

We also use the figure as a go/no-go filter. If a fair test would need three months of your entire traffic, that is not a sample size problem to solve with patience — it is a signal to test a blunter change, raise the baseline first, or pick a different bet. The calculator turns a vague worry into a number a team can plan a roadmap around.

The math

How it works

Sample size comes from inverting the two-proportion z-test: how many observations per cell are needed so a true difference of your chosen size would clear the significance bar with the power you set.

n per variation = ( zα√(2 p̅(1−p̅)) + zβ√(p₁(1−p₁) + p₂(1−p₂)) )² ÷ (p₁−p₂)²
p₂ = p₁ × (1 + MDE)   p̅ = (p₁ + p₂) ÷ 2
  • p₁ — baseline rate of the control.
  • p₂ — target rate after the minimum detectable lift.
  • zα — critical value for your confidence (1.96 at 95%, two-sided).
  • zβ — value for your power (0.842 at 80%).

This is the standard two-proportion sample-size formula (Wang & Chow, 2007; see this worked reference). For the theory behind power and sample size, see Evan Miller’s sample-size note.

Why it matters

An underpowered test is worse than no test

A test that is too small does not just fail to find an effect — it actively misleads. With too few visitors, ordinary week-to-week variance swamps any real signal, so the result that happens to look biggest gets shipped, and the gain disappears in production. Naming the sample size first is how you avoid paying for noise dressed up as insight.

The MDE is the lever that matters. Because required size scales with roughly the inverse square of the effect, the difference between sizing for a 20% lift and a 10% lift is roughly fourfold. Teams that skip this step tend to discover, three weeks in, that the test would need to run for a quarter — a problem far cheaper to learn about on a calculator than on a calendar.

Sample size is also a roadmap tool. Once you know what a fair test costs in traffic, you can sequence experiments by feasibility: run the high-traffic, big-swing bets that resolve fast, and batch the subtle ones for pages that actually have the volume to settle them.

Benchmarks

How baseline and MDE move the sample

There is no single ‘right’ sample size — it falls out of your baseline and the lift you want to detect. These figures (95% confidence, 80% power, per variation) show the shape of the trade-off.

BaselineMDE (relative)Per variationRead
5%20%~8,200Workable for most paid funnels
5%10%~31,000Roughly 4× the 20% case
2%20%~21,000Low baselines cost dearly
10%20%~3,800High baselines settle fast
RGM analysis using the two-proportion z-test (rounded). Verify your exact case with the calculator above.

Voices worth trusting

What the experts say about sizing

Deciding the sample size in advance, and not peeking until you reach it, is the difference between an experiment and a guess dressed up with numbers.
Statistical Methods in Online A/B Testing (paraphrase)
Most A/B tests are underpowered, so most reported wins are overstated; design for the effect you can afford to detect.
Trustworthy Online Controlled Experiments (paraphrase)

Go deeper

Books on experiment design

Related on RGM

Keep learning

FAQ

Common questions

How many visitors do I need for an A/B test?
Enter your baseline rate and the minimum detectable effect above. The calculator returns the visitors per variation from a two-proportion z-test at your chosen confidence and power. Lower baselines and smaller lifts need much larger samples.
What sample size formula does this use?
The standard two-proportion z-test sample-size formula, using your baseline rate, target rate after the lift, the critical value for your confidence level, and the value for your power. It is the same math underlying most reputable A/B test calculators.
Why does a smaller lift need so much more sample?
Required sample scales with roughly the inverse square of the effect size. Cutting the detectable lift in half multiplies the sample by about four, which is why the MDE is the single biggest driver of cost.
What confidence and power should I pick?
Most teams use 95% confidence (a 5% false-positive rate) and 80% power (a 20% chance of missing a real effect). Raising either increases the sample required.
Does adding more variations change the sample?
Yes. Each variation needs its own full sample, so the total is the per-variation figure times the number of cells. Multi-arm tests also raise the multiple-comparison risk, which usually argues for higher confidence.
Is this the same as test duration?
No — sample size is how many visitors you need; duration is how long that takes at your traffic. Feed this total into our test duration estimator to get the number of days.

Related tools

Related tools