Two Proportion Z-Test Calculator

Compare the proportions of two independent groups: A/B test conversion rates, treatment against control, this year against last. Enter successes and sample size for each group to get the pooled proportion, the z statistic, the p-value and the size of the difference, with the conditions checked and every step shown.

Formula z = (p̂₁ − p̂₂) ⁄ SE_pooled

Group 1

Group 2

Try an example
Method

How Does the Two Proportion Z-Test Work?

The two proportion z-test assumes both groups share one proportion, pools them to estimate it, and measures how far apart the two sample proportions landed in standard errors: z = (p̂₁ − p̂₂) ÷ √(p̂(1 − p̂)(1/n₁ + 1/n₂)). A p-value below α means the difference is larger than chance alone would usually produce.

Find each sample proportion

p̂₁ = x₁ ÷ n₁ and p̂₂ = x₂ ÷ n₂. Their difference is the effect you observed.

Pool the samples

Under H₀: p₁ = p₂ both groups share one proportion, best estimated by p̂ = (x₁ + x₂) ÷ (n₁ + n₂).

Compute the pooled standard error

SE = √(p̂(1 − p̂)(1/n₁ + 1/n₂)) — how much the difference would wobble from sample to sample if there were no real gap.

Standardise and find the p-value

z = (p̂₁ − p̂₂) ÷ SE, then read the tail area from the standard normal curve and compare it with α.

z = (p̂₁ − p̂₂) / √(p̂q̂(1/n₁ + 1/n₂))

Pooled z statistic. p̂ is the combined proportion and q̂ = 1 − p̂.

Percentage points vs percent

Going from 12% to 15% is a difference of 3 percentage points but a relative lift of 25%. Reports often mix the two; the calculator shows both so you can quote the right one.

Worked examples

Two Proportion Z-Test Examples

These two proportion z-test examples cover an A/B test and a clinical comparison. Version A converting 120 of 1,000 visitors against version B's 150 of 1,000 gives a pooled proportion of 0.135, z = −1.963 and a two-tailed p-value of 0.0496, which rejects the null hypothesis at α = 0.05, but only narrowly.

A/B test

Version A converts 120 of 1,000 visitors; version B converts 150 of 1,000. Different? (α = 0.05)

p̂₁, p̂₂
0.12, 0.15
Pooled p̂
270 ÷ 2000 = 0.135
SE
√(0.135 × 0.865 × 0.002) = 0.01528
z
−0.03 ÷ 0.01528 = −1.963
p-value
0.0496

Just under 0.05 — reject H₀, but only narrowly

Clinical

45 of 150 patients improve on a treatment; 30 of 150 on placebo. (α = 0.05, two-tailed)

p̂₁, p̂₂
0.30, 0.20
Pooled p̂
75 ÷ 300 = 0.25
SE
√(0.25 × 0.75 × 2/150) = 0.05
z
0.10 ÷ 0.05 = 2.00
p-value
0.0455

Reject H₀ — a 10-point difference in improvement rate

Background

How to Interpret a Two Proportion Z-Test Result

A significant result says the two groups probably differ; it does not say why. In a randomised experiment — an A/B test with random assignment, a clinical trial — the difference can be attributed to the treatment. In an observational comparison, such as two cities or two years, other differences between the groups could explain the gap.

The borderline case

The A/B example above lands at p = 0.0496. Treat results this close to α with care: a handful of extra conversions in either group would flip the decision. The confidence interval for the difference makes this visible — its upper end sits a hair below zero, meaning the data are consistent with anything from a tiny effect to a 6-point one.

Independent groups only

The test assumes each subject appears in one group only. For before-and-after data on the same people, use McNemar's test instead. To test a single group against a fixed value, use the one proportion z-test. For the concepts behind both — sample versus population proportions, standard error and sampling distributions — see the guide to proportions in statistics.

Questions

Two Proportion Z-Test Calculator FAQ

Pooling, conditions and A/B testing practice.

What does a two-proportion z-test tell you?
Whether two independent groups have different underlying proportions. Typical uses: conversion rates for two versions of a web page, recovery rates under treatment and control, or approval rates in two regions. The test turns the gap between the two sample proportions into a z statistic and a p-value.
What is the pooled proportion and why is it used?
The pooled proportion is p̂ = (x₁ + x₂) ÷ (n₁ + n₂) — all successes over all trials. The null hypothesis says the two groups share one true proportion, so the best estimate of that shared value combines both samples. The standard error then becomes √(p̂(1 − p̂)(1/n₁ + 1/n₂)).
What conditions are needed?
Two independent random samples (or randomly assigned groups), and at least 10 successes and 10 failures in each group, using the pooled proportion: n₁p̂ ≥ 10, n₁(1 − p̂) ≥ 10, and the same for group 2. The calculator checks these.
Is this the same as a chi-square test?
For a two-tailed test on a 2 × 2 table, yes in effect: the chi-square statistic (without continuity correction) equals z², and the p-values match. The z-test has the advantage of allowing one-tailed alternatives and of showing the direction of the difference.
How do I use this for an A/B test?
Put version A in group 1 and version B in group 2: successes are conversions and sample sizes are visitors. A p-value below your α says the difference in conversion rate is unlikely to be chance. Decide the sample size before the test starts — stopping as soon as p dips under 0.05 inflates false positives. The sample size calculator helps with planning.
How big is the difference, not just whether it exists?
The two proportion z-test calculator reports the size of the difference as well as its significance: the absolute difference in percentage points and the relative lift. In the A/B example, 12% against 15% is a 3-point absolute difference and a 25% relative lift. For a range of plausible values of the true difference, use the two proportion confidence interval calculator.