Two Proportion Confidence Interval Calculator
Estimate the difference between two population proportions, p₁ − p₂, with a confidence interval and a check on whether it includes zero.
Open → Two Proportion Confidence Interval CalculatorCompare the proportions of two independent groups: A/B test conversion rates, treatment against control, this year against last. Enter successes and sample size for each group to get the pooled proportion, the z statistic, the p-value and the size of the difference, with the conditions checked and every step shown.
Formula z = (p̂₁ − p̂₂) ⁄ SE_pooled
Group 1
Group 2
Shaded area = the p-value. Dashed lines = critical values for the chosen α.
The two proportion z-test assumes both groups share one proportion, pools them to estimate it, and measures how far apart the two sample proportions landed in standard errors: z = (p̂₁ − p̂₂) ÷ √(p̂(1 − p̂)(1/n₁ + 1/n₂)). A p-value below α means the difference is larger than chance alone would usually produce.
Find each sample proportion
p̂₁ = x₁ ÷ n₁ and p̂₂ = x₂ ÷ n₂. Their difference is the effect you observed.
Pool the samples
Under H₀: p₁ = p₂ both groups share one proportion, best estimated by p̂ = (x₁ + x₂) ÷ (n₁ + n₂).
Compute the pooled standard error
SE = √(p̂(1 − p̂)(1/n₁ + 1/n₂)) — how much the difference would wobble from sample to sample if there were no real gap.
Standardise and find the p-value
z = (p̂₁ − p̂₂) ÷ SE, then read the tail area from the standard normal curve and compare it with α.
Pooled z statistic. p̂ is the combined proportion and q̂ = 1 − p̂.
Going from 12% to 15% is a difference of 3 percentage points but a relative lift of 25%. Reports often mix the two; the calculator shows both so you can quote the right one.
These two proportion z-test examples cover an A/B test and a clinical comparison. Version A converting 120 of 1,000 visitors against version B's 150 of 1,000 gives a pooled proportion of 0.135, z = −1.963 and a two-tailed p-value of 0.0496, which rejects the null hypothesis at α = 0.05, but only narrowly.
Version A converts 120 of 1,000 visitors; version B converts 150 of 1,000. Different? (α = 0.05)
Just under 0.05 — reject H₀, but only narrowly
45 of 150 patients improve on a treatment; 30 of 150 on placebo. (α = 0.05, two-tailed)
Reject H₀ — a 10-point difference in improvement rate
A significant result says the two groups probably differ; it does not say why. In a randomised experiment — an A/B test with random assignment, a clinical trial — the difference can be attributed to the treatment. In an observational comparison, such as two cities or two years, other differences between the groups could explain the gap.
The A/B example above lands at p = 0.0496. Treat results this close to α with care: a handful of extra conversions in either group would flip the decision. The confidence interval for the difference makes this visible — its upper end sits a hair below zero, meaning the data are consistent with anything from a tiny effect to a 6-point one.
The test assumes each subject appears in one group only. For before-and-after data on the same people, use McNemar's test instead. To test a single group against a fixed value, use the one proportion z-test. For the concepts behind both — sample versus population proportions, standard error and sampling distributions — see the guide to proportions in statistics.
Pooling, conditions and A/B testing practice.
p̂ = (x₁ + x₂) ÷ (n₁ + n₂) — all successes over all trials. The null hypothesis says the two groups share one true proportion, so the best estimate of that shared value combines both samples. The standard error then becomes √(p̂(1 − p̂)(1/n₁ + 1/n₂)).n₁p̂ ≥ 10, n₁(1 − p̂) ≥ 10, and the same for group 2. The calculator checks these.