Calculators
Home › Calculators › Two-Proportion z-Test

Two-Proportion z-Test Calculator

Two groups, two rates: is the difference real, or sampling weather?

Run a two-proportion z-test

The A/B test workhorse: pooled under the null, unpooled for the interval.

Quick answer: 64/120 vs 48/110: z = 1.47, p = 0.1416, interval for the gap −0.032 to 0.226. A 9.7-point sample gap that these sample sizes cannot yet certify.

Comparing two proportions

Two groups, two rates: a new checkout flow converting 64 of 120 visitors against the old one's 48 of 110. The two-proportion z-test asks whether the population rates differ. Because the null hypothesis says both groups share one rate, the test pools all the data into a single p for its standard error; the confidence interval for the difference, reported alongside, does not pool, because it is estimating a gap that may really exist.

Two-proportion zz = (p̂₁ − p̂₂) ÷ √(p(1−p)(1/n₁ + 1/n₂)),   p = pooled proportion
Worked example

p̂₁ = 0.5333 (64/120), p̂₂ = 0.4364 (48/110), pooled p = 0.4870. z = 1.4697, two-tailed p = 0.1416. A 9.7-point gap in the samples, but with these sample sizes, gaps that large arise by chance about one time in seven when nothing differs. The 95% interval for the difference (−0.032 to 0.226) contains zero and reaches from slightly negative to a hefty +23 points: the honest summary is "unresolved: get more data", not "no effect".

Assumptions, in plain sight

Watch out

Peeking at an A/B test daily and stopping the first time p dips below 0.05. Repeated peeking manufactures false positives at several times the advertised rate. Fix the sample size (or the analysis date) in advance. The margin-of-error calculator sizes it.

Frequently asked questions

Why pool for the test but not for the interval?

The test's standard error must describe the world where the null is true: one shared rate, hence pooled. The interval estimates the actual difference, so it respects each group's own rate.

How many visitors does an A/B test need?

It depends on the baseline rate and the smallest difference worth detecting. For proportions near 0.5 and a ±3-point margin you are near a thousand per group. Plan with the margin-of-error calculator before launching.