Calculators
Home › Calculators › One-Sample z-Test

One-Sample z-Test Calculator

For the one situation the t-test is not needed: σ truly known.

Run a one-sample z-test

The σ you enter must come from outside this sample: a calibrated process, a test's design.

Quick answer: z = (x̄ − μ₀) ÷ (σ ÷ √n). Example: z = 2.12, p = 0.0339. If your σ came from the sample itself, use the t-test instead. That is the honest choice.

The z-test's one strict requirement

The one-sample z-test compares a sample mean with a hypothesised μ₀, exactly like the t-test, with one difference that decides everything: it demands the population standard deviation σ, known, not estimated from your sample. That knowledge removes the extra uncertainty the t distribution exists to model, so the statistic is read on the normal curve instead.

One-sample z statisticz = (x̄ − μ₀) ÷ (σ ÷ √n)
Worked example

The bakery data (mean 44.5, n = 8) against μ₀ = 40, with a genuinely known σ = 6 from years of records: z = 4.5 ÷ (6 ÷ √8) = 2.1213, two-tailed p = 0.0339. Reject at 0.05, but only just. Compare the t-test on the same numbers (p = 0.0316, because its estimated s happened to come out below 6): the tests answer the same question with different information, and their p-values are not obliged to match.

When σ is honestly "known"

Watch out

Plugging the sample SD into the σ box on a small sample. That is not a z-test; it is a t-test wearing a costume, and its p-values are too small. If σ came from the same data you are testing, use the t-test.

Frequently asked questions

Why does the z-test give a different p from the t-test on the same data?

Because they use different denominators and different curves. z trusts the supplied σ completely; t prices in the uncertainty of estimating s. Both are correct, given their own assumptions.

How large must n be before z is fine with an estimated SD?

There is no bright line; the t and z answers converge as n grows and are nearly identical by n ≈ 100. Below that, t is the honest choice.