Skip to content
Omnikalc

One-sample z-test calculator

Enter the sample mean, the null mean, the known standard deviation and the sample size to get the z statistic, the p-value and the confidence interval.

Updated on
Your inputs

Value out of range

Value out of range

Value out of range

Value out of range

Results

z statistic

1.414

p-value
0.1573
Not significant at your α: the null hypothesis is not rejected
Standard error of the mean
2.121
Confidence interval of the mean, lower bound (1 − α)
98.84
Confidence interval of the mean, upper bound
107.16

Does a sample come from a population with the mean you expect? A one-sample z-test answers when the population standard deviation is known, as in quality control with a long record of measurements, or in standardized scales such as IQ. This calculator computes the z statistic, the p-value for the test you choose, and the confidence interval for the mean, and tells you whether the result is significant at your α.

How the calculation works

  • Standard error = σ ÷ √n
  • z = (sample mean − null mean) ÷ standard error
  • p-value, two-sided = 2 × (1 − Φ(|z|)), where Φ is the standard normal cumulative distribution
  • p-value, right-sided = 1 − Φ(z), and left-sided = Φ(z)
  • Confidence interval = sample mean ± z critical × standard error, with z critical = Φ⁻¹(1 − α/2)

The result is significant when the p-value is smaller than α.

Example

An IQ test is designed to have a mean of 100 and a standard deviation of 15. A sample of 50 students has a mean of 103. The standard error is 15 ÷ √50 = 2.12, so z = 3 ÷ 2.12 = 1.41. The two-sided p-value is 0.157, which is not significant at α = 0.05, so we cannot say the group differs from 100. The 95 % interval for the mean runs from about 98.8 to 107.2 and includes 100.

Why it matters

A difference between a sample mean and an expected value can be real, or it can be chance. The z-test puts that difference on a common scale (standard errors) and gives a probability, so that decisions about a process, a drug or a classroom are not made on gut feeling. The confidence interval adds the size of the effect, which the p-value alone cannot do.

Good to know

The z-test assumes a random sample, independent observations and either a normal population or a large sample. When the standard deviation is estimated from the sample, a t-test is more exact. A significant p-value does not prove that the effect is large or important, and a non-significant one does not prove there is no effect: look at the interval and at the sample size. Choose the type of test and α before looking at the data. This tool is for education.

The one-sample t-test calculator handles an unknown standard deviation, the z-score calculator standardizes a single value, and the confidence interval calculator gives intervals for means and proportions.

Frequently asked questions

When do I use a z-test instead of a t-test?

Use a z-test for a mean when the population standard deviation is known, or when the sample is large (about 30 or more) and the standard deviation is a stable estimate. When σ is unknown and the sample is small, a t-test is safer.

What is the formula for the z statistic?

z = (sample mean − null mean) ÷ (σ ÷ √n). It counts how many standard errors the sample mean is from the value in the null hypothesis. The p-value is the probability of a result at least that extreme if the null hypothesis were true.

What does the p-value tell me?

It is the chance of seeing a sample mean at least as far from the null value as yours, if the null hypothesis were true. A small p-value, below your α, is evidence against the null hypothesis. It is not the probability that the null hypothesis is true.

What are one-sided and two-sided tests?

A two-sided test looks for a difference in either direction and is the default. A one-sided test is for a prediction made before seeing the data, such as an increase only, and gives a p-value half the size when the direction matches.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.