Two-Proportion Z-Test

A two-proportion z-test compares the proportions from two independent groups — for example, the share of men and women who support a policy, or the success rate of two treatments. Enter both samples and the calculator gives the pooled proportion, the z-statistic, the p-value and the decision at α = 0.05, with every step shown.

Two-Proportion Z-Test Calculator

Test H0: p1 = p2 from two independent samples.

Conditions: independent random samples, and at least 10 successes and 10 failures in each group.

What Is a Two-Proportion Z-Test?

A two-proportion z-test tests whether two population proportions are equal: H0 says p1 = p2, and Ha says p1 ≠ p2, p1 > p2 or p1 < p2. It is used for A/B tests, treatment vs control trials, and comparing survey results between two groups. Unlike the one-proportion test, it uses a pooled proportion, because H0 says both samples come from the same population.

The Two-Proportion Z-Test Formula

First find the pooled proportion p̂ = (x1 + x2) ÷ (n1 + n2). Then the standard error is SE = √[p̂(1 − p̂)(1/n1 + 1/n2)], and the test statistic is z = (p̂1 − p̂2) ÷ SE. The p-value comes from the standard normal distribution, exactly as in the one-proportion test. Do not use the unpooled standard error for the test — that version is for the confidence interval, where no pooling is assumed.

Conditions for the Two-Proportion Z-Test

Check: (1) both samples are random and independent of each other, (2) each group has at least 10 successes and 10 failures, and (3) each sample is less than 10% of its population when sampling without replacement. If the counts are small, Fisher's exact test is a better choice than the z-test.

Worked Example

A new drug cured 60 of 100 patients; the old drug cured 45 of 100. Is the new drug better? p̂1 = 0.60, p̂2 = 0.45, pooled p̂ = 105 ÷ 200 = 0.525, SE = √(0.525 × 0.475 × (1/100 + 1/100)) ≈ 0.0706, z = (0.60 − 0.45) ÷ 0.0706 ≈ 2.12. The two-tailed p-value is about 0.034, so at α = 0.05 you reject H0: the cure rates differ significantly.

Two-Proportion Z-Test FAQs

What is a pooled proportion?

The pooled proportion combines both samples into one: p̂ = (x1 + x2) ÷ (n1 + n2). It is used in the z-test because the null hypothesis says both groups share one true proportion.

When do you use a two-proportion z-test instead of a one-proportion test?

Use the two-proportion test when you compare two independent groups. Use the one-proportion test when you compare one group to a claimed value.

What is the difference between the z-test and the two-proportion confidence interval?

The z-test pools the proportions and gives a p-value for a decision. The confidence interval does not pool and gives a range of plausible values for p1 − p2.

Related tools: One-Proportion Z-Test · Two-Proportion Confidence Interval · Sample Proportion · Statistics