Business, Marketing & E-commerce Conversion Rate, Funnels & A/B Testing Two-proportion normal approximation (Fleiss)

A/B Test Sample Size Calculator

Enter your current conversion rate, the smallest lift worth acting on, and your daily traffic. You get the visitors each variation needs, the total sample, how many days that takes, and the smallest lift your traffic can realistically detect inside a window you can afford. Fix these numbers before you launch: a test whose sample size is decided by watching the p-value is not a 5% false-positive test, it is a coin flip dressed as evidence. The calculator uses the standard two-proportion normal approximation and applies a Bonferroni correction automatically when you test more than two variations.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
Current (baseline) conversion rateThe rate your control already converts at, measured over a recent full week or longer.5 %
How you want to state the effectRelative is the usual marketing framing; absolute is the usual statistical one.Relative lift (%)
Minimum detectable effect (relative)The smallest percentage lift over baseline that would change your decision — 20% on a 5% baseline means 6%.20 %
Minimum detectable effect (absolute)Percentage points added to the baseline — 1 pp on a 5% baseline means 6%.1 pp
Number of variations, including controlTwo means a plain A/B test; three or more triggers a Bonferroni correction on alpha.2
Daily visitors entering the testEveryone bucketed into the experiment each day, across all variations combined.2000
Test window you can affordUsed only to report the smallest lift your traffic can detect in that time.14 days
Significance level (alpha)Your tolerated false-positive rate: the chance of calling a winner that is not one.5% — 95% confidence (standard)
Statistical power (1 − beta)The chance of detecting a real effect of the size you specified. 80% is the convention.80% (standard)
Test directionUse two-sided unless you genuinely do not care how large a loss the variant causes.Two-sided

It returns

  • Visitors needed per variation — Reach this in every arm before you look at the result.
  • Total visitors needed
  • Estimated test length — Round up to a whole number of weeks before you schedule it.
  • Variant rate you are testing for
  • Smallest relative lift detectable in your window
  • Expected conversions per variation — At the baseline rate. Below roughly 100 the estimate gets unstable.

The formula

n=[z1α/22p¯(1p¯)+z1βp1(1p1)+p2(1p2)]2(p2p1)2
days=nkdaily visitors
α=αk1

In plain text: n = [ z(1−α/2)·√(2·p̄·(1−p̄)) + z(1−β)·√(p₁(1−p₁) + p₂(1−p₂)) ]² / (p₂ − p₁)²

  • nVisitors required in each variation (visitors)
  • p₁Baseline conversion rate of the control (decimal)
  • p₂Conversion rate you want to be able to detect (decimal)
  • Average of p₁ and p₂ — the pooled rate under the null hypothesis (decimal)
  • αSignificance level: tolerated false-positive rate (decimal)
  • βTolerated false-negative rate; power is 1 − β (decimal)
  • z(x)The standard normal quantile — z(0.975) = 1.959964, z(0.80) = 0.841621 (—)

This is the normal-approximation formula for comparing two independent proportions with equal group sizes, without a continuity correction. It matches R's power.prop.test with strict = FALSE and the Fleiss formulation used in Statistical Methods for Rates and Proportions.

Updated Category Conversion Rate, Funnels & A/B Testing Verified against published test cases Reading time 14 min

What a sample size actually buys you

A sample size is a purchase of statistical resolution. You are buying the ability to see an effect of a chosen size, with a chosen chance of seeing it if it is real, and a chosen chance of hallucinating it if it is not. Four numbers are welded together: the baseline rate p₁, the smallest effect you want to detect, the significance level α, and the power 1−β. Pin down any three and the fourth is arithmetic.

The reason to pin them down before launch is that the alternative corrupts the test. If you check the result every morning and stop the moment p drops below 0.05, you are not running one test at 5% risk — you are running one test per look, and the chance that at least one of them crosses the line by luck climbs far above 5%. Sequential-testing research on this “peeking” problem shows the effective false-positive rate several times the nominal level for realistic monitoring schedules. A fixed-horizon test with a pre-computed sample size is the cheapest fix: decide the stopping point once, honour it, and your 95% actually means 95%.

The number that does the most work here is the minimum detectable effect (MDE), and it is a business decision, not a statistical one. Ask what lift would be big enough to justify shipping the change, retraining the team, and carrying the code. If a 3% relative lift on checkout would pay for itself in a month, your MDE is 3% and you need a lot of traffic. If nothing under 15% would change your roadmap, say 15% and finish in a fortnight.

The formula, term by term

