One-Sample Z-Test Calculator

Published on: November 26, 2026
Final Answer: Free | Full Steps: Pro

This One-Sample Z-Test Calculator tests whether a sample mean is different from a claimed population mean, and shows the working line by line. It sets up the two hypotheses, finds the standard error and works out how many standard errors the sample mean is from the claimed mean. The table then gives the p-value, which is compared with the significance level to decide whether to reject the null hypothesis. The same pattern works for two-tailed, left-tailed and right-tailed tests.

Step-by-step method

  1. Set up the hypotheses.
  2. Write the formula.
  3. Find the standard error.
  4. Substitute the values into the formula.
  5. Work out the test statistic z.
  6. Find the p-value.
  7. Compare the p-value with the significance level.
  8. Show the test on the normal curve.

Formula: Z-Test Statistic Formula

This formula measures how many standard errors the sample mean is from the mean in the null hypothesis. Take the null mean away from the sample mean, then divide by the standard error.

\(z = \frac{\bar{x} - \mu_{0}}{\sigma / \sqrt{n}}\)

Useful Tips to Remember

The test statistic is \(z = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}}\). State the null and alternative hypotheses before calculating anything. If the p-value is less than the significance level, reject the null hypothesis. Failing to reject it does not prove it is true. The z-test needs the population standard deviation to be known.

Required knowledge

Where Is the One-Sample Z-Test Used?

A one-sample z-test checks whether a sample mean is significantly different from a claimed population mean when the population standard deviation is known. It answers questions such as whether a machine is filling bottles with the right amount, or whether a new teaching method has changed average test scores. Factories use it in quality control, researchers use it to test claims, and businesses use it to check whether a change has really made a difference rather than happening by chance. The p-value shows how strong the evidence is.

  • Checking whether a machine fills packets to the stated weight
  • Testing whether a new teaching method changed average scores
  • Verifying claims about average battery life or fuel use
  • Monitoring production quality against a target
  • Testing whether average waiting times have changed

One-Sample Z-Test Practice Problems

Example 1 tests \(\bar{x} = 52\) against \(\mu_0 = 50\) at the 5% level, and Example 2 tests \(\bar{x} = 48.5\) at the 1% level. Try finding the z-value and the decision yourself first. For two more free worked examples, check out the One-Sample Z-Test Notes.

The worked examples below go through the same pattern from start to finish, so you can compare every step with your own working. For more practice, the notes page goes further with extra worked examples and fuller explanations of the ideas behind each step. Use them together to check your answers and to understand why each step works.

See Example 1 Hide Example 1

Problem

\(\bar{x} = 52,\; \mu_{0} = 50,\; \sigma = 8,\; n = 64,\; \alpha = 0.05\)

Approach

Step-by-step method

  1. Set up the hypotheses.
  2. Write the formula.
  3. Find the standard error.
  4. Substitute the values into the formula.
  5. Work out the test statistic z.
  6. Find the p-value.
  7. Compare the p-value with the significance level.
  8. Show the test on the normal curve.

Formula

Formula: Z-Test Statistic Formula

This formula measures how many standard errors the sample mean is from the mean in the null hypothesis. Take the null mean away from the sample mean, then divide by the standard error.

\(z = \frac{\bar{x} - \mu_{0}}{\sigma / \sqrt{n}}\)

Step 1

Step 1 - Set up the hypotheses.

In this problem: The null hypothesis says the true mean is \(50\). The alternative says it is different from \(50\).

\(H_{0}: \mu = 50 \qquad H_{1}: \mu \neq 50\)

Step 2

Step 2 - Write the formula.

In this problem: The test statistic measures how many standard errors the sample mean is from the null mean.

\(z = \frac{\bar{x} - \mu_{0}}{\sigma / \sqrt{n}}\)

Step 3

Step 3 - Find the standard error.

In this problem: Dividing the standard deviation by the square root of the sample size gives \(SE = 1\).

\(\frac{\sigma}{\sqrt{n}} = \frac{8}{\sqrt{64}} = 1\)

Step 4

Step 4 - Substitute the values into the formula.

In this problem: Replacing \(\bar{x}\) with \(52\), \(\mu_{0}\) with \(50\) and the standard error with \(1\) gives \(z = \frac{52 - 50}{1}\).

