Calculators

Two-Proportion Z-Test Calculator

Compare two independent proportions with a z-test, confidence interval, risk ratio, and odds ratio locally in your browser.

Enter successes and trials for two independent groups to compare their proportions. Calculations run locally in your browser; your values are not uploaded or stored.

Group 1
Group 2
Your two-proportion z-test results will appear here.

Test whether two proportions differ significantly.

Enter successes and trials for two independent groups. The calculator computes the difference in proportions, a z-statistic using pooled or unpooled standard error, p-value, and confidence interval for the difference. It also reports the risk ratio and odds ratio. Choose a two-sided or one-sided alternative and a confidence level (90%, 95%, or 99%). Pooled standard error is recommended under the null hypothesis of equal proportions; unpooled is preferred for confidence intervals. All calculations run locally in your browser; your values are not uploaded or stored.

Frequently Asked Questions

Everything you need to know about this tool, how it works, and privacy.

What is a two-proportion z-test?

A two-proportion z-test compares the proportions of successes in two independent groups. It tests whether the difference between the two proportions is statistically significant. The test assumes independent random samples and uses the normal approximation to the binomial distribution.

When should I use pooled vs unpooled standard error?

Use pooled standard error when testing the null hypothesis that the two proportions are equal (H₀: p₁ = p₂), as it provides a better estimate under this assumption. Use unpooled standard error for confidence intervals and when you do not assume equal proportions under the alternative hypothesis.

What are the assumptions for this test?

The test assumes: (1) independent random samples from two populations, (2) each sample has only two outcomes (success/failure), (3) sample sizes are large enough for the normal approximation (typically n₁p₁, n₁(1−p₁), n₂p₂, n₂(1−p₂) ≥ 5), and (4) populations are at least 10 times the sample sizes.

What is the difference between risk ratio and odds ratio?

Risk ratio (relative risk) is the ratio of two proportions: p₁/p₂. Odds ratio is the ratio of odds: (p₁/(1−p₁)) / (p₂/(1−p₂)). Risk ratio is more intuitive for common outcomes; odds ratio is used in case-control studies and logistic regression. When outcomes are rare, odds ratio approximates risk ratio.

How do I interpret the p-value?

The p-value is the probability of observing a difference as extreme as (or more extreme than) the one in your data, assuming the null hypothesis is true. A small p-value (typically < 0.05) suggests the observed difference is unlikely due to chance alone. Always consider practical significance alongside statistical significance.

Do my values stay private?

Yes. All calculations run locally in your browser. CodeASystem does not upload or store the values you enter.