Two-Proportion Z-Test Calculator

Reviewed by CalcMulti Editorial Team·Last updated: ·Statistics Hub

The two-proportion z-test compares whether two independent groups have the same population proportion. It is the standard test for A/B testing conversion rates, comparing survey response rates, or any "success/failure" outcome across two groups.

Enter the number of successes and sample sizes for each group. The calculator returns the z-statistic, p-value, confidence interval for the difference in proportions, and Cohen's h as the effect size.

Formula

z = (p̂₁ − p̂₂) / √[p̂(1−p̂)(1/n₁ + 1/n₂)] p̂ = (x₁+x₂)/(n₁+n₂)

p̂₁, p̂₂
sample proportions for groups 1 and 2
pooled proportion under H₀
n₁, n₂
sample sizes for groups 1 and 2
x₁, x₂
number of successes in each group
h
Cohen's h = 2arcsin(√p̂₁) − 2arcsin(√p̂₂)

Enter Data

Group 1

Group 2

Two-Proportion Z-Test: Formulas

Test statistic (hypothesis test)

z = (p̂₁ − p̂₂) / SEpooled

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

p̂ = (x₁ + x₂) / (n₁ + n₂)

95% Confidence interval (unpooled SE)

(p̂₁ − p̂₂) ± 1.96 × SEunpooled

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

Unpooled SE is used for the CI because H₀ is not assumed.

SymbolMeaning
x₁, x₂Number of successes in Group 1 and Group 2
n₁, n₂Sample sizes for each group
p̂₁ = x₁/n₁, p̂₂ = x₂/n₂Sample proportions
Pooled proportion under H₀: p₁ = p₂
Cohen's h2arcsin(√p̂₁) − 2arcsin(√p̂₂) — effect size on arcsine scale

Worked Example: A/B Conversion Test

Group 1 (Variant B): 52 conversions out of 200 visitors. Group 2 (Control A): 38 conversions out of 200 visitors. Is the difference statistically significant at α = 0.05?

Step 1 — Sample proportionsp̂₁ = 52/200 = 0.260 (26.0%) · p̂₂ = 38/200 = 0.190 (19.0%)
Step 2 — Pooled proportionp̂ = (52+38)/(200+200) = 90/400 = 0.225
Step 3 — Pooled SESE = √(0.225×0.775×(1/200+1/200)) = √(0.174375×0.01) ≈ 0.0418
Step 4 — Z-statisticz = (0.260−0.190)/0.0418 = 0.070/0.0418 ≈ 1.675
Step 5 — Two-tailed p-valuep = 2×(1−Φ(1.675)) ≈ 2×0.047 = 0.094
Step 6 — Conclusionp = 0.094 > 0.05 → Fail to reject H₀. Difference not significant at 5% level.

Note: With p = 0.094, there's a 9.4% chance of seeing this difference by chance alone. This is above the conventional 5% threshold. You would need a larger sample to detect this difference reliably. Use the Statistical Power Calculator to estimate the required sample size.

Assumptions & Alternatives

This test requires:

  • Two independent groups (not paired/matched)
  • Binary outcome (success or failure)
  • Each cell count ≥ 10 (large-sample approximation)
  • Simple random sampling from each group
  • Observations within each group are independent

Use a different test when:

Paired / matched samplesMcNemar's test
Any cell count < 5Fisher's exact test
More than 2 proportionsChi-square test of independence
Repeated measuresCochran's Q test

Disclaimer

Requires at least 10 successes and 10 failures per group. For smaller counts, use Fisher's exact test.

Frequently Asked Questions