Hypothesis Tests
One Sample Z-Test Calculator
A one-sample z test compares a sample mean with a hypothesized mean when the population standard deviation is already known.
Worksheet
Press Calculate to see the result.
A one-sample z test compares a sample mean with a hypothesized mean when the population standard deviation is already known.
What this calculator answers
A one-sample z test asks whether a sample mean is far from a hypothesized mean when the population standard deviation was known before the data arrived. The standard error is sigma divided by the square root of n, and z is the gap between the two means divided by that standard error. Because sigma is not estimated, the reference curve is the standard normal and there is no degrees-of-freedom penalty. If the only spread you have is the sample standard deviation, this page is the wrong test. That job is the one-sample t test.
The page reports z, the normal p-value for the tail you chose, the critical z, and a decision sentence at your alpha. Sigma has to be the population value. Supporting counts and intermediate terms sit under the headline so a reader can see what was divided by what. When a checkbox or a tail setting changes the divisor or the rejection region, that choice appears in the steps rather than vanishing into a silent default.
The formula, written out
One-sample z statistic uses this relationship.
z = (mean - mu0) / (sigma / sqrt(n))
- mean. Observed sample mean.
- mu0. Null mean.
- sigma. Known population standard deviation.
- n. Sample size.
The mean of a sample from a population with known sigma has standard deviation sigma over the square root of n. Subtracting the null mean and dividing by that standard error produces a standard normal statistic when the null is true and the normal model holds. The algebra is the named textbook identity for this worksheet. Intermediate products and quotients appear in order so a calculator and a pencil can agree to the displayed rounding. If a neighbouring page uses a different divisor or a continuity correction, that page says so on its own ticket.
A full worked example
Example loaded in the worksheet
The loaded test uses mean 52, mu0 50, sigma 10, n 36, alpha 0.05, and a two-sided tail.
The sample mean is 52, mu0 is 50, population sigma is 10, and n is 36. Sigma is a known population value. This is a z test, and the one-sample t test is the page that would estimate the spread from the sample instead. The standard error is sigma divided by the square root of n: 10 divided by 6 equals 1.6667.
z equals (mean minus mu0) divided by that standard error: (52 minus 50) divided by 1.6667 equals 1.2. The two-sided p-value is 0.2301. The critical z at alpha 0.05 is 1.96.
At the 0.05 level, the result is outside the rejection region. The data are still compatible with the null hypothesis. The divisor is n, which is 36, not n minus 1. The n minus 1 divisor belongs to a sample variance.
| Z statistic | 1.2 |
|---|---|
| P-value | 0.2301 |
| Critical z | 1.96 |
| Decision | At the 0.05 level, the result is outside the rejection region. The data are still compatible with the null hypothesis. |
A second situation
A right-tailed test of the same sample against mu0 of 50
The sample mean is 52, mu0 is 50, population sigma is 10, and n is 36. Sigma is a known population value. This is a z test, and the one-sample t test is the page that would estimate the spread from the sample instead. The standard error is sigma divided by the square root of n: 10 divided by 6 equals 1.6667.
z equals (mean minus mu0) divided by that standard error: (52 minus 50) divided by 1.6667 equals 1.2. The right-tailed p-value is 0.1151. The critical z at alpha 0.05 is 1.6449.
At the 0.05 level, the result is outside the rejection region. The data are still compatible with the null hypothesis. The divisor is n, which is 36, not n minus 1. The n minus 1 divisor belongs to a sample variance.
| Z statistic | 1.2 |
|---|---|
| P-value | 0.1151 |
| Critical z | 1.6449 |
| Decision | At the 0.05 level, the result is outside the rejection region. The data are still compatible with the null hypothesis. |
A right-tailed alternative spends all of alpha on the positive side, so the critical z moves in from the two-sided line and the p-value uses only the upper tail. The same mean, sigma, and n can therefore cross alpha on one tail and miss it on two. The second example changes the feature that this formula is sensitive to, and the ticket shows the new figure beside the same definition. That contrast is the fastest way to see which input owns the movement.
What moves when the input moves
The sample mean moved from 52 to 56. Sigma, n, and mu0 stayed put. The headline result went from 1.2 to 3.6.
The nudged inputs
The sample mean is 56, mu0 is 50, population sigma is 10, and n is 36. Sigma is a known population value. This is a z test, and the one-sample t test is the page that would estimate the spread from the sample instead. The standard error is sigma divided by the square root of n: 10 divided by 6 equals 1.6667.
z equals (mean minus mu0) divided by that standard error: (56 minus 50) divided by 1.6667 equals 3.6. The two-sided p-value is 0.0003. The critical z at alpha 0.05 is 1.96.
At the 0.05 level, the result is in the rejection region. The data are unlikely if the null hypothesis is the whole story. The divisor is n, which is 36, not n minus 1. The n minus 1 divisor belongs to a sample variance.
| Z statistic | 3.6 |
|---|---|
| P-value | 0.0003 |
| Critical z | 1.96 |
| Decision | At the 0.05 level, the result is in the rejection region. The data are unlikely if the null hypothesis is the whole story. |
How to read the result
A small p-value means a gap this large is rare if mu0 and the known sigma are both right. The decision sentence compares that p-value with alpha. It does not measure how large the gap is in practical units. Say the unit, the sample size or contract terms, and the formula name in the same sentence as the figure. A number without those three pieces invites a later reader to invent a definition that this page never used.
Quote the mean, mu0, sigma, n, z, and the tail. Calling a result a z test without saying sigma was known overclaims the procedure. Write the result with its unit, the inputs that produced it, and the name of the formula. If the ticket shows a decision sentence, quote the alpha and the tail with it. If the ticket shows a money or dose figure, quote the rate and the schedule that produced it.
Assumptions that have to stay true
- Sigma is the population standard deviation, known independently of this sample.
- Observations are independent draws from a population with that sigma.
- The sample mean is close enough to normal, by the data or by a large n.
- The tail matches the alternative you stated in advance.
If an assumption above is false, do not average the discomfort away. Change the worksheet or change the question. A correct arithmetic step on the wrong model is still the wrong answer for the decision you are trying to make.
Mistakes that change the answer
- Typing the sample standard deviation into the sigma box and still calling the result a z test.
- Using n minus 1 in the standard error. That divisor belongs to a sample variance.
- Forgetting the square root of n and dividing by sigma itself.
- Reading a two-sided p-value as if it were one-sided.
Where a different calculator is the honest choice
The one-sample t-test calculator estimates the spread from the data. The z critical value calculator returns only the cutoff. The z-test calculator is the chooser when you have not yet decided whether the question is one mean, two means, or a proportion. Related links under the essay open pages that keep their own formulas instead of hiding a mode switch inside this ticket.
When the job changes, move to a page built for that job: Z Critical Value Calculator, One Sample T-Test Calculator, Z-Test Calculator.
Check yourself
The sample mean is 52, mu0 is 50, population sigma is 10, and n is 36. What is the two-sided z statistic?
The standard error is 1.6667 and the z statistic is 1.2.
Using the result in a sentence
Manufacturing lines with a long-run sigma, and standardized tests with a known scale, are the honest homes for this z. A five-number lab series with an estimated spread should move to the t test. Keep the count, the unit, and the assumption list beside any copy of the number that leaves this browser tab.
A nonsignificant z can still be a gap you care about in the units of the measurement, and a significant z can be a tiny gap in a huge sample. The test also collapses if the sigma you typed is not the population sigma. Pair the headline with the steps before you staff a route, set a grade boundary, or compare two contracts from a single number.
Questions people ask next
01What definition does the One Sample Z-Test Calculator commit to?
This page uses One-sample z statistic: z = (mean - mu0) / (sigma / sqrt(n)). The mean of a sample from a population with known sigma has standard deviation sigma over the square root of n. Subtracting the null mean and dividing by that standard error produces a standard normal statistic when the null is true and the normal model holds. If a textbook uses a different divisor, a different continuity correction, or a different rounding rule, the last digits can move, so the definition is printed above the result. The worksheet asks for Sample mean, Hypothesized mean, Population sigma, Sample size n, Alpha, Tail, and it refuses a blank that the formula cannot interpret. Keep that printed definition in the sentence you write next to the figure so a later reader can rebuild the arithmetic without guessing which convention you chose.
02How should the worked example be read out loud?
In the loaded example the z statistic is 1.2. A small p-value means a gap this large is rare if mu0 and the known sigma are both right. The decision sentence compares that p-value with alpha. It does not measure how large the gap is in practical units. Say the unit and the count before you say whether the number is large or small. Read the steps in order rather than jumping to the headline, because the intermediate terms are where a swapped percent and proportion usually hide. If the ticket shows both a primary figure and a comparison figure, name which one you are quoting.
03What is the fastest way to get a misleading result?
Typing the sample standard deviation into the sigma box and still calling the result a z test. A nonsignificant z can still be a gap you care about in the units of the measurement, and a significant z can be a tiny gap in a huge sample. The test also collapses if the sigma you typed is not the population sigma. A second common failure is leaving a checkbox or tail setting in the wrong state and then treating the number as if the default had matched your plan. Reset the example, change one input, and confirm the ticket moves in the direction the formula predicts before you trust a live run.
04When should I leave this page for a different calculator?
The one-sample t-test calculator estimates the spread from the data. The z critical value calculator returns only the cutoff. The z-test calculator is the chooser when you have not yet decided whether the question is one mean, two means, or a proportion. The related links under the essay go to those worksheets, which keep their own formulas instead of hiding them in a mode switch. If the question changed from a summary to a test, from a payment to a refinance, or from a raw score to a percentile, switch pages rather than forcing this ticket to answer a job it was not built for.
05What belongs in the sentence next to the number?
The standard error is 1.6667 and the z statistic is 1.2. Quote the mean, mu0, sigma, n, z, and the tail. Calling a result a z test without saying sigma was known overclaims the procedure. A bare number without those three pieces cannot be audited when a score, a rate, or a lab value is challenged later. Store the inputs beside the result whenever the figure will travel into a report.