The numerator carries two z values because you are controlling two different errors on two different distributions. Under the null hypothesis both arms convert at the same pooled rate , so the sampling variance of the difference is 2·p̄(1−p̄); the term z(1−α/2)·√ that is how far apart two identical arms can drift by chance before you would call it significant. Under the alternative hypothesis the arms convert at p₁ and p₂, so the variance is p₁(1−p₁) + p₂(1−p₂); the term z(1−β)·√ that is how much extra room you need so that a real difference lands past the threshold most of the time. Add the two distances, divide by the effect you must span, square it.

Three consequences follow directly from the algebra, and they explain almost every surprised reaction to a sample-size estimate.

The denominator is squared, so resolution is expensive. Halving your MDE multiplies the sample by four. Detecting a 5% relative lift instead of a 20% one on a 5% baseline moves you from 8,158 visitors per arm to 122,124 — fifteen times the traffic for a target four times smaller.

Rare events cost more. For a fixed relative lift, the sample scales roughly with (1−p₁)/p₁. Going from a 10% baseline to a 1% baseline multiplies the requirement by about eleven. This is why testing on a step deep in the funnel is so slow, and why moving your primary metric up to a higher-frequency step is often the difference between a two-week test and a two-quarter one.

Power is not symmetric with significance. Raising confidence from 95% to 99% on our example takes the sample from 8,158 to 12,139 per arm, because z(0.995) = 2.575829 replaces 1.959964; raising power from 80% to 90% takes it to 10,921. Both cost traffic, but the default 80% power means you accept a one-in-five chance of missing a real effect of exactly your MDE size. If missing a winner is expensive, buy power before you buy confidence.

Worked example: 5% baseline, 20% relative lift, 95% confidence, 80% power

Your checkout converts at 5.0%. You will ship a redesign only if it lifts conversion by at least 20% relative — to 6.0%. You run a two-arm test at α = 0.05 two-sided and 80% power, with 2,000 visitors a day entering the experiment.

  1. Set the two rates. p₁ = 0.05, p₂ = 0.05 × 1.20 = 0.06. The absolute effect δ = 0.01.
  2. Look up the two z values. z(1−0.05/2) = z(0.975) = 1.959964. z(0.80) = 0.841621.
  3. Null variance. = (0.05 + 0.06)/2 = 0.055. 2 × 0.055 × 0.945 = 0.10395. √0.10395 = 0.322413.
  4. First term. 1.959964 × 0.322413 = 0.631914.
  5. Alternative variance. 0.05 × 0.95 = 0.0475; 0.06 × 0.94 = 0.0564; sum = 0.1039. √0.1039 = 0.322335.
  6. Second term. 0.841621 × 0.322335 = 0.271283.
  7. Add and divide by δ. (0.631914 + 0.271283) ÷ 0.01 = 90.3197.
  8. Square it. 90.3197² = 8,157.7 → 8,158 visitors per variation.
  9. Total and duration. 8,158 × 2 = 16,316 visitors. 16,316 ÷ 2,000 = 8.16 → 9 days, which you round up to 14 so the test covers two complete weekly cycles.

Sanity-check the conversion counts before you commit: 8,158 × 5% ≈ 408 conversions in control and about 490 in the variant if the lift is real. Those are healthy counts. If the same calculation had produced 25 conversions per arm, the normal approximation would be doing more work than the data can support.

How to read the number, and what to do when it is impossible

Start with the duration, not the sample. Convert visitors into days at your real bucketing rate — not sessions, not pageviews, but the units you randomise. Then round up to a whole number of weeks. Traffic composition swings hard between Monday and Saturday, and a test that runs Tuesday to Friday has measured a Tuesday-to-Friday audience. One full week is the floor; two is the usual professional minimum because it lets you compare week one against week two and see whether the effect is stable or a novelty spike.

Next, check the ceiling. Tests that run past about four to six weeks start to decay: cookies are cleared, people switch devices, promotions launch, and the two arms stop being the clean random split you started with. If your calculation demands ten weeks, the honest options are to test a bolder change, test a metric earlier in the funnel, pool several low-traffic pages into one test, or raise your MDE and accept that you will only ever detect large effects.

Finally, sanity-check the conversions. Roughly 100 conversions per arm is a practical floor for the normal approximation; a few hundred is comfortable. If your traffic gives you 12 conversions a week, no amount of clever statistics fixes it — switch to a funnel diagnosis and qualitative research, and reserve experimentation for the pages that actually get traffic.

When the test finishes, do not eyeball the difference. Feed the four counts into the A/B test significance calculator, and read the confidence interval rather than just the verdict: an interval that spans zero and also spans a lift you would happily ship means “inconclusive”, not “no effect”.

Visitors per variation at 95% confidence and 80% power

Two-arm test, two-sided α = 0.05, power = 80%. Read across your baseline row to the relative lift you want to detect. Double the figure for the total sample.
Baseline rateDetect +5%Detect +10%Detect +20%Detect +50%
0.5%1,280,619327,92285,86215,599
1%637,010163,09542,6937,750
2%315,20680,68221,1093,826
5%122,12431,2348,1581,471
10%57,76314,7513,841686
20%25,5836,5101,683294
30%14,8563,763963163

