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
- p̂
- 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.
| Symbol | Meaning |
|---|---|
| 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 |
| p̂ | Pooled proportion under H₀: p₁ = p₂ |
| Cohen's h | 2arcsin(√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?
p̂₁ = 52/200 = 0.260 (26.0%) · p̂₂ = 38/200 = 0.190 (19.0%)p̂ = (52+38)/(200+200) = 90/400 = 0.225SE = √(0.225×0.775×(1/200+1/200)) = √(0.174375×0.01) ≈ 0.0418z = (0.260−0.190)/0.0418 = 0.070/0.0418 ≈ 1.675p = 2×(1−Φ(1.675)) ≈ 2×0.047 = 0.094p = 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:
Related Calculators
Association between two categorical variables
Confidence Interval CalculatorCI for means and proportions
Effect Size ExplainedCohen's h and other effect sizes
One-Tailed vs Two-Tailed TestChoose the right tail
Statistical Power CalculatorPlan your sample size
Statistics HubAll statistics calculators
Disclaimer
Requires at least 10 successes and 10 failures per group. For smaller counts, use Fisher's exact test.