One Proportion Z-Test Calculator
Test whether a population proportion differs from a claimed value. Enter the number of successes, the sample size and the hypothesized proportion to get the z statistic, the p-value for a two-tailed, right-tailed or left-tailed test, the exact binomial p-value and a Wilson confidence interval.
Related guides: how hypothesis testing works, what a p-value means and the TI-84 statistics functions (this is 1-PropZTest).
A whole count, not a percentage
The value in the null hypothesis, between 0 and 1
Chosen before looking at the data, usually 0.05
Related Calculators
Two Proportion Z-Test Calculator
Compare two proportions with the pooled z-test: z statistic, p-value and a confidence interval for the difference (Wald, Newcombe or Agresti–Caffo).
Confidence Interval for a Proportion Calculator
Estimate one proportion or the difference of two from counts with the Wald (1-PropZInt, 2-PropZInt), Wilson, Agresti–Coull, Clopper–Pearson, Jeffreys and Newcombe methods compared.
P-Value Calculator
Find the one- or two-tailed p-value of a z, t, chi-square or F test statistic and the decision at your significance level.
What the one-proportion z-test does
The one-proportion z-test checks whether the share of successes in one sample is consistent with a claimed population proportion p₀. The null hypothesis is H₀: p = p₀. The alternative hypothesis is p ≠ p₀ for a two-tailed test, p greater than p₀ for a right-tailed test and p less than p₀ for a left-tailed test. Typical questions are whether a coin is fair (p₀ = 0.5), whether a defect rate still meets a target, or whether the share of customers who renew differs from last year.
A success is whichever outcome you are counting; it does not have to be good news. Enter the number of successes x and the sample size n as counts. If a report gives only a percentage, multiply it by n first: 36% of 200 is 72 successes. To estimate the proportion instead of testing a claim, use the proportion confidence interval calculator.
Formulas
p̂ = x / n
SE = √( p₀ (1 − p₀) / n )
z = (p̂ − p₀) / SE
Right-tailed: p-value = P(Z ≥ z)
Left-tailed: p-value = P(Z ≤ z)
Two-tailed: p-value = 2 × P(Z ≥ |z|)
The standard error is built from the hypothesized proportion p₀, not from p̂, because the p-value is calculated as if the null hypothesis were true. Each tail is computed directly from its own end of the normal distribution rather than as 1 minus the other tail, so a very small p-value keeps all its digits; one below 1e-300 is shown as a bound.
The confidence interval is the Wilson score interval, which stays accurate for small samples and for proportions near 0 or 1. The Wald interval p̂ ± z*·√(p̂(1 − p̂)/n) shown by the TI-84 1-PropZInt screen is available, together with the Agresti–Coull, Clopper–Pearson and Jeffreys methods, in the proportion confidence interval calculator.
Conditions for the z-test
| Condition | What to check |
|---|---|
| Random | The sample is random, or the data come from a randomized experiment |
| Independent | Observations do not influence each other; when sampling without replacement, n is less than 10% of the population |
| Success–failure | n·p₀ and n·(1 − p₀) are both at least 10 (some books accept 5), so the binomial distribution is close to a normal curve |
The z-test is an approximation: the number of successes follows a binomial distribution, and the normal curve fits it well only when both expected counts are large. The calculator shows both numbers under the results. When the success–failure condition fails, report the exact binomial p-value instead, which needs no approximation.
Worked example
A subscription service reports that 30% of its customers renew. In a random sample of 200 customers, 72 renewed (36%). Is the renewal rate different from 30%?
- p̂ = 72 / 200 = 0.36.
- SE = √(0.3 × 0.7 / 200) = 0.032404.
- z = (0.36 − 0.3) / 0.032404 = 1.8516.
- Two-tailed p-value = 2 × P(Z ≥ 1.8516) = 2 × 0.032039 = 0.064078.
Because 0.0641 is above 0.05, the two-tailed test does not reject H₀. Had the company decided beforehand to test only whether the renewal rate has increased, the right-tailed p-value is 0.032039 and the same data are significant. The direction has to be fixed before looking at the data: choosing it afterwards raises the real false-positive rate to 10%. Load example fills in these numbers.
| Alternative hypothesis | z-test p-value | Exact binomial p-value |
|---|---|---|
| p ≠ 0.3 (two-tailed) | 0.064078 | 0.075576 |
| p greater than 0.3 (right-tailed) | 0.032039 | 0.039628 |
| p less than 0.3 (left-tailed) | 0.967961 | 0.971566 |
The 95% Wilson interval for the renewal rate is (0.2967, 0.4286). It contains 0.3, which agrees with the two-tailed result.
z-test, exact binomial test and prop.test
The exact binomial test adds up binomial probabilities instead of using the normal curve. Its one-sided p-value is a binomial tail; its two-sided p-value adds every outcome that is no more likely than the one observed, the rule used by R's binom.test and SciPy's binomtest. For large samples it agrees closely with the z-test. In R, prop.test(x, n, p = p0, correct = FALSE) reproduces this calculator's z-test: its X-squared statistic equals z² and the p-value is the same. By default prop.test applies a continuity correction, which makes its p-value slightly larger.
| Method | Based on | Best for |
|---|---|---|
| z-test | Normal approximation, standard error from p₀ | Large samples: n·p₀ and n·(1 − p₀) at least 10 |
| Exact binomial test | Binomial probabilities, no approximation | Small samples, or p₀ near 0 or 1 |
| prop.test with continuity correction | z-test with a 0.5 adjustment to the count | Cautious results for moderate samples |
Software equivalents
| Software | z-test | Exact binomial test |
|---|---|---|
| Excel / Sheets | z: =(x/n-p0)/SQRT(p0*(1-p0)/n), p-value: =2*NORM.S.DIST(-ABS(z),TRUE) | Right tail: =1-BINOM.DIST(x-1,n,p0,TRUE) |
| R | prop.test(x, n, p = p0, correct = FALSE) | binom.test(x, n, p = p0) |
| Python | statsmodels: proportions_ztest(x, n, value=p0, prop_var=p0) | scipy.stats: binomtest(x, n, p0).pvalue |
| TI-84 | STAT → TESTS → 5:1-PropZTest | Not available |
To compare two groups instead of one group against a target, use the two proportion z-test, or the A/B test calculator for conversion rates. The p-value on its own says nothing about the size of the difference; see the effect size calculator.
Frequently Asked Questions
How do I calculate a one-proportion z-test?
Divide the number of successes by the sample size to get p̂, compute the standard error √(p₀(1 − p₀)/n) from the hypothesized proportion, and divide p̂ − p₀ by it to get z. The p-value is the area under the standard normal curve beyond z in the direction of the alternative hypothesis, or twice the tail beyond |z| for a two-tailed test. Enter x, n and p₀ above to see every step.
What are the null and alternative hypotheses?
The null hypothesis is H₀: p = p₀, where p₀ is the claimed proportion. The alternative hypothesis is p ≠ p₀ (two-tailed), p greater than p₀ (right-tailed) or p less than p₀ (left-tailed). Choose it from the research question before you see the data.
When is the z-test for a proportion valid?
The sample must be random, the observations independent (n below 10% of the population when sampling without replacement), and both n·p₀ and n·(1 − p₀) must be at least 10 so that the binomial distribution is close to a normal curve. If they are not, use the exact binomial p-value shown in the results.
Should the standard error use p̂ or p₀?
A hypothesis test uses p₀, because the p-value describes what would happen if the null hypothesis were true. A confidence interval has no null value, so it uses p̂ (the Wald interval) or the Wilson score. This is why a test and an interval built from the Wald standard error can disagree at the edge of significance.
Why does R's prop.test give a slightly different p-value?
prop.test applies Yates' continuity correction by default. Call prop.test(x, n, p = p0, correct = FALSE) to get the uncorrected chi-square statistic, which equals z² and gives the same two-sided p-value as this calculator. binom.test gives the exact binomial p-value.
What is 1-PropZTest on the TI-84?
It is the TI-84 command for this test: press STAT, choose TESTS, then 5:1-PropZTest. Enter p₀, the number of successes x (a whole number, not a percentage), n and the alternative hypothesis (not equal, less than or greater than). The z statistic and p-value it reports match this calculator.
Should I use a one-tailed or a two-tailed test?
Use a two-tailed test when a difference in either direction would matter, which is the default in most research. Use a one-tailed test only if you decided before collecting data that a change in one direction is the only thing of interest. For a symmetric statistic such as z, a one-tailed p-value is half the two-tailed one when the result is in the predicted direction.
Embed This Calculator
Add this free calculator to your course page or LMS.
Adjust the height value to fit your page.