Z-Test Calculator
Test a sample mean against a known population mean when the population standard deviation is known — the one-sample z-test, with the p-value and confidence interval.
z = (x̄ − μ₀) ÷ (σ / √n).
How the z-test calculator works
z = (x̄ − μ₀) ÷ (σ / √n). The denominator is the standard error, so z counts how many standard errors the sample mean sits from the hypothesised value. The p-value is the tail area beyond it.
The z-test needs the *population* standard deviation, which you almost never have. If you estimated σ from the same sample, use a t-test instead — the difference matters below about n = 30.
Formula: z = (x̄ − μ₀) / (σ / √n)
Worked examples
| Inputs | z statistic | Note |
|---|---|---|
| Mean 104 against 100, σ 15, n 50 | 1.885618 | z = 1.886, p = 0.059 — not quite significant |
| A larger sample | 3.771236 | the same difference is now significant |
| No difference at all | 0 | z = 0, p = 1 |
FAQFrequently asked questions
When do I use a z-test rather than a t-test?
When you genuinely know the population standard deviation. In practice that is rare, so the t-test is the usual choice.
What is a p-value?
The probability of seeing a result at least this extreme if the null hypothesis were true. It is not the probability that the null is true.
What does p = 0.059 mean?
That a difference this large would arise by chance about 6% of the time. By the usual 5% convention that is not significant — but the 5% line is a convention, not a law of nature.
One-tailed or two?
Two, unless you committed to a direction before seeing the data. Switching to one-tailed afterwards to get under 0.05 is a well-known way to fool yourself.
Does a significant result mean the effect is large?
No. With a large enough sample, trivially small differences become significant. Always read the effect size alongside the p-value.
Where these figures come from
- NIST Digital Library of Mathematical Functions — reference definitions for elementary and special functions
- Wolfram MathWorld — definitions and formulas for every topic on this page
- NIST/SEMATECH e-Handbook of Statistical Methods — the statistical formulas (mean, variance, z, confidence intervals, sample size)
- Australian Curriculum (ACARA) — Mathematics — the terms and methods taught in Australian schools
Last checked: September 2026. Formulas are fixed by mathematics and do not change with tax years or regulations.