Proportion Z-Test Calculator
Enter successes and sample sizes to test a single proportion against a hypothesised value, or to compare the proportions of two independent groups. You get z, the p-value for each alternative, the confidence interval — Wilson for one proportion, Newcombe for a difference, with the textbook Wald interval alongside — Cohen's h, and the working. Free, no sign-up.
Direction is p̂ − p₀, or group 1 minus group 2.
Enter successes and sample size for both groups, as whole numbers with successes no larger than n.
How to Use the Proportion Z-Test Calculator
- 1. Choose the test. One proportion vs a value compares a sample proportion with a fixed p₀ — 50%, a published rate, a target. Two independent proportions compares two separate groups.
- 2. Enter counts, not percentages. Type the number of successes x and the sample size n for each group; the calculator works out the proportions. For one proportion, also enter p₀ as a decimal.
- 3. Set the alternative, α, and the confidence level. The direction is p̂ − p₀, or group 1 minus group 2.
- 4. Read and report. Check the small-sample warning, then use the z, the p-value, the score interval, and h in the APA line.
The Formulas
- One proportion: p̂ = x/n and z = (p̂ − p₀) / √(p₀(1 − p₀)/n). The standard error uses p₀ because the test asks how surprising p̂ would be if H₀ were true.
- Two proportions: z = (p̂₁ − p̂₂) / √(p̄(1 − p̄)(1/n₁ + 1/n₂)), where p̄ = (x₁ + x₂)/(n₁ + n₂) pools both groups — again because H₀ says the two proportions are equal.
- Wilson score interval (one proportion): (p̂ + z²/2n ± z√(p̂(1 − p̂)/n + z²/4n²)) / (1 + z²/n). It stays inside 0–1 and keeps close to its stated coverage with small n or extreme proportions.
- Newcombe's hybrid score interval (difference): combines the two groups' Wilson intervals (Newcombe, 1998, method 10). The Wald interval, (p̂₁ − p̂₂) ± z√(p̂₁(1 − p̂₁)/n₁ + p̂₂(1 − p̂₂)/n₂), is shown too because textbooks teach it.
- Cohen's h = 2·asin√p̂₁ − 2·asin√p̂₂, an effect size on a scale where .2 is small, .5 medium, and .8 large.
The test and the interval deliberately use different standard errors. A test works out what to expect if H₀ is true, so it uses p₀ or the pooled p̄; an interval describes plausible values without assuming H₀, so it is built from the sample proportions. That is why, in borderline cases, a 95% interval can just include the null value while the test gives p slightly below .05.
Worked Examples
Click Try an example in either mode. With one proportion, 58 of 100 students say they prefer open-book exams, tested against p₀ = .50. With two proportions, 56 of 70 students pass in section A against 48 of 80 in section B — the data of Newcombe's (1998) published example.
One proportion
p̂ = 58/100 = .58; SE₀ = √(.5 × .5 / 100) = .05
z = (.58 − .50) / .05 = 1.60, two-sided p = .110
95% Wilson CI [.48, .67]; Wald CI [.48, .68]; h = 0.16
Two proportions
p̂₁ = 56/70 = .80, p̂₂ = 48/80 = .60, p̄ = 104/150 = .693
SE = √(.693 × .307 × (1/70 + 1/80)) = .0755; z = .20 / .0755 = 2.65, p = .008
95% Newcombe CI for the difference [.05, .33]; Wald [.06, .34]; h = 0.44
Reported in APA style: the pass rate was higher in section A (80%) than in section B (60%), z = 2.65, p = .008, h = 0.44; difference = .20, 95% CI [.05, .33]. The single-proportion result is not significant: z = 1.60, p = .110 — 58% is consistent with an even split in a sample of 100.
Conditions and Close Relatives
- Large enough counts. The normal approximation needs about 10 expected successes and 10 expected failures (n·p₀ and n(1 − p₀) for one proportion; at least 5 in every cell of the two-group table). With less, use an exact binomial test or Fisher's exact test.
- Independent observations. Each person counts once and the groups are separate. For the same people measured twice, use McNemar's test.
- Same answer as chi-square. For two proportions, z² equals the uncorrected 2 × 2 chi-square statistic — 2.65² = 7.02 in the example — and the two-sided p-values match. R's
prop.testapplies Yates's continuity correction by default, so its p-value (.013 here) is a little larger. - Planning a survey instead? To find how precise a single proportion will be before you collect data, use the margin of error calculator.
Frequently Asked Questions
- When should I use a two-proportion z-test?
- When you compare the share of successes in two independent groups — pass rates in two classes, click-through rates for two designs, the percentage agreeing in two populations — and each group has enough successes and failures for the normal approximation. For small counts use Fisher's exact test; for paired yes/no data use McNemar's test.
- Why does the test use a pooled proportion?
- Because the null hypothesis says both groups share one proportion, and the best estimate of that common value pools all the data: p̄ = (x₁ + x₂)/(n₁ + n₂). The confidence interval for the difference does not assume H₀, so it uses each group's own proportion instead.
- Why use the Wilson interval instead of p̂ ± 1.96 × SE?
- The familiar Wald interval can cover the true proportion far less often than its nominal 95%, especially with small samples or proportions near 0 or 1, and it can stretch below 0 or above 1. The Wilson score interval avoids both problems and is recommended in the methodological literature; Newcombe's interval extends it to a difference between two proportions.
- Is the two-proportion z-test the same as a chi-square test?
- For a 2 × 2 table, yes in substance: the square of the z statistic equals the uncorrected Pearson χ² statistic, and the two-sided p-values are identical. The z-test has two advantages — it gives a direction and supports one-sided alternatives — and it pairs naturally with an interval for the difference.
- How do I report a z-test for proportions in APA style?
- Give the proportions or percentages, then the statistic, p, and an effect size with an interval: z = 2.65, p = .008, h = 0.44, difference = .20, 95% CI [.05, .33]. Proportions and their difference cannot exceed 1, so they take no leading zero; h can, so it keeps one. Name the interval method if it is not the Wald interval.
- What does Cohen's h measure?
- The difference between two proportions after an arcsine transformation that makes differences equally detectable anywhere between 0 and 1. A gap of .10 between .45 and .55 is harder to detect than the same gap between .01 and .11, and h accounts for that. Cohen's rough benchmarks are .2 small, .5 medium, and .8 large.