All resources

Resources · Education

Z Score Formula

A z score (also called a standard score) tells you how many standard deviations a value sits from the mean of its data set. It puts every value on a single standardized scale, so scores from different distributions can be compared cleanly. For a fast computed answer with the worked steps shown, the z score calculator takes a raw score, mean, and standard deviation and returns the z score with a step-by-step breakdown.

7 min read

What is a z score?

A z score expresses a raw value in units of standard deviations away from the mean. It is sometimes called a standard score because the result lives on the same standardized scale no matter what data set the original value came from. Two values with very different raw sizes can both have a z score of, say, +1.5, and that tells you they sit the same distance above their respective means in standardized terms.

That is the practical point of a z score: it strips out the units and the scale of the original data and leaves behind a comparable measure of position relative to the mean.

The z score formula

The formula has three pieces: the raw score, the mean, and the standard deviation. Subtract the mean from the raw score, then divide by the standard deviation.

The z score formula

z = (x − μ) / σ

The parts

  • x = raw score (the value you want to standardize)
  • μ = mean of the data set
  • σ = standard deviation of the data set
  • z = resulting z score, in standard deviations

The numerator x − μ is the raw deviation of the value from the mean, in the original units. Dividing by σ converts that deviation into a count of standard deviations, which is what makes z scores comparable across data sets that use different units or scales.

How to calculate a z score step by step

The arithmetic is short. Two steps get you from the three inputs to the final z score.

  1. Subtract the mean from the raw score to get the deviation: x − μ.
  2. Divide that deviation by the standard deviation: (x − μ) / σ.

That is the whole formula. The interpretation is what carries the meaning: a positive result means the value is above the mean, a negative result means it is below, and a result of zero means it sits exactly at the mean.

What positive, negative, and zero z scores mean

The sign of the z score locates the value on one side of the mean or the other; the magnitude tells you how far.

  • Positive z score. The raw score is above the mean. A z score of +1 is one standard deviation above; +2 is two above; +0.5 is half a standard deviation above.
  • Negative z score. The raw score is below the mean. A z score of −1.5 sits one and a half standard deviations below the mean; −2 sits two below.
  • Zero. The raw score equals the mean exactly.

Under a normal distribution, roughly 68% of values fall within one standard deviation of the mean (z scores between −1 and +1) and roughly 95% fall within two (z scores between −2 and +2). A z score of +3 or more (or −3 or less) is unusually extreme under that assumption.

Simple z score example

Take a raw score of 85 from a data set with mean 75 and standard deviation 10.

  • z = (85 − 75) / 10
  • z = 10 / 10
  • z = 1

The z score is +1. In plain English: the value is one standard deviation above the mean. The same arithmetic runs in the z score calculator, which prints both worked steps with your numbers in place.

Test score example with a negative z score

Same class as the previous example, but a different student scored a raw 60. The class mean is still 75, the standard deviation is still 10.

  • z = (60 − 75) / 10
  • z = −15 / 10
  • z = −1.5

The z score is −1.5. In plain English: the value is one and a half standard deviations below the mean. Negative z scores are not bad on their own; the sign just says which side of the mean the value sits on.

Comparing two values with z scores

Z scores really earn their keep when you need to compare values that come from different distributions. Suppose two students take final exams in different courses:

  • Student A scored 85 in a class with mean 75 and standard deviation 10.
  • Student B scored 92 in a class with mean 80 and standard deviation 8.

Compute each z score:

  • Student A: z = (85 − 75) / 10 = +1.0
  • Student B: z = (92 − 80) / 8 = +1.5

Student B's raw score (92) is higher in absolute terms, and Student B also has the higher z score. Both pieces line up here, but the z score adds the context: Student A is one standard deviation above their class mean, while Student B is one and a half. If the two classes had the same mean but very different spreads, you could easily see two students with the same raw score but different z scores. The z score is what tells you how each performance compares to its own distribution.

Common z score mistakes

A few traps that catch people:

  • Flipping x and μ in the numerator. The formula is x − μ, not μ − x. The first gives a positive z score for values above the mean; the second flips the sign and reverses the meaning.
  • Dividing by the variance instead of the standard deviation. Variance is σ²; standard deviation is σ. They are easy to confuse, especially when both are reported on the same line. See the Variance vs Standard Deviation guide if it helps to keep them straight.
  • Using sample standard deviation when population was wanted, or vice versa. Pick the one that matches your context. The Standard Deviation Formula guide covers both versions.
  • Treating a large negative z score as automatically bad. The sign just locates the value below the mean. In contexts where lower is better (golf scores, error rates, response times), a negative z score is the desirable side.
  • Confusing z score with percent error. Z score uses the mean of a distribution as the reference; percent error uses a fixed accepted value. They look similar on paper but answer different questions. See the percent error calculator and the Percent Error Formula guide when the reference is a fixed accepted value.

When a z score cannot be calculated

The z score formula divides by the standard deviation, so it is undefined when σ = 0. Practically, σ = 0 would mean every value in the data set is identical, in which case the concept of a z score does not really apply: there is no spread to measure against. The z score calculator flags this case rather than printing a misleading number.

Standard deviation also cannot be negative. It is, by definition, a non-negative measure of spread. If a calculation produces a negative value, something has gone wrong upstream and the result should not be used in the z score formula. Compute σ from the data first using the standard deviation calculator, confirm it is positive, and only then standardize values against it.

Quick summary

  • Formula: z = (x − μ) / σ.
  • Subtract the mean from the raw score, then divide by the standard deviation.
  • Positive z score means the value is above the mean; negative means below; zero means equal to the mean.
  • Roughly 68% of values fall within one standard deviation of the mean (z between −1 and +1) under a normal distribution; roughly 95% fall within two.
  • Undefined when σ = 0. Standard deviation cannot be negative.
  • Compute σ first with the standard deviation calculator, then standardize values with the z score calculator.

Run the numbers

Three calculators that come up alongside z scores: the z score itself, the standard deviation that goes into it, and percent error for the case when the reference is a fixed accepted value rather than a mean.

Frequently asked questions

The z score formula is z = (x − μ) / σ. Subtract the mean μ from the raw score x to get the deviation, then divide by the standard deviation σ. The result is a unitless number that says how many standard deviations the value sits above (positive) or below (negative) the mean.

Two steps. First, subtract the mean from the raw score to get the deviation. Second, divide that deviation by the standard deviation. The result is the z score. Round it to a couple of decimal places when reporting.

A positive z score means the raw score is above the mean. The size of the z score tells you how far above. A z score of +1 is one standard deviation above the mean; a z score of +2 is two standard deviations above. Larger positive z scores are rarer if the data is approximately normally distributed.

A negative z score means the raw score is below the mean. A z score of −1.5 means the value sits one and a half standard deviations below the mean. The sign just locates the value on the lower side of the mean; whether that is good, bad, or neutral depends on what is being measured.

A z score of 0 means the raw score equals the mean exactly. The deviation in the numerator is zero, so the result of the formula is zero regardless of the standard deviation.

No. The standard deviation is a property of a data set: the typical distance of values from the mean, in the original units. A z score is a property of one specific value: how many standard deviations that value sits from the mean. Standard deviation is computed once for the whole data set; z scores are computed value by value, using that standard deviation as the unit of measure.

No. The formula divides by the standard deviation, so it is undefined when σ = 0. A standard deviation of zero would also mean every value in the data set is identical, in which case the concept of a z score does not really apply: there is no spread to measure against.

No. Standard deviation is a measure of spread and is always zero or positive by definition. If you compute a value and end up with a negative standard deviation, something has gone wrong in the calculation; revisit the steps before plugging it into the z score formula.