What is a Z-test?
A one-sample Z-test is one of the most popular location tests used in inferential statistics. It determines whether the mean of a population differs significantly from a known or hypothesized value (μ₀). The Z-test assumes that the population standard deviation (σ) is known and the sample is sufficiently large (typically n ≥ 30) for the Central Limit Theorem to apply.
When do I use Z-tests?
Use a Z-test when:
- You know the population standard deviation (σ).
- The sample size is large (n ≥ 30) — the sampling distribution of the mean is approximately normal.
- You want to test whether a population mean equals a specific value.
- Data comes from a normally distributed population (for small samples).
If σ is unknown, use the t-test calculator instead.
Z-test formula
The one-sample Z-statistic is calculated as:
Z = (x̄ − μ₀) / (σ / √n)
Where:
- x̄ — sample mean
- μ₀ — hypothesized population mean (null hypothesis value)
- σ — known population standard deviation
- n — sample size
- σ / √n — standard error of the mean (SE)
p-value from Z-test
The p-value is the probability of observing a Z-statistic at least as extreme as the calculated one, assuming H₀ is true:
- Two-tailed: p = 2 × P(Z > |z|)
- Left-tailed: p = P(Z ≤ z)
- Right-tailed: p = P(Z ≥ z)
If the p-value is less than or equal to the significance level α, you reject H₀.
Two-tailed Z-test and one-tailed Z-test
The choice of test direction depends on your research hypothesis:
- Two-tailed test (H₁: μ ≠ μ₀) — Tests whether the mean is different from μ₀ in either direction. Use when you have no prior belief about the direction of the difference.
- Left-tailed test (H₁: μ < μ₀) — Tests whether the mean is significantly less than μ₀.
- Right-tailed test (H₁: μ > μ₀) — Tests whether the mean is significantly greater than μ₀.
Z-test critical values & critical regions
For a significance level α, the critical values from the standard normal distribution are:
| Test type | α = 0.01 | α = 0.05 | α = 0.10 |
|---|---|---|---|
| Two-tailed | ±2.5758 | ±1.9600 | ±1.6449 |
| Left-tailed | −2.3263 | −1.6449 | −1.2816 |
| Right-tailed | +2.3263 | +1.6449 | +1.2816 |
Reject H₀ if the Z-statistic falls in the critical region (beyond the critical value).
How to use the one-sample Z-test calculator?
- Enter the sample mean (x̄) — the average from your data.
- Enter the population mean (μ₀) — the value you're testing against (null hypothesis).
- Enter the known population standard deviation (σ).
- Enter the sample size (n).
- Choose the significance level (α): 0.01, 0.05, or 0.10.
- Select the test type: two-tailed, left-tailed, or right-tailed.
- Click Calculate Z-test to get the Z-statistic, p-value, critical value, and decision.
Z-test examples
Example 1 (Two-tailed)
A manufacturer claims the mean weight of a product is 500 g. A quality inspector measures a sample of 36 products and finds a sample mean of 503 g, knowing the population standard deviation is 9 g. Test at α = 0.05.
Z = (503 − 500) / (9 / √36) = 3 / 1.5 = 2.00 Critical value: ±1.96 |Z| = 2.00 > 1.96 → Reject H₀
Conclusion: There is sufficient evidence that the mean weight differs from 500 g.
Example 2 (Right-tailed)
A new teaching method is tested on 50 students. The population mean exam score is 70 with σ = 10. After the new method, the sample mean is 73. Test H₁: μ > 70 at α = 0.05.
Z = (73 − 70) / (10 / √50) = 3 / 1.414 ≈ 2.12 Critical value: +1.645 Z = 2.12 > 1.645 → Reject H₀
Conclusion: The new teaching method significantly improves exam scores.
FAQs
- Z-test vs t-test: which to use?
- Use Z-test when σ (population standard deviation) is known and n ≥ 30. Use t-test when σ is unknown (which is most practical situations).
- What is the standard error?
- SE = σ / √n. It measures how much the sample mean is expected to vary from the population mean.
- What does "fail to reject H₀" mean?
- It means there is not enough evidence to conclude the mean differs from μ₀ at the chosen significance level. It does NOT prove H₀ is true.
- Does the Z-test apply to metric and imperial units?
- Yes. The Z-test is unit-agnostic — it works with any data (kilograms, pounds, dollars, rubles, meters, feet, etc.) as long as the statistical assumptions are met.