Two Proportion Z Test Calculator

Compare two independent proportions with a pooled two-proportion Z test and confidence interval

Example Results

1 examples

Compare two conversion rates

Test whether 60 of 100 successes differs from 45 of 100 successes

{
  "result": {
    "group1Proportion": 0.6,
    "group2Proportion": 0.45,
    "difference": 0.15,
    "zStatistic": 2.124,
    "pValue": 0.0337,
    "rejectNull": true
  }
}
View input parameters
{ "group1Successes": 60, "group1Trials": 100, "group2Successes": 45, "group2Trials": 100, "hypothesizedDifference": 0, "alternative": "two-sided", "alpha": 0.05, "decimalPlaces": 4 }

Key Facts

Category
Math, Date & Finance
Input Types
number, select
Output Type
json
Sample Coverage
4
API Ready
Yes

Overview

The Two Proportion Z Test Calculator allows you to compare two independent proportions to determine if there is a statistically significant difference between them. By inputting the number of successes and trials for two groups, you can instantly calculate the Z-statistic, P-value, and evaluate your null hypothesis using a pooled variance approach.

When to Use

  • When evaluating the results of an A/B test to see if a new variation significantly outperforms the control group.
  • When comparing conversion rates, click-through rates, or success metrics between two independent demographic segments.
  • When determining if the difference between two observed sample proportions is due to random chance or a true underlying effect.

How It Works

  • Enter the number of successes and total trials for Group 1 and Group 2.
  • Set your hypothesized difference (usually 0), alternative hypothesis (two-sided, greater, or less), and alpha level.
  • The calculator computes the sample proportions, the pooled proportion, and the standard error.
  • Review the resulting JSON output, which includes the Z-statistic, P-value, and a boolean indicating whether to reject the null hypothesis.

Use Cases

Marketing teams analyzing A/B test data to decide which email subject line yields a higher open rate.
Product managers comparing user conversion rates between a new checkout flow and the legacy system.
Researchers evaluating the effectiveness of two different treatments based on the proportion of successful outcomes.

Examples

1. A/B Testing Conversion Rates

Growth Marketer
Background
A marketing team ran an A/B test on a landing page. The control group had 45 conversions out of 100 visitors, while the variant had 60 conversions out of 100 visitors.
Problem
Determine if the variant's higher conversion rate is statistically significant or just random noise.
How to Use
Input 60 successes and 100 trials for Group 1 (variant), and 45 successes and 100 trials for Group 2 (control). Keep the hypothesized difference at 0, use a two-sided alternative, and set alpha to 0.05.
Example Config
Group 1 Successes: 60, Group 1 Trials: 100, Group 2 Successes: 45, Group 2 Trials: 100, Alternative: two-sided, Alpha: 0.05
Outcome
The calculator outputs a Z-statistic of 2.124 and a P-value of 0.0337. Since the P-value is less than 0.05, 'rejectNull' is true, confirming the variant performs significantly better.

2. Comparing Treatment Efficacy

Clinical Researcher
Background
A study compares two medications. Medication A cured 150 out of 200 patients, while Medication B cured 130 out of 200 patients.
Problem
Test if Medication A has a strictly greater success rate than Medication B.
How to Use
Enter 150 successes and 200 trials for Group 1, and 130 successes and 200 trials for Group 2. Change the Alternative Hypothesis to 'Greater Than'.
Example Config
Group 1 Successes: 150, Group 1 Trials: 200, Group 2 Successes: 130, Group 2 Trials: 200, Alternative: greater, Alpha: 0.05
Outcome
The tool calculates the proportions (0.75 vs 0.65) and returns a one-sided P-value, allowing the researcher to conclude if Medication A is statistically superior.

Try with Samples

math-&-numbers

FAQ

What is a pooled two-proportion Z-test?

It is a statistical test used to determine if the difference between two independent sample proportions is significant, assuming the null hypothesis that the proportions are equal.

What does the alpha value represent?

The alpha value, or significance level, is the probability of rejecting the null hypothesis when it is actually true. A common default is 0.05 (5%).

Can I test for a specific difference other than zero?

Yes, you can adjust the 'Hypothesized Difference' input to test if the difference between the two proportions equals a specific non-zero value.

What does 'rejectNull: true' mean in the output?

It means the calculated P-value is less than your specified alpha level, indicating a statistically significant difference between the two groups.

What is the difference between a two-sided and one-sided test?

A two-sided test checks for any difference (greater or less) between the proportions, while a one-sided test checks for a difference in one specific direction.

API Documentation

Request Endpoint

POST /en/api/tools/two-proportion-z-test-calculator

Request Parameters

Parameter Name Type Required Description
group1Successes number No -
group1Trials number No -
group2Successes number No -
group2Trials number No -
hypothesizedDifference number No -
alternative select No -
alpha number No -
decimalPlaces number No -

Response Format

{
  "key": {...},
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}
JSON Data: JSON Data

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-two-proportion-z-test-calculator": {
      "name": "two-proportion-z-test-calculator",
      "description": "Compare two independent proportions with a pooled two-proportion Z test and confidence interval",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=two-proportion-z-test-calculator",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

If you encounter any issues, please contact us at [email protected]