Skip to content

A/B Test Calculator

Runs a two-proportion z-test and a chi-square test on two conversion rates with Wilson confidence intervals, and computes the sample size for a target effect and power.

Two conversion rates in, and a verdict on whether the difference is real: a two-proportion z-test, a chi-square test and Wilson confidence intervals for each rate. It also computes the sample size you need before you start, which is the calculation that would have saved most of the tests people stop early.

🔒 Runs entirely in your browserab-teststatisticsexperimentmarketing

What to do

Mode
Significance level α

Observed

A (control)

B (variant)

Test result

Significant (p = 0.0074 < 0.05)

A conversion rate

20.00%

95% interval 17.64% – 22.59% (Wilson)

B conversion rate

25.00%

95% interval 22.42% – 27.78% (Wilson)

Difference (B − A)

+5.00%pp

interval 1.35%pp – 8.65%pp

Relative lift

+25.0%

Two-proportion z-test (two-sided)

p̄ = 0.225 · SE = 0.01867 · z = 2.677 · p = 0.0074

Chi-square test (1 df)

χ² = 7.168 · p = 0.0074

Yates-corrected χ² = 6.885 · p = 0.0087

The z-test uses the pooled standard error under the null hypothesis; the confidence interval for the difference uses the unpooled one. Each conversion-rate interval is a Wilson score interval, so it never falls below 0% when conversions are few. The normal distribution comes from the Marsaglia (2004) series, its quantiles from the Acklam approximation with a Halley correction, and chi-square from the incomplete gamma function (Numerical Recipes §6.2). If another calculator on the web gives you half or double this sample size, it is running one-sided or using a different α.

How to use it

  1. Put in the two groups

    Visitors and conversions for each. Raw counts, not rates — the counts are what carry the uncertainty.

  2. Read the interval before the p-value

    The Wilson interval says where each true rate plausibly lies. Two intervals that overlap heavily are two rates you cannot yet tell apart, whatever the p-value says.

  3. Plan the next test with the sample size panel

    Give it your baseline rate and the smallest lift worth detecting, and it tells you how many visitors per group you need. Running until it looks significant is not a test.

Common questions

What does p < 0.05 actually mean?

That if there were genuinely no difference, a gap this large or larger would turn up less than one time in twenty. It is not the probability that B is better, and it says nothing about how much better.

Can I stop as soon as it goes significant?

No. Peeking repeatedly and stopping at the first significant moment inflates the false-positive rate well past 5% — with daily checks over a fortnight it is closer to 20%. Fix the sample size first and run to it.

Why is my required sample size so large?

Because the effect you asked to detect is small. Halving the detectable lift roughly quadruples the sample needed. If the number is impossible, the honest conclusion is that this test cannot answer that question, not that the number is wrong.

Another calculator gives half this sample size

It is running a one-sided test, or using a different α, or omitting the continuity correction. This one is two-sided at α = 0.05 with the Fleiss, Levin and Paik correction, and it prints the formula so you can see which assumption differs.

Feed it from

Next

These accept what this tool produces, so the result can go straight in.