Z-Test Calculator
Testing a Mean When the Population Variance Is Known
The z-test compares a sample mean against a known or hypothesized population mean, or compares two sample means directly, under the assumption that the population standard deviation is known. That assumption is what separates it from the far more commonly used t-test — in practice the z-test shows up when the population variance genuinely is known in advance, or as a large-sample approximation once the sample size makes the distinction with a t-test negligible.
The Formula
Two-sample: z = (x̄1 − x̄2) / √(σ1²/n1 + σ2²/n2)
Worked Example: One-Sample Test
A sample of 36 items has a mean of 105, and the known population mean is 100 with population standard deviation 15:
| Quantity | Value |
|---|---|
| Standard error, SE = σ/√n | 2.50 |
| z statistic | 2.00 |
| Two-tailed p-value | 0.0455 |
Computed directly from the calculator's formula.
At p = 0.0455, this result just clears the conventional 0.05 significance threshold — the sample mean is unlikely enough under the null hypothesis of μ = 100 to warrant rejecting it.
Where This Calculation Matters
- Large-sample process control — when historical data provides a stable, well-estimated population standard deviation, the z-test gives a straightforward significance check for a new sample mean.
- Standardized testing — comparing an individual or group score against a population with known parameters, such as nationally normed exam scores.
- Two-sample large-n comparisons — comparing two group means when both group standard deviations are known or reliably estimated from large samples.
How to Use This Calculator
- Choose One-Sample Z-Test or Two-Sample Z-Test.
- For one-sample: enter the sample mean, population mean, population standard deviation, and sample size.
- For two-sample: enter both sample means, both standard deviations, and both sample sizes.
- Select a tail type: Two-Tailed, Left-Tailed, or Right-Tailed.
- Select Calculate to get the z statistic and p-value.
Related Calculations
When the population standard deviation is unknown, use the T-Test Calculator instead. To convert a computed z-score into a probability directly, see the P-Value Calculator.