📈
📈 Business tools

A/B Test Sample Size Calculator

Results update as you type.

Your numbers

Understanding the A/B test sample size calculator — concept and principle

Before you start an A/B test you need to know how many visitors each version must see. Too few and a real improvement can be lost in random noise; too many and you waste traffic and time. This calculator gives the visitors needed per variant for a test that compares two conversion rates.

A/B test sample sizeTo detect a rise from 4% to 4.6% with 5% significance and 80% power, each version needs 17,943 visitors, 35,886 in total. A 30% lift would need 4,783 per variant and a 7.5% lift 69,379.Visitors needed to spot 4% → 4.6%A4% converts17,943 visitorsB4.6% (+15%)17,943 visitorsα 5% → z 1.96 · power 80% → z 0.84Smaller lift → far more visitors per variant+30%4,783+15%17,943+7.5%69,379Total for A + B: 35,886 visitors
Halving the lift you want to detect roughly quadruples the visitors you need.

How it is calculated

The calculator uses the standard sample size formula for a two-sided two-proportion z-test:

n = (z₁₋α/₂ · √(2p̄(1 − p̄)) + z₁₋β · √(p₁(1 − p₁) + p₂(1 − p₂)))² ÷ (p₂ − p₁)²

The principle

Each observed conversion rate wobbles around its true value. The size of that wobble shrinks with the square root of the sample. The formula picks n so that two things hold at once: if there is no real difference, a false alarm happens only α of the time, and if the true lift is as large as your target, the test detects it with probability equal to the power. Because the gap (p₂ − p₁) is squared in the denominator, halving the lift you want to detect roughly quadruples the required sample.

Worked example

  1. p₁ = 0.04, p₂ = 0.04 × 1.15 = 0.046 (4.6%), p̄ = 0.043.
  2. z₁₋α/₂ = 1.95996, z₁₋β = 0.84162.
  3. First term: 1.95996 × √(2 × 0.043 × 0.957) = 0.56228. Second term: 0.84162 × √(0.04 × 0.96 + 0.046 × 0.954) = 0.24142.
  4. (0.56228 + 0.24142)² = 0.64594; divided by (0.006)² = 0.000036 gives 17,942.7.
  5. Rounded up: 17,943 visitors per variant, 35,886 in total.

How to read the result

Divide the total by your daily eligible traffic to estimate the test duration, and run it for whole weeks so weekday effects even out. If the duration is unrealistic, test a bolder change (larger lift) or a higher-traffic page rather than cutting the sample. Low baseline rates need much larger samples.

Common mistakes

Keep in mind: The formula assumes independent visitors, a fixed sample decided in advance and stable conversion rates during the test. Sequential peeking, multiple variants or many metrics need corrections not included here.

Frequently asked questions

What power should I use?

80% is the common default; 90% gives more protection against missing a real effect at the cost of about a third more traffic.

Does the sample count visitors or sessions?

Use the unit you randomise on. If users are assigned to a variant, count users, not page views.

Why is my required sample so large?

Small baseline rates and small lifts both push n up sharply, because the difference you are measuring is tiny relative to the noise.

Sources: Fleiss, Levin & Paik, Statistical Methods for Rates and Proportions, 3rd ed. (Wiley, 2003) · Kohavi, Tang & Xu, Trustworthy Online Controlled Experiments (Cambridge University Press, 2020)

Checked 8 Nov 2026. Standard business and finance formulas. Estimates for information only.

📈 All business tools →🌍 Calculators by country →