Z-test Calculator
Calculate the Z statistic, standard error, p-value, critical value, confidence interval, effect size, and significance decision from the sample mean, hypothesized mean, population standard deviation, sample size, significance level, and alternative hypothesis. The Z-test Calculator helps researchers, analysts, students, and quality professionals test a population mean when population variability is known.
Highlights
- Perform one-sample Z-tests quickly and accurately.
- Calculate Z statistics, p-values, and critical values.
- Choose two-sided, lower-tailed, or upper-tailed tests.
- Generate confidence intervals and margins of error.
- Interpret hypothesis test decisions and standardized effect size.
Table of Contents
How Z-test Calculator Works?
The Z-test Calculator performs a one-sample test of whether a population mean differs from a hypothesized value. It compares the entered sample mean with the hypothesized population mean using the known population standard deviation and sample size.
The observed difference is calculated as:
where is the sample mean and is the hypothesized population mean. The standard error measures the expected sampling variation of the sample mean:
Here, is the known population standard deviation and is the sample size. The Z statistic expresses the mean difference in standard-error units:
The selected alternative hypothesis determines how the probability value and rejection threshold are evaluated.
| Alternative hypothesis | P-value calculation | Rejection rule |
|---|---|---|
| Mean ≠ hypothesized mean | 2[1 − Φ(|z|)] | |z| > z1−α/2 |
| Mean < hypothesized mean | Φ(z) | z < zα |
| Mean > hypothesized mean | 1 − Φ(z) | z > z1−α |
In these expressions, Φ is the standard normal cumulative distribution function and α is the significance level expressed as a probability. The calculator rejects the null hypothesis when the p-value is less than or equal to α; otherwise, it reports that there is insufficient evidence to reject the null hypothesis.
The standardized effect size is the mean difference relative to the population standard deviation:
For the confidence interval, the calculator uses the two-sided normal critical value associated with the selected significance level. The margin of error and interval are:
This confidence interval is equivalent to a two-sided test at the same significance level. A hypothesized mean outside the interval indicates evidence against that value in the corresponding two-sided test.
Practical Use Cases
Researchers can test whether the average measurement from a study sample differs significantly from a theoretically expected or previously established population mean when population variability is known.
Data analysts can evaluate whether an observed business metric, such as an average response time or transaction value, provides statistically significant evidence of a difference from a benchmark.
Students can use the calculator to check one-sample Z-test exercises by entering the sample mean, null-hypothesis mean, known population standard deviation, sample size, significance level, and test direction.
Quality professionals can determine whether the average output of a production process differs from a specified target, provided the process standard deviation is reliably known and the observations are independent.
Healthcare and public-sector analysts can compare an observed average outcome with a reference value, such as a published population benchmark, while reporting the Z statistic, p-value, confidence interval, and practical effect size.
Accuracy and Limitations
The calculator applies the exact one-sample normal-theory formulas using the supplied population standard deviation, so its numerical results are accurate to the precision of the inputs and the underlying normal-distribution calculations. The test assumes independent observations and a genuinely known population standard deviation; if the standard deviation is estimated from the sample, a one-sample t-test is generally more appropriate. With small samples, the population distribution should be approximately normal, while larger samples may rely on the central limit theorem. The selected alternative controls the p-value and critical Z-value, but the reported confidence interval and margin of error are always two-sided. Statistical significance also depends on the entered significance level and does not by itself establish practical importance; the standardized effect size and confidence interval should be considered alongside the hypothesis-test decision.
Quick Examples
Example #1: Two-Sided Mean Test
Tests whether a sample mean differs from the hypothesized population mean.
Example #2: Lower-Tail Quality Test
Tests whether the observed process mean is lower than its hypothesized target.
Example #3: Upper-Tail Performance Test
Tests whether the sample indicates a population mean greater than the benchmark.