Computed from the formula above and rounded up. A 1% baseline needs roughly eleven times the traffic of a 10% baseline for the same relative lift.

What alpha and power actually promise

α = 0.05 means: if the variant is genuinely identical to control, you will still declare a winner 5% of the time. Run twenty null experiments and expect one false champion. Power = 80% means: if the variant genuinely differs by exactly your MDE, you will detect it 80% of the time — and miss it the other 20%. Neither number is a probability that your specific result is correct, and neither is a statement about effects smaller or larger than the MDE, which are detected less and more often respectively.

These are the conventions of the Neyman–Pearson framework, and 0.05 and 80% are conventions, not laws. A change that is cheap to ship and cheap to reverse can justify α = 0.10; a change to pricing or a regulated flow deserves α = 0.01.

Mistakes that wreck a sample-size plan

  • Confusing relative and absolute effects. On a 5% baseline, “1% lift” might mean 5.05% or 6%. Those two plans differ by a factor of roughly 370 in required traffic — about 3.0 million visitors per arm against 8,158. State which you mean, every time.
  • Sizing on total traffic instead of per variation. The formula returns n per arm. A two-arm test needs 2n; a four-arm test needs 4n and a stricter alpha on top.
  • Forgetting multiple comparisons. Testing three variants against control is three chances to get lucky. Without a correction your real false-positive rate is nearer 14% than 5%.
  • Randomising sessions but sizing on visitors. Pick one unit — usually the user — and use it consistently for randomisation, sample size and analysis. Mixing them breaks the independence the formula assumes.
  • Stopping early because the result looks good. The single most common way a well-designed test produces a wrong answer. If you need to stop early, use a sequential or always-valid method designed for it, not a fixed-horizon test read early.
  • Sizing for one metric, then reading fifteen. Every extra metric you scan is another lottery ticket. Nominate one primary metric up front; treat the rest as diagnostics.
  • Using this formula for revenue per visitor. Revenue is heavy-tailed, not binary. A proportion formula badly understates the sample a revenue metric needs — size that with the observed variance instead.
  • Ignoring the traffic split. A 90/10 split does not need n in each arm; the small arm becomes the binding constraint and the total climbs sharply. Keep splits even unless you have a reason not to.

What this calculator assumes, and when to use something else

The expression above is the two-proportion normal approximation given by Fleiss, Levin and Paik in Statistical Methods for Rates and Proportions, taken without the continuity correction; it is the same relation R evaluates in power.prop.test with strict = FALSE, which is why the two agree to the visitor. Adding Fleiss's continuity correction raises the requirement by a few percent and is the conservative choice when counts are small.

The math assumes independent observations, a fixed sample size decided in advance, equal-sized arms, a binary outcome per unit, and a normal approximation to the binomial. That covers the overwhelming majority of web conversion tests. It does not cover several cases you will eventually meet.

Very small counts. Below roughly five expected conversions per arm the normal approximation is unreliable and Fisher's exact test or an exact binomial power calculation is the right tool.

Continuous or heavy-tailed metrics. Revenue per visitor, average order value and session duration need a variance-based sample size, because a handful of large orders dominates the variance. Estimate the standard deviation from your own data first, then size for a difference in means. If revenue is what you actually care about, pair this with the revenue per visitor calculator so you know what a percentage lift is worth.

Clustered or non-independent units. If you randomise by account and measure by seat, or run a marketplace test where buyers and sellers interact, observations are correlated and the effective sample is smaller than the raw count. Cluster-randomised designs need a design-effect inflation factor.

Sequential and Bayesian designs. Group-sequential boundaries and always-valid p-values are built for continuous monitoring and can stop early legitimately, at the cost of a somewhat larger maximum sample. Bayesian designs answer a different question — the probability the variant is better — and need a decision rule and a prior rather than a sample size.

One practical note on interference: if you also need to hit a traffic target for the test to be worth running at all, model the traffic side separately with the website traffic goal calculator, and price the winner's value with customer lifetime value rather than first-order conversions alone.

Key terms

Minimum detectable effect (MDE)
The smallest true difference the test is designed to find. Smaller MDE, larger sample — by the square of the ratio.
Significance level (α)
The false-positive rate you accept: the probability of declaring a winner when the two arms are identical.
Power (1 − β)
The probability of detecting an effect of exactly the MDE size when it is real. Conventionally 80%.
Two-sided test
A test that can detect a change in either direction. It splits α between the two tails, which is why it needs more data than a one-sided test.
Bonferroni correction
Dividing α by the number of comparisons to keep the family-wide false-positive rate at the nominal level. Conservative but simple.
Fixed-horizon test
A test whose sample size is decided before launch and read only once, at the end. The assumption behind every classical p-value.
Sample ratio mismatch (SRM)
When the observed split between arms differs from the intended split by more than chance allows — a signal that the experiment's plumbing, not the variant, produced the result.

