Two-proportion z test calculator

This two-proportion z test calculator compares the share with an outcome in two independent groups: conversion in A and B, response in treated and control. Enter the count and the total for each group to get z, the p value and a confidence interval for the difference.

Your numbers are calculated in your browser and are not sent or stored.

Two-proportion z test calculatorOr describe it in Studio →

Counts, not percentages. The two groups must be independent: different people in each.

The two proportions differ significantly (p = 0.0285).

Group 1
45%
Group 2
30%
Difference
15 percentage points
95% CI of the difference
1.7 to 28.3 points
z
2.191
p (two-tailed)
0.0285
p (one-tailed, group 1 higher)
0.0142
p (one-tailed, group 1 lower)
0.9858
Effect size (Cohen's h)
0.311
Pooled proportion
37.5%

To report

45% (45/100) vs 30% (30/100), z = 2.19, p = 0.0285, difference 15 points (95% CI 1.7 to 28.3)

Check your result: z squared equals the chi-square test without continuity correction on the same 2 × 2 table: 2.191² = 4.80, with the same p of 0.0285. The 95% interval of the difference, 1.7 to 28.3 points, leaves out 0, which matches a p below 0.05.
z in the worked example
2.191
z in the worked example
two-tailed p
0.0285
two-tailed p
percentage-point difference, 95% CI 1.7 to 28.3
15
percentage-point difference, 95% CI 1.7 to 28.3
any count this small triggers a small-count warning
< 5
any count this small triggers a small-count warning
  • z, two-tailed and one-tailed p
  • Cohen’s h effect size
  • 95% CI of the difference
  • Warns on small counts
  • A sentence ready to report
  • Runs in your browser, free

01

Two-proportion z test formula

z = (p₁ − p₂) ÷ √(p × (1 − p) × (1 ÷ n₁ + 1 ÷ n₂))

p₁ and p₂ are the two sample proportions and p is the pooled proportion, (x₁ + x₂) ÷ (n₁ + n₂). The confidence interval of the difference uses the unpooled standard error, √(p₁(1 − p₁) ÷ n₁ + p₂(1 − p₂) ÷ n₂).

−1.960+1.962.5%2.5%95%test statistic (z or t)
What a two-tailed p value measures. The curve is what the test statistic would look like if there were no real effect. The p value is the shaded area: the chance of a result at least as far from the centre as yours, in either direction. Here the cut-offs sit at ±1.96, which leaves 5% in the two tails together.

02

Worked example

45 of 100 respond in group 1 and 30 of 100 in group 2.

p = 75 ÷ 200 = 0.375

z = 0.15 ÷ √(0.375 × 0.625 × 0.02) = 0.15 ÷ 0.0685 = 2.191

The two-tailed p value is 0.0285. The difference is 15 percentage points, 95% CI 1.7 to 28.3 points.

03

Z test, chi-square or Fisher?

  • For a 2 × 2 table the z test and the chi-square test without continuity correction give the same p value: chi-square equals z².
  • Use Fisher's exact test when any cell has fewer than about 5 observations.
  • For paired data, such as the same people before and after, use McNemar's test instead. This test assumes independent groups.

04

Mistakes when comparing two proportions

  • Judging by overlapping intervals. In the worked example 45% (95% CI 35.6% to 54.8%) and 30% (21.9% to 39.6%) overlap, yet the test gives p = 0.028.
  • Mixing percentage points and percent. 45% against 30% is a difference of 15 percentage points and a 50% relative increase; say which one you mean.
  • Not saying whether a continuity correction was used. With Yates’ correction the same table gives chi-square 4.18 and p = 0.041 instead of 0.028.

Trust

How this page is checked

  • The calculation runs on code with automated tests against worked reference values. Every number in the examples on this page was produced by that same code, not typed by hand.
  • The formulas and conventions used are stated on the page, so you can reproduce the result yourself or compare it with your own software.
  • Last reviewed by the Sciloom team, Zebra Nine Studio Inc. It is a tool for research and teaching, not a substitute for a statistician, a validated lab method or medical advice.

Cite this page

Sciloom. (2026). Two-proportion z test calculator. Zebra Nine Studio Inc. https://sciloom.si/two-proportion-z-test-calculator

Read the full methodology · Who makes Sciloom

Frequently asked questions

When do I use a two-proportion z test?

When you compare a yes/no outcome between two independent groups and the samples are large enough: at least about 5 to 10 successes and failures in each group.

Why is the pooled proportion used?

The null hypothesis says both groups share one true proportion, so the standard error for the test is computed from the combined estimate. The confidence interval does not assume that, so it uses each group separately.

Is this the same as an A/B test calculator?

It is the standard test behind most A/B test calculators for conversion rates. Enter conversions and visitors for each variant.

What about a one-tailed test?

The calculator lists both one-tailed p values beside the two-tailed one. Use the one that matches the direction you predicted before seeing the data. Two-tailed is the safer default.

What is Cohen’s h?

An effect size for the gap between two proportions: h = 2·asin(√p₁) − 2·asin(√p₂). By Cohen’s rough guide 0.2 is small, 0.5 medium and 0.8 large. For 45% against 30%, h is 0.311.

Small counts in any cell? Use the Fisher exact test calculator.
Free to start, no sign-up.
Back to the tool ↑

More research tools