🧮
🧮 Math & statistics

Two-Proportion z-Test Calculator

Results update as you type.

Your numbers

Understanding the two-proportion z-test — concept and principle

A two-proportion z-test checks whether two groups have different success rates: conversion rates in an A/B test, defect rates on two machines, or response rates to two survey invitations. You enter the number of successes and the total for each group, and the calculator returns the z statistic, a two-tailed p-value and the difference between the rates.

Two-proportion z-test of 12% against 15%A has 120 successes in 1,000 (12%) and B 150 in 1,000 (15%). With the pooled 13.5% the standard error is 0.0153, so z = −1.96 and p = 0.0496, just under the 0.05 cut-off.12% vs 15%: real or luck?A120 / 1,00012%B150 / 1,00015%pooled 270 / 2,000 = 13.5% → SE 0.0153z = (0.12 − 0.15) ÷ 0.0153 = −1.96could be lucksignificant01231.96 line|z| = 1.963|z|%p = 0.0496 — just under 0.05
A 3-point gap with 1,000 each lands right on the 1.96 line: p = 0.0496.

How it is calculated

  1. Sample proportions: p̂₁ = x₁ ÷ n₁ and p̂₂ = x₂ ÷ n₂.
  2. Pooled proportion under H₀ (equal rates): p̂ = (x₁ + x₂) ÷ (n₁ + n₂).
  3. Standard error: SE = √[p̂(1 − p̂)(1/n₁ + 1/n₂)].
  4. z = (p̂₁ − p̂₂) ÷ SE.
  5. Two-tailed p = 2 × [1 − Φ(|z|)], where Φ is the standard normal cumulative distribution.
  6. Difference = (p̂₁ − p̂₂) × 100, in percentage points (A minus B).

Both z and the difference are A minus B, so they always share the same sign: a negative value means group B has the higher rate.

The principle

If both groups truly share one rate, the best estimate of that rate combines all the data, which is why the standard error uses the pooled p̂. With reasonably large samples the difference between two proportions is approximately normal, so z measures how many standard errors apart the two rates are. This test is mathematically equivalent to the chi-square test on the 2 × 2 table: z² equals the uncorrected chi-square statistic.

Worked example

  1. A: 120 successes of 1,000 (p̂₁ = 0.12). B: 150 of 1,000 (p̂₂ = 0.15).
  2. Pooled p̂ = 270 ÷ 2,000 = 0.135.
  3. SE = √(0.135 × 0.865 × 0.002) = √0.00023355 = 0.0152823.
  4. z = (0.12 − 0.15) ÷ 0.0152823 = −1.963049808.
  5. p = 2 × (1 − Φ(1.96305)) = 0.0496403869.
  6. Difference A − B = (0.12 − 0.15) × 100 = −3 percentage points, i.e. B is 3 points higher.
How z changes with Total BHow z changes with Total B-20-15-10-5052505007501,0001,2501,5002,000Example: -1.963049808Total B
Each point is the calculator re-run with only “Total B” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Total Bz
250-16.49572198
500-8.553989228
750-4.584868703
1,000-1.963049808
1,2500
1,5001.578379079
2,0004.059989715

How to read the result

Where does your result fall?Not significant0.05SignificantNot significantYour result: 0.0496404 · SignificantReference: Conventional α = 0.05 significance level
Where does your result fall?

|z| = 1.96 is the 5% two-tailed threshold, and this result sits just beyond it: p ≈ 0.0496, barely below 0.05. B's rate is 3 points higher, a relative lift of 25% (0.03 ÷ 0.12). A result this close to the cut-off is fragile: a few more or fewer successes would flip the conclusion, so look at the confidence interval for the difference and at practical importance, not only at "significant".

Common mistakes

Keep in mind: The test assumes independent observations and random assignment or sampling. A p-value near 0.05 is weak evidence and is not business or medical advice on its own.

Frequently asked questions

Should I use a one-tailed test because I expected B to win?

Only if that was decided before collecting data and a result in the other direction would be treated as "no effect"; otherwise use two tails.

Why use the pooled proportion?

Because the test assumes H₀ is true; confidence intervals for the difference use the unpooled standard error instead.

What about small samples?

Fisher's exact test is the usual alternative when expected counts are small.

Sources: Agresti, A. (2013). Categorical Data Analysis (3rd ed.). Wiley. · NIST/SEMATECH e-Handbook of Statistical Methods.

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

🧮 All math & statistics tools →🌍 Calculators by country →