STATISTICS CALCULATOR

Z Test Calculator

Run a one-sample z-test comparing a sample mean against a known population mean, with the p-value.

Reviewed by the Calculator.nu math team
Updated August 2026
z statistic
2.3479
Two-tailed p-value
0.0189
Standard error
1.7889

The formula

z = (sample mean − population mean) ÷÷ √n)
# requires a known population standard deviation

How to calculate z test

A one-sample z-test compares a sample mean against a known population value. It requires the population standard deviation to be known, which in practice means large samples or well-characterised measurements.

The statistic expresses the difference in units of standard error. A z of 2.35 means the sample mean sits 2.35 standard errors above the population mean, which is unlikely under the null hypothesis.

The inputs, one by one:

  • Sample mean
  • Population mean
  • Population standard deviation
  • Sample size

The result updates on every keystroke. The URL updates too, which makes the filled-in version easy to bookmark or send to someone else.

Where more decimal places matter than the fields above display, the underlying calculation is not rounded until the final figure is shown — the precision used internally is higher than what is printed, which matters for anyone chaining this result into a further calculation of their own.

Why z test matters

The formula behind z test is standard and appears in the same form across textbooks and reference material; what a calculator adds is speed and the ability to see instantly how the result responds to a change in any one of the inputs, which is far slower to do by hand.

It is useful for checking a manual calculation before submitting or acting on it, and equally useful for building intuition about a formula by adjusting one input at a time and watching how the result moves in response — a much faster way to understand a relationship than working through several versions of the algebra by hand.

It is worth remembering that a formula is only ever as good as the assumptions built into it, and most of the standard equations used across science and statistics carry at least one simplifying assumption — a linear approximation, an idealised gas, a normally distributed error term — that holds well in most ordinary cases and breaks down at the extremes. The result here reflects the standard formula exactly; whether that formula's assumptions are appropriate for your particular situation is a separate judgement worth making deliberately rather than assuming automatically.

In practice, a formula like this one is most often reached for at the exact moment a manual calculation needs checking against a deadline — a lab report due, a problem set to submit — which is precisely the situation where a small arithmetic slip is easiest to miss and most costly to leave uncorrected. Running the same inputs through an independent calculator catches that class of error reliably.

Worked example

Here is the calculation with the starting values:

  • Sample mean: 74.2
  • Population mean: 70
  • Population standard deviation: 12
  • Sample size: 45

That gives:

  • z statistic: 2.3479
  • Two-tailed p-value: 0.0189
  • Standard error: 1.7889

The figures above are the calculator's own default values, shown purely so the working is visible rather than hidden — the same steps apply exactly to your own numbers, entered in the fields at the top of this page.

Reading the result

Values beyond ±1.96 are significant at the 5% level, beyond ±2.58 at the 1% level. Those thresholds come directly from the normal distribution and do not depend on sample size, unlike the t-test.

Where this goes wrong. If the population standard deviation is unknown and estimated from the sample, a t-test is the correct choice. With samples above about 30 the two converge, but the z-test is technically wrong.

A result that is wrong by an exact factor of ten, a hundred or a similar round number is almost always a units error rather than a mistake in the formula itself — checking each input against the unit stated beside it is the fastest way to track it down.

When the population standard deviation is genuinely known, or the sample is very large. In practice this is rare outside quality control and standardised testing, so the t-test is the usual choice.

A z-score locates a single observation relative to a distribution. A z-test locates a sample mean relative to a hypothesised population mean, dividing by standard error rather than standard deviation.

It returns z statistic. With 74.2 sample mean, 70 population mean and 12 population standard deviation, that comes to 2.3479. Change any field and the figure moves with it.

Generally, no more than the least precise input justifies — a result reported to six decimal places from inputs measured to two significant figures is implying a precision the calculation does not actually have. The calculator shows full precision so you can round appropriately for your own use.

Yes — the equation shown in the formula section above is the standard form used in textbooks and reference material for this calculation, not a simplified or approximate version.

Yes, in the sense that it applies the correct standard formula and returns an accurate result for the inputs given — but check your own course or publication's requirements for how results should be rounded, presented and referenced, since those conventions vary and are not something a calculator can know on your behalf.

Was this calculator helpful?

Tap a star to rate it. Your feedback helps us improve the tools people rely on most.