Skip to content
MoneyDeck

Two Proportion Z-Test Calculator

Test whether two success rates really differ, with z, p-value and CI

Updated · Free, no signup

%

p-value

0.0496

z statistic

-1.963

Conclusion

Reject H₀ at α = 0.05: evidence that the proportions differ (p = 0.0496).

Sample proportion p̂₁

12%

Sample proportion p̂₂

15%

Difference p̂₁ − p̂₂

-3%

In percentage points.

Pooled proportion p̂

13.5%

Standard error (pooled)

0.01528

CI for difference – lower

-5.99%

CI for difference – upper

-0.01%

Relative difference (p̂₁ − p̂₂) ÷ p̂₂

-20%

  • Group 1: 12% vs group 2: 15% — a difference of -3 percentage points (95% CI -5.99 to -0.01).

Sample proportions with confidence limits

Observed counts

SuccessesFailuresTotalProportion
Group 11208801,00012%
Group 21508501,00015%
Combined2701,7302,00013.5%

About the Two Proportion Z-Test Calculator

This two proportion z-test calculator tells you whether the difference between two percentages is statistically significant or could plausibly be chance. Enter the number of successes and the sample size for each group — patients who recovered, visitors who converted, voters who said yes — and it returns both sample proportions, their difference, the pooled z statistic, the p-value and a confidence interval for the true difference.

It is the standard test for comparing two independent groups on a yes/no outcome: treatment vs control, version A vs version B of a web page, two survey sub-groups, or defect rates from two production lines. Choose a two-tailed test to detect any difference, or a one-tailed test when you specified the direction in advance.

The test uses the pooled proportion for the standard error under the null hypothesis (the textbook and AP Statistics method, equivalent to a 2×2 chi-square test without continuity correction), while the confidence interval uses the unpooled standard error. The normal approximation is reliable when each group has at least about 10 successes and 10 failures; for smaller counts, use Fisher’s exact test.

With the default inputs, the p-value is 0.0496. Change any value above to recalculate instantly.

How to use the two proportion z-test calculator

  1. 1Enter the number of successes and the sample size for group 1.
  2. 2Enter the same for group 2.
  3. 3Choose a two-tailed test, or a one-tailed test if you predicted the direction beforehand.
  4. 4Set the significance level and the confidence level for the interval.
  5. 5Read the p-value and conclusion, and check the confidence interval for the size of the difference.

Formula and method

z = (p̂₁ − p̂₂) ÷ √[p̂(1 − p̂)(1/n₁ + 1/n₂)], p̂ = (x₁ + x₂) ÷ (n₁ + n₂); CI = (p̂₁ − p̂₂) ± z꜀ √[p̂₁(1−p̂₁)/n₁ + p̂₂(1−p̂₂)/n₂]

Under the null hypothesis the two groups share one true proportion, best estimated by pooling all successes over all observations. The difference in sample proportions divided by its pooled standard error follows an approximately standard normal distribution, so the p-value is the normal tail area beyond z (both tails for a two-sided test). The square of this z equals the Pearson chi-square statistic for the 2×2 table.

The confidence interval does not assume the proportions are equal, so it uses the unpooled (Wald) standard error built from each group’s own proportion. Because the two standard errors differ slightly, a borderline test and interval can occasionally disagree. All approximations assume independent observations and reasonably large counts in every cell.

x₁, x₂
Number of successes in each group
n₁, n₂
Sample size of each group
p̂₁, p̂₂
Sample proportions x ÷ n
p̂
Pooled proportion of successes
z꜀
Critical z for the chosen confidence level (1.96 for 95%)

Worked examples

A/B test: 12% vs 15% conversion, 1,000 visitors each

The pooled proportion is 270 ÷ 2,000 = 13.5%, giving a standard error of √(0.135 × 0.865 × 0.002) = 0.01528. The difference of −3 points is z = −1.963 standard errors, for a two-tailed p of 0.0496 — just inside the 5% boundary. The 95% interval for the difference, about −5.99 to −0.01 points, barely excludes zero.

Clinical trial: 45 of 60 vs 30 of 58 recovered

Recovery was 75% with treatment versus 51.7% with control. The pooled rate is 75 ÷ 118 = 63.6%, the standard error is 0.0886, and z = 0.2328 ÷ 0.0886 = 2.63. For a one-sided test that treatment is better, p ≈ 0.0043, which is significant at the 1% level.

Survey: 230 of 500 vs 210 of 480 agree

The two groups agree at 46.0% and 43.75%, a gap of 2.25 points. With a pooled proportion of 44.9% the standard error is 0.0318, so z = 0.71 and the two-tailed p-value is about 0.48 — the difference is easily explained by sampling variation.

Frequently asked questions

When should I use a two proportion z-test?+

Use it to compare the proportion of successes in two independent groups, such as conversion rates in an A/B test or recovery rates in two treatment arms. Each observation must be a yes/no outcome and belong to only one group.

What are the conditions for the test?+

The samples must be random and independent, and each group should have at least about 10 successes and 10 failures (some texts accept 5). With smaller counts the normal approximation breaks down and Fisher’s exact test is more accurate.

Why does the test use a pooled proportion but the interval does not?+

The test assumes the null hypothesis that both groups share the same proportion, so pooling gives the best estimate of that common value. The confidence interval estimates the actual difference, so it uses each group’s own proportion.

Is this the same as a chi-square test?+

Yes. For a 2×2 table, the square of the pooled two-proportion z statistic equals the Pearson chi-square statistic without Yates’ continuity correction, and the two-tailed p-values are identical.

What does a p-value of 0.03 mean here?+

If the two population proportions were truly equal, a difference at least as large as the one observed would occur only 3% of the time by chance. It does not mean there is a 97% chance the groups differ.

How do I enter percentages instead of counts?+

Convert each percentage back to a count by multiplying by the sample size and rounding: 12.5% of 800 is 100 successes. The test needs counts because the standard error depends on the sample sizes.

Related tools