About the One-Sample Z-Test
The One-Sample Z-Test Calculator tests whether an observed sample mean differs meaningfully from a known or hypothesized population mean, in situations where the population's standard deviation is already known rather than estimated from the sample. It returns both a z-statistic and a two-tailed p-value, giving a direct answer to whether the observed difference is larger than would be expected from random sampling variation alone.
How It Works
You enter the sample mean, the population mean you are testing against, the known population standard deviation, and the sample size. The calculator standardizes the difference between the sample mean and the population mean by dividing it by the standard error, then converts that z-statistic into a two-tailed p-value using the standard normal distribution. A small p-value indicates the sample mean is unlikely to have occurred if the true population mean really equals the value you tested against.
Examples
A sample mean above the population mean
A sample of 36 observations has a mean of 105 against a known population mean of 100 and population standard deviation of 15. The standard error is 15 divided by the square root of 36, or 2.5, giving a z-statistic of 105 minus 100 divided by 2.5, which equals 2.00, and a two-tailed p-value of about 0.0455, below the common 0.05 threshold.
A difference that is not statistically significant
A sample of 25 observations has a mean of 98 against a population mean of 100 and population standard deviation of 10. The standard error is 10 divided by the square root of 25, or 2, giving a z-statistic of 98 minus 100 divided by 2, which equals -1.00, and a two-tailed p-value of about 0.317, well above the 0.05 threshold typically used to call a result significant.
Advantages
- Produces both the z-statistic and its two-tailed p-value in one step, without needing a separate z-table lookup.
- Makes the role of sample size explicit by working it directly into the standard error, showing how the same mean difference becomes more or less significant depending on sample size.
- Keeps the known-population-standard-deviation assumption visible in the required inputs, helping avoid its most common misuse.
Common Mistakes
- Running a one-sample z-test when the population standard deviation is actually unknown and was estimated from the sample data, a situation that calls for a t-test instead.
- Reading a small p-value as proof of a large or practically meaningful difference, when a large enough sample size can make even a trivial difference statistically significant.
- Treating the two-tailed p-value as if it already answers a directional, one-tailed question about whether the sample mean is specifically higher, rather than simply different.
Edge Cases to Watch For
- Both the sample size and the population standard deviation must be greater than zero, or the calculator returns an error instead of a result.
- This test assumes the population standard deviation is genuinely known in advance, not estimated from your own sample; if it was estimated from the sample, a t-test is the statistically appropriate choice instead.
- Only a two-tailed p-value is calculated here; if you need a one-tailed test, halve the reported p-value only when the observed difference is in the direction your hypothesis predicted.
- Because standard error shrinks with the square root of sample size, very large samples can produce a statistically significant result from a difference too small to matter practically.
Common Use Cases
- Quality control settings where a manufacturing process has a long-established, well-documented standard deviation and a new sample's mean needs to be checked against a target.
- Standardized testing programs comparing a group's average score to a known population mean and standard deviation from prior test administrations.
- Statistics students and instructors working through textbook problems where the population standard deviation is given as a known quantity.