Two Proportion Z Test Calculator

Use this two proportion z test calculator to compare two independent population proportions using raw or summary data and find the z statistic, p-value, and confidence interval.

Data Input Type

Sample 1

Sample 2

How to Use the Two Proportion Z Test Calculator

The Two Proportion Z-Test compares the proportions of successes in two independent groups to determine whether there is a statistically significant difference between them.

  1. Select the Alternative Hypothesis (H₁) based on the direction of your test (Two-tailed, Left-tailed, Right-tailed).
  2. Set your Significance Level (α) (usually 0.05).
  3. Enter the Hypothesized Difference (p₁ - p₂). This is almost always 0.
  4. Choose Summary Data or Raw Data. For summary data, enter the number of successes and sample sizes for both groups.
  5. Click Calculate to compute the z-statistic, p-value, and see a step-by-step solution.

What is a Two Proportion Z Test?

A two proportion z-test allows you to compare two proportions to see if they are the same. For example, you could use this test to see if the proportion of people who prefer brand A is significantly different from the proportion of people who prefer brand B.

Two Proportion Z-Test Formula

The formula for the test statistic depends on whether you are assuming the population proportions are equal (Hypothesized Difference = 0).

When Hypothesized Difference is 0 (Pooled)

If you hypothesize no difference between the groups, you calculate a pooled proportion (p̂) to estimate the overall probability of success:

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

Then, the standard error is calculated as:

SE = √[ p̂(1 - p̂) * (1/n₁ + 1/n₂) ]
z = (p̂₁ - p̂₂) / SE

When Hypothesized Difference is Not 0 (Unpooled)

If you hypothesize a specific difference (e.g. group 1 is 5% higher than group 2), you use the unpooled standard error:

SE = √[ (p̂₁(1 - p̂₁)/n₁) + (p̂₂(1 - p̂₂)/n₂) ]
z = ((p̂₁ - p̂₂) - μ₀) / SE

Assumptions for the Two Proportion Z Test

  • Independence: The two samples must be independent of each other, and observations within each sample must be independent.
  • Random Sampling: The data should be collected via a randomized process.
  • Success/Failure Condition: Both groups should have at least 10 expected successes and 10 expected failures. This ensures the normal approximation to the binomial distribution is valid.