Key Points
- A z-test compares a sample statistic with a hypothesised value by measuring the gap in standard errors.
- The one-sample z-test statistic is z = (x̄ − μ₀) ÷ (σ/√n), and it follows a standard normal distribution when H₀ is true.
- It is used when the population standard deviation is known, or when the sample is large enough for the central limit theorem to apply.
- Variants test two means against each other and a sample proportion against a claimed proportion.
- When σ is unknown and the sample is small, a t-test is used instead.
Is a 5 g Gap Worth Worrying About?
A bag of rice should weigh 1,000 g, and a sample of 36 bags averages 1,005 g instead.
The z-test decides whether that 5 g is a real difference or ordinary sampling variation. It converts the gap into a number of standard errors and asks how unusual that would be if the bags were really filled correctly.

What Is a Z Test?
A z-test is a hypothesis test whose test statistic follows the standard normal distribution when the null hypothesis is true. For a single mean:
The numerator is the gap between the sample mean and the claimed mean. The denominator is the standard error, the typical size of that gap from chance alone. So counts how many standard errors apart the two are.
Try It Yourself
Use the hypothesis test explorer to see Z Test at work: drag, change the numbers and watch what happens.
What Are the Types of Z Test?
Three are common.

Each has the same shape: an observed difference divided by its standard error.
How Do You Carry Out a Z Test?
Five steps.

At the 5 percent level, a two-tailed test rejects when . The critical value changes with the significance level and the number of tails.
How Is a Z Test Different From a T-Test?
The difference is what is known about the spread.

When must be estimated from a small sample, the extra uncertainty widens the distribution, and the t-test accounts for it. For large samples the two give nearly the same answer.
Examples of the Z Test
Example 1
Rice bags should average 1,000 g, with g. A sample of 36 averages 1,005 g. Test at , two-tailed.
Standard error , so
Since , reject . The two-tailed p-value is about 0.012.
Example 2
A student computes Example 1 as and fails to reject. What went wrong?
Dividing by the standard deviation looks natural, because 12 g is the spread given in the question.
That is the spread of individual bags. The question is about the mean of 36 bags, which varies far less: its standard error is . Dividing by 12 makes the gap look six times smaller than it is and reverses the decision.
Example 3
A school claims 60 percent of students prefer online homework. In a sample of 200, 130 do. Test , two-tailed.
, standard error , so . Since , fail to reject ().
Example 4
Two classes of 50 have mean scores 72 and 68, with in each. Is the difference significant at 5 percent?
Standard error , so . Since , reject , just ().
Example 5
In Example 1, would a right-tailed test at 1 percent reject ?
The critical value is 2.326. Since , yes.
Example 6
A sample of 15 has an unknown population standard deviation. Should a z-test be used?
No. With a small sample and estimated from the data, use a t-test.
Why the Z Test Matters
It is the clearest example of how a test statistic works.
- It measures gaps in standard errors. That idea carries over to t, F and chi-square tests.
- It suits large samples. By the central limit theorem, means of large samples are close to normal.
- It tests proportions. Survey and poll results are checked against claims with the proportion z-test.
- It links to intervals. A two-tailed 5 percent z-test rejects exactly when the claimed value lies outside the 95 percent interval.
OpenStax's Hypothesis Testing of a Single Mean and Single Proportion section works through z-tests for means with known and for proportions in the same way.
What Most Guides Get Wrong About the Z Test
Two points are often missed.
The first is the standard error. Many explanations present the formula without stressing why is divided by . Example 2 shows what happens without it: the test loses most of its power and gives the wrong decision.
The second is the condition for using it. Guides sometimes say "use a z-test for large samples" and leave it there. The real condition is that the sampling distribution is close to normal and the standard error is known or well estimated. For proportions, that means both and should be at least 10.
Where Students Trip Up on the Z Test
Mistake 1: Dividing by σ instead of σ/√n
Where it slips in: The test statistic, as in Example 2.
Don't do this: Using the population standard deviation as the denominator.
The correct way: Use the standard error, .
Students divide by because it is the only standard deviation in the question, and the step from individuals to means is not written anywhere.
Mistake 2: Using a z-test for small samples with unknown σ
Where it slips in: Example 6 and similar.
Don't do this: Applying 1.96 when the sample is small and is estimated.
The correct way: Use a t-test.
Mistake 3: Using in the proportion standard error
Where it slips in: Proportion tests, as in Example 3.
Don't do this: Computing for the test.
The correct way: Use the hypothesised , because the test assumes is true.
Quality inspectors run z-tests routinely. A packaging line with a known process standard deviation is sampled every hour, and a mean that drifts more than about two standard errors from the target triggers an adjustment before customers ever receive underfilled packs.
Bottom Line
- A z test measures the gap between a sample result and a claimed value in standard errors.
- The one-sample statistic is .
- Variants test two means and single proportions.
- Small samples with unknown need a t-test instead.
- To work through statistics with a teacher, explore Bhanzu's high school math tutor sessions or math classes online.
Read More
Research Behind This Article
- OpenStax, Introductory Statistics 2e, 10.2 Two Population Means with Known Standard Deviations (2023). openstax.org
- OpenStax, Introductory Statistics 2e, 8.1 A Single Population Mean Using the Normal Distribution (2023). openstax.org
- NIST/SEMATECH, e-Handbook of Statistical Methods, 7.1.3 What are statistical tests? (2022). itl.nist.gov
- NIST/SEMATECH, e-Handbook of Statistical Methods, 1.3.6.7.1 Cumulative Distribution Function of the Standard Normal Distribution (2022). itl.nist.gov
- NIST/SEMATECH, e-Handbook of Statistical Methods, 7.2.2.2 Sample sizes required (2022). itl.nist.gov
Quick Quiz: Check Yourself
Three levels, fresh numbers every time, instant feedback with the working.
Was this article helpful?
Your feedback helps us write better content
Frequently Asked Questions
What is a z test?
What is the formula for a z test?
When should you use a z-test instead of a t-test?
What is a z-test for proportions?
What does the z value mean?