\(z = \frac{52 - 50}{1}\)

Step 5

Step 5 - Work out the test statistic z.

In this problem: Taking the null mean away gives \(2\), and dividing by \(1\) gives \(z = 2\).

\(z = \frac{52 - 50}{1} = 2\)

Step 6

Step 6 - Find the p-value.

In this problem: For a two-tailed test the p-value counts both tails, so the area beyond \(2\) is doubled. The table gives \(p \approx 0.0456\).

\(p = 2 \times P(Z > 2) = 2 \times 0.0228 \approx 0.0456\)

Step 7

Step 7 - Compare the p-value with the significance level.

In this problem: The p-value is not bigger than \(\alpha = 0.05\), so the result is significant and the null hypothesis is rejected.

\(0.0456 \le 0.05 \Rightarrow \text{Reject } H_{0}\)

Step 8

Step 8 - Show the test on the normal curve.

In this problem: The shaded tails are the rejection region for \(\alpha = 0.05\), beyond \(\pm 1.96\). The test statistic falls inside it.

Standard normal curve with the rejection region and the test statistic

Final Answer

\(z = 2,\; p \approx 0.0456,\; \text{Reject } H_{0}\)
See Example 2 Hide Example 2

Problem

\(\bar{x} = 48.5,\; \mu_{0} = 50,\; \sigma = 8,\; n = 64,\; \alpha = 0.01\)

Approach

Step-by-step method

  1. Set up the hypotheses.
  2. Write the formula.
  3. Find the standard error.
  4. Substitute the values into the formula.
  5. Work out the test statistic z.
  6. Find the p-value.
  7. Compare the p-value with the significance level.
  8. Show the test on the normal curve.

Formula

Formula: Z-Test Statistic Formula

This formula measures how many standard errors the sample mean is from the mean in the null hypothesis. Take the null mean away from the sample mean, then divide by the standard error.

\(z = \frac{\bar{x} - \mu_{0}}{\sigma / \sqrt{n}}\)

Step 1

Step 1 - Set up the hypotheses.

In this problem: The null hypothesis says the true mean is \(50\). The alternative says it is less than \(50\).

\(H_{0}: \mu = 50 \qquad H_{1}: \mu < 50\)

Step 2

Step 2 - Write the formula.

In this problem: The test statistic measures how many standard errors the sample mean is from the null mean.

\(z = \frac{\bar{x} - \mu_{0}}{\sigma / \sqrt{n}}\)

Step 3

Step 3 - Find the standard error.

In this problem: Dividing the standard deviation by the square root of the sample size gives \(SE = 1\).

\(\frac{\sigma}{\sqrt{n}} = \frac{8}{\sqrt{64}} = 1\)

Step 4

Step 4 - Substitute the values into the formula.

In this problem: Replacing \(\bar{x}\) with \(48.5\), \(\mu_{0}\) with \(50\) and the standard error with \(1\) gives \(z = \frac{48.5 - 50}{1}\).

\(z = \frac{48.5 - 50}{1}\)

Step 5

Step 5 - Work out the test statistic z.

In this problem: Taking the null mean away gives \(-1.5\), and dividing by \(1\) gives \(z = -1.5\).

\(z = \frac{48.5 - 50}{1} = -1.5\)

Step 6

Step 6 - Find the p-value.

In this problem: For a left-tailed test the p-value is the area to the left of z. The table gives \(p \approx 0.0668\).

\(p = P(Z < -1.5) \approx 0.0668\)

Step 7

Step 7 - Compare the p-value with the significance level.

In this problem: The p-value is bigger than \(\alpha = 0.01\), so the result is not significant and the null hypothesis is not rejected.

\(0.0668 > 0.01 \Rightarrow \text{Do not reject } H_{0}\)

Step 8

Step 8 - Show the test on the normal curve.

In this problem: The shaded tail is the rejection region for \(\alpha = 0.01\), beyond \(-2.33\). The test statistic falls outside it.

Standard normal curve with the rejection region and the test statistic

Final Answer

\(z = -1.5,\; p \approx 0.0668,\; \text{Do not reject } H_{0}\)

Notes and Practice Mode

Example Problems

Click one to load it into the box and solve it.