Z-Test for a Proportion Calculator

This calculator computes the z statistic for a one-sample proportion test, which checks whether an observed proportion differs significantly from a value you expect. Proportions are everywhere, the share of customers who convert, voters who support a policy, items that pass inspection, and often you want to know whether a measured proportion is really different from a claimed or target figure, or just looks different by chance. The one-proportion z-test answers exactly that. It compares your observed sample proportion against the hypothesized value, scaled by the standard error expected under that hypothesis, to produce a z score. A large z, well away from zero, means the observed proportion is unlikely to have arisen by chance if the true proportion equalled the hypothesized value; a small z means the difference is consistent with chance. This calculator does the calculation. You enter the number of successes, the sample size, and the hypothesized proportion to test against, and it returns the z statistic, the sample proportion, the hypothesized value, and the sample size. The results update as you type. Use it for statistics study, for A/B testing, quality control, or any check of a proportion against a benchmark. The z statistic is the sample proportion minus the hypothesized proportion, divided by the standard error under the null, which is the square root of the hypothesized proportion times one minus it, over the sample size. To complete the test, compare the magnitude of z against the critical value for your significance level, commonly 1.96 for a two-sided test at 95 percent confidence, or find the p-value; if the magnitude exceeds the critical value, the difference is significant. The test relies on the normal approximation to the binomial, which is reliable when both the expected successes and failures are reasonably large, generally at least about ten each.

Advertisement
2
z statistic
Sample proportion0.6
Hypothesized0.5
Sample size100

z = (sample proportion - p0) / sqrt(p0(1-p0)/n). Compare against 1.96 for a two-sided 95% test. Relies on the normal approximation; needs ~10+ expected successes and failures.

How it works

The sample proportion is the successes divided by the sample size. The standard error under the null hypothesis is the square root of the hypothesized proportion times one minus it, divided by the sample size. The z statistic is the difference between the sample proportion and the hypothesized value, divided by that standard error.

Worked example

With 60 successes in a sample of 100, the sample proportion is 0.6. Testing against a hypothesized 0.5, the standard error is the square root of 0.5 times 0.5 over 100, which is 0.05. The z statistic is 0.6 minus 0.5, divided by 0.05, which is 2.0, exceeding the 1.96 threshold for two-sided significance at 95 percent.

Related calculators