Frequently asked questions

How many visitors do I need for an A/B test?

It depends almost entirely on your baseline rate and the lift you want to detect. At a 5% baseline, detecting a 20% relative lift at 95% confidence and 80% power takes about 8,158 visitors per variation; detecting a 5% relative lift takes about 122,124. At a 20% baseline the same 20% lift needs only 1,683 per arm. Enter your own rate above rather than reaching for a rule of thumb — the range across realistic inputs spans three orders of magnitude.

Should I use relative or absolute minimum detectable effect?

Use whichever your stakeholders speak, but state it explicitly. Relative (“+20%”) travels well between metrics and matches how uplift is reported. Absolute (“+1 pp”) is what the formula consumes and is unambiguous. The trap is a sentence like “we want to detect a 1% improvement” on a 5% baseline: read as relative it means 5.05% and needs about 3.0 million visitors per arm; read as absolute it means 6% and needs 8,158.

Can I stop the test as soon as it reaches significance?

Not with this design. A fixed-horizon sample size assumes exactly one look, at the end. Checking daily and stopping at the first dip below 0.05 inflates your false-positive rate well beyond the nominal 5%, because each look is another chance for noise to cross the line. If you need the option to stop early, use a group-sequential design or an always-valid sequential test — both are built for continuous monitoring and cost a modestly larger maximum sample in exchange.

Why does my test need more traffic when I add a third variation?

Two reasons compound. First, each arm still needs its own n, so three arms need 3n visitors rather than 2n. Second, testing two variants against one control is two comparisons, and two chances to get a false positive. This calculator divides alpha by the number of comparisons (Bonferroni), which raises the z value and therefore n per arm as well. A three-arm test typically needs roughly 1.8 times the total traffic of the equivalent A/B test.

What if I do not have enough traffic for any meaningful test?

Change what you test rather than lowering your standards. Test bolder changes, which have larger true effects; move the primary metric to a higher-frequency step such as add-to-cart or signup start; pool similar pages into a single experiment; or test the whole site rather than one template. Below a few hundred conversions per month, structured qualitative work — session replay, exit surveys, usability testing — finds more money per hour than underpowered experiments.

Is 80% power enough?

80% is the convention, and it means you will miss a real effect of exactly your MDE size one time in five. That is a big miss rate if the change is expensive to build or the metric is strategically important. Moving to 90% power costs about 34% more traffic — on the 5%-to-6% example, 10,921 per arm instead of 8,158. When missing a winner costs more than a wasted week of traffic, buy the extra power.

Should the test be one-sided or two-sided?

Two-sided, in almost every commercial case. A one-sided test buys you about 21% less traffic — 6,426 versus 8,158 per arm on our example — but it does so by refusing to notice a loss. Since the realistic outcome of any redesign includes “it hurt conversion,” and you very much want to know that, keep both tails. One-sided is defensible only for a change you would ship regardless of how badly it performed, which is rare.

Does the calculator handle unequal traffic splits?

Not directly — it assumes equal arms, which is the efficient design for a fixed total sample. If you must run a 90/10 split, the small arm dictates the timeline: it needs its own full n, so the total sample balloons to roughly ten times n. Enter your traffic as the amount flowing into the smallest arm multiplied by the number of arms if you want a rough duration, and expect the estimate to be optimistic.

Why does the calculator suggest more days than the raw arithmetic?

Because it rounds up to whole days and because full weeks matter. Weekday and weekend visitors differ in intent, device mix and conversion rate, so a test that covers four weekdays measures four weekdays. Whenever the arithmetic lands between week boundaries, extend to the next multiple of seven. The estimate also assumes your daily traffic figure is the number of units actually bucketed into the experiment, which is usually lower than total site sessions.

References

  • power.prop.test — Power Calculations for Two-Sample Test for Proportions (stats package documentation)R Core Team
  • Statistical Methods for Rates and Proportions, 3rd ed. — Wiley (Fleiss, Levin & Paik)
  • Sample Size Calculations in Clinical Research, 2nd ed. — Chapman & Hall/CRC (Chow, Shao & Wang)
  • Trustworthy Online Controlled Experiments: A Practical Guide to A/B Testing — Cambridge University Press (Kohavi, Tang & Xu, 2020)
  • Peeking at A/B Tests: Why It Matters, and What to Do About It — Proceedings of KDD 2017 (Johari, Koomen, Pekelis & Walsh)