AB

A/B Test Calculator

The visitors each variant needs to detect a lift in conversion rate, and whether a finished A/B test is significant: rates, uplift, z, p-value and a confidence interval.

Statistics & ProbabilityRuns in your browser

Result…

Calculate
%

The rate the control (A) converts at now, from your own analytics.

Minimum detectable effect is
%

The smallest change worth detecting. Relative 20% on a 5% baseline means 5% → 6%; absolute 1 point means the same here.

%

The chance of detecting the effect if it is real. 80% is a common choice.

Optional: 0 skips the duration.

%

Two-sided. 5% means 95% confidence.

 

…

How it's calculated

Sample size per variant: n = (z₁₋α/₂ √(2p̄(1 − p̄)) + z₁₋β √(p1(1 − p1) + p2(1 − p2)))² ÷ (p2 − p1)², p̄ = (p1 + p2) ÷ 2
Test: z = (pB − pA) ÷ √(p(1 − p)(1/nA + 1/nB)), p pooled
p-value = 2 × (1 − Φ(|z|))
Interval: (pB − pA) ± z₁₋α/₂ √(pA(1 − pA)/nA + pB(1 − pB)/nB)

An A/B test splits visitors between a control (A) and a variant (B) and compares their conversion rates. Before the test, the sample size says how many visitors each side needs so that a real lift of the size you care about is found with the power you choose, at a two-sided significance level α. After the test, the two-proportion z-test compares the rates using the pooled rate for the standard error; the p-value is the chance of a difference at least this large if both truly converted alike. The confidence interval for the difference uses each rate's own standard error (the Wald interval). Both are normal approximations, which work well when each variant has at least a handful of conversions and non-conversions.

Your numbers, step by step

    About the A/B Test calculator

    This A/B test calculator does two jobs. Before a test, it works out how many visitors each variant needs. You give it your baseline conversion rate, the smallest lift worth detecting (relative to the baseline or in percentage points), the significance level and the power, and it can turn that into a number of days at your traffic. After a test, it compares the control and the variant with a two-sided two-proportion z-test. It reports both conversion rates, the relative uplift, the z-score, the p-value, a confidence interval for the difference and a plain decision. Marketers, product teams and analysts use it to plan experiments on landing pages, emails, checkouts and pricing pages, and to read the results honestly. The working shows each formula with your numbers, so you can check it against a statistics package.

    How to use it

    1. Choose “Sample size” to plan a test or “Test result” to analyse one.
    2. For a plan, enter the “Baseline conversion rate”, the “Minimum detectable effect” and whether it is relative or absolute, and the “Statistical power”.
    3. Optionally add “Visitors a day in the test (all variants)” to see how many days it needs.
    4. For a result, enter the visitors and conversions in A and in B.
    5. Set the “Significance level (α)”, then read the p-value, the interval and the decision.

    Worked example

    With a 3% baseline and a 10% relative lift to detect (3% to 3.3%) at α = 5% and 80% power, each variant needs 53,211 visitors, so 106,422 in all, which is 27 days at 4,000 visitors a day. Later, 240 of 8,000 convert in A (3%) and 296 of 8,000 in B (3.7%), a 23.33% uplift. Then z = 2.46 and p = 0.0139, below 0.05, and the 95% interval for B − A runs from 0.1425 to 1.258 percentage points.

    Updated

    Questions people ask

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

    It depends mostly on the baseline rate and the smallest lift you want to detect. Halving the lift roughly quadruples the sample. Enter your own baseline and lift rather than a rule of thumb.

    What is the formula for A/B test sample size?

    n = (z₁₋α/₂ √(2p̄(1 − p̄)) + z₁₋β √(p1(1 − p1) + p2(1 − p2)))² ÷ (p2 − p1)² per variant, with p̄ the average of the two rates. The general sample size calculator covers surveys and means.

    How do I know if my A/B test result is significant?

    Compare the p-value with the significance level you chose before the test. If p is below α, a difference this large would be unlikely when A and B truly convert alike. The p-value calculator converts other test statistics.

    Can I stop the test as soon as it becomes significant?

    No. Checking repeatedly and stopping at the first p below α makes false wins much more likely than α suggests. Fix the sample size in advance and read the result once it is reached.

    What is the difference between relative and absolute effect?

    Relative is a share of the baseline: 10% of 3% is 0.3 points, giving 3.3%. Absolute is in percentage points: a 1 point lift on 3% gives 4%.

    What are the limits of this calculator?

    It assumes two variants, equal traffic, independent visitors and a single conversion metric, and it uses normal approximations. With several variants or metrics, very low counts or sequential testing, use a correction or a method designed for it, and ask a statistician for high-stakes decisions.

    More in Statistics & Probability