A/B Test Calculator (Two Proportions)

Compare two conversion rates with a two-proportion z-test: rates, lift, pooled z, p-value and a confidence interval for the difference.

Choose before you look at the results. A one-sided test is easier to pass but only looks in one direction.

Results

p-value
0.1404
What this means
A difference this large could easily happen by chance if A and B had the same rate (p is 0.05 or above). That is not evidence the rates are the same: the test may simply not have enough data.
Conversion rate A
6.00 %
Conversion rate B
10.00 %
Difference (B − A)
4.00 percentage points
Relative lift of B over A
66.67 %
z statistic (pooled)
1.4744
95% confidence interval for the difference (B − A)
−1.3 to 9.3 percentage points
A range of differences that are compatible with the data, using the standard error without pooling.
Pooled rate
8.00 %
Sample-size check
All four counts are at least 5, so the normal approximation is reasonable.

How it’s calculated

An A/B test compares the conversion rate (the share of visitors who sign up, click or buy) of two versions. This page runs the standard two-proportion z-test. The null hypothesis is that both versions have the same true rate. The test pools the two groups to estimate that common rate, then asks how far apart the observed rates are in units of standard error.

p̂A = xA ÷ nA p̂B = xB ÷ nB difference = p̂B − p̂A lift = (p̂B − p̂A) ÷ p̂A pooled rate p̂c = (xA + xB) ÷ (nA + nB) z = (p̂B − p̂A) ÷ √( p̂c (1 − p̂c) (1/nA + 1/nB) ) confidence interval for the difference: (p̂B − p̂A) ± z* √( p̂A(1 − p̂A)/nA + p̂B(1 − p̂B)/nB )

Example (OpenStax Introductory Statistics 2e, Example 10.8): 20 of 200 adults on medication A and 12 of 200 on medication B still had hives, so the rates are 10% and 6%. The pooled rate is 32 ÷ 400 = 0.08, the standard error is √(0.08 × 0.92 × (1/200 + 1/200)) ≈ 0.02713, and z = 0.04 ÷ 0.02713 ≈ 1.474. The two-sided p-value is 0.1404, so the data do not show a difference at the 1% level. The defaults use the same counts with the groups swapped (12 of 200 against 20 of 200), which gives z = +1.474 and the same p-value.

Read results with care. A small p-value means data like this would be unusual if the versions were identical; it is not the chance that B is better, and it does not guarantee the same lift later. Decide the sample size and the question before you start, and avoid stopping the test as soon as the p-value dips below 0.05, because repeated peeking inflates false alarms. Tests of many variants or metrics need a stricter threshold.

Frequently asked questions

What does “statistically significant” mean here?

That the observed difference would be unlikely if the two versions truly had the same conversion rate. It does not mean the difference is large or important, and it is not a guarantee that one version is better.

How big should my test be?

Large enough to detect the smallest difference you care about. Small tests often miss real differences and exaggerate the ones they do find. Use a sample-size calculation before you run the test, not after.

Can I stop the test when it turns significant?

Not safely. Checking repeatedly and stopping at the first small p-value makes false positives much more likely than the stated level. Fix the sample size in advance, or use a method designed for sequential testing.

Why does the confidence interval use a different standard error?

The test assumes both rates are equal, so it pools them. The interval estimates the actual difference, so it uses each group’s own rate. This is why the interval can disagree slightly with the test near the 5% boundary.

Embed this calculator

Add this free calculator to your own website. Copy the code below into your page’s HTML:

Need this calculator branded, changed or built around your own prices?See custom business solutions →

Sources

Formulas are taken from the free public references above. Results are provided “as is” for informational and educational purposes only. See our disclaimer.

Added · Last updated · How we check our calculators

Spotted a mistake or missing option? Report a problem· Suggest a calculator