Two Proportion Z-Test Calculator
Compare two independent proportions, such as an A/B test or treatment against control, with the pooled z-test, p-value and effect size.
Open → Two Proportion Z-Test CalculatorTest whether a population proportion equals a claimed value. Enter the number of successes, the sample size and the hypothesised proportion p₀; the calculator returns the z statistic, the p-value for a two-, left- or right-tailed test, the critical value and a plain-English conclusion, with every step shown.
Formula z = (p̂ − p₀) ⁄ √(p₀(1 − p₀) ⁄ n)
Shaded area = the p-value. Dashed lines = critical values for the chosen α.
The one proportion z-test measures the gap between the sample proportion p̂ and the claimed value p₀ in units of standard error: z = (p̂ − p₀) ÷ √(p₀(1 − p₀)/n). The p-value is the chance of a gap at least that large if p₀ were true, and a p-value below the significance level α rejects the claim.
Write the hypotheses
The null hypothesis is always H₀: p = p₀. The alternative is p ≠ p₀, p > p₀ or p < p₀, chosen from the question before you see the data.
Check the conditions
A random sample, independent observations, and at least 10 expected successes and 10 expected failures: n·p₀ ≥ 10 and n(1 − p₀) ≥ 10. These make the normal approximation to the binomial trustworthy.
Compute p̂ and the standard error
p̂ = x ÷ n, and under H₀ the spread of p̂ from sample to sample is SE = √(p₀(1 − p₀) ÷ n).
Standardise
z = (p̂ − p₀) ÷ SE. A z of 2.4 means the sample landed 2.4 standard errors from the claim.
Find the p-value and decide
The p-value is the tail area beyond z on the standard normal curve (both tails for a two-tailed test). If it is below α, reject H₀.
The test statistic. Here q₀ = 1 − p₀. The standard error uses p₀ because the test asks what would happen if the claim were true.
| α | Two-tailed z* | One-tailed z* |
|---|---|---|
| 0.10 | ±1.645 | 1.282 |
| 0.05 | ±1.960 | 1.645 |
| 0.01 | ±2.576 | 2.326 |
A two-tailed test at α = 0.05 rejects p₀ roughly when p₀ falls outside the 95% confidence interval for the proportion. The match is not exact because the two use slightly different standard errors.
These one proportion z-test examples work through the full test. In the first, a coin lands heads 62 times in 100 tosses: p̂ = 0.62, the standard error under p₀ = 0.5 is 0.05, z = 2.40 and the two-tailed p-value is 0.0164, so at α = 0.05 the coin is judged unfair.
A coin lands heads 62 times in 100 tosses. Is it fair? (α = 0.05)
0.0164 < 0.05 — reject H₀: evidence the coin is biased
A supplier claims at most 4% of parts are defective. You find 23 defects in 400. Is the rate higher? (α = 0.05)
0.0370 < 0.05 — reject H₀: the defect rate is above 4%
A one-proportion z-test answers a narrow question: is the gap between your sample proportion and a claimed value bigger than chance alone would usually produce? It does not tell you how big the true difference is, and it does not tell you whether the difference matters. With a very large sample, a gap of half a percentage point can be "statistically significant" and still be irrelevant in practice. Pair the test with a confidence interval, which shows the range of plausible values for the true proportion.
The number of successes in a sample follows a binomial distribution. When the expected numbers of successes and failures are both at least 10, that binomial shape is close enough to a normal curve that the z-test's p-values are accurate. Below that, the normal approximation can be badly off — especially for proportions near 0 or 1 — and an exact binomial test is the right tool.
The claimed value should come from outside your sample: a published rate, a historical figure, a specification or a theory such as "a fair coin". Picking p₀ after looking at the data, or testing several values until one rejects, makes the p-value meaningless.
To summarise the sample before testing, use the sample proportion calculator. To compare two groups instead of one group against a number, use the two proportion z-test. To plan how many observations a study needs, use the sample size calculator for a proportion. For the background on what a proportion means in statistics, read the guide to proportions in statistics.
Conditions, tails, and how to read the p-value.
p₀. You take a random sample of size n, count the successes x, and measure how many standard errors the sample proportion p̂ = x/n sits from p₀. That distance is the z statistic; the p-value says how surprising a distance at least that large would be if p₀ were true.z = (p̂ − p₀) ÷ √(p₀(1 − p₀) ÷ n). The denominator uses the hypothesised proportion p₀, not p̂, because the test works out what the sampling distribution would look like if the null hypothesis were true. That is the main difference from a confidence interval, which uses p̂.n·p₀ ≥ 10 and n·(1 − p₀) ≥ 10. The calculator checks the last one for you. With smaller expected counts, use an exact binomial test instead.p ≠ p₀) when any difference matters. Use right-tailed (p > p₀) or left-tailed (p < p₀) only when the research question is directional — for example, a supplier claims a defect rate of at most 4% and you only care whether it is higher. A one-tailed p-value is half the two-tailed one when the result lands on the predicted side.