Sarah scores 70 out of 100. Is that good? It depends on the class. If the average was 60, she did well. If the average was 85, she did badly. A raw score means little until you compare it with the group. A z score does exactly that: it tells you how far a value sits from the average, counted in standard deviations.
It is one of the simplest and most used tools in data science. Analysts use it to compare values measured on different scales, to find outliers, to scale features before a model, and to turn a normal curve question into a table lookup.
This tutorial explains what a z score is, how to read positive and negative values, the formula, a fully worked example with the answer, how to find percentiles and work backwards, how to spot outliers, and how to calculate z scores in Python.
A z score, also called a standard score, shows how many standard deviations a data point lies from the mean of its group.

The size of z matters, not just its sign. A z of 2.4 and a z of minus 2.4 are equally far from the mean, on opposite sides.
The live page says that a z score comes under probability. It is calculated as part of descriptive statistics, where it is a way of standardizing data. It enters probability when you read the area under the normal curve for a z value.

In symbols, for a population: z = (x minus mu) divided by sigma. For a sample: z = (x minus x bar) divided by s.

The live page: Sarah scored 70 out of 100. The class mean was 60 and the standard deviation was 15. How many students scored higher or lower? The page does not answer. Here is the full solution.
If the marks follow a normal distribution, about 74.75 percent of the class scored lower than Sarah, and about 25.25 percent scored higher. The normal assumption matters. Without it, the z score still tells you the distance from the mean, but the percentage may be different.
You can turn a z score back into a raw score: x = mean plus z times standard deviation.
Exam A: the mean is 70, the standard deviation is 8, and a student scores 82. Exam B: the mean is 500, the standard deviation is 100, and a student scores 640.
| Point | Exam A | Exam B |
|---|---|---|
| Score | 82 | 640 |
| Z score | 1.5 | 1.4 |
The 82 is slightly stronger, at 1.5 standard deviations above its mean against 1.4. This is the main use of z scores: putting different scales on one ruler.
Eight students scored 55, 60, 65, 70, 48, 72, 80 and 58. The mean is 63.5. The population standard deviation is 9.644, and the sample standard deviation is 10.309. Their z scores, using the population standard deviation, are:
| Mark | 55 | 60 | 65 | 70 | 48 | 72 | 80 | 58 |
|---|---|---|---|---|---|---|---|---|
| Z score | Minus 0.88 | Minus 0.36 | 0.16 | 0.67 | Minus 1.61 | 0.88 | 1.71 | Minus 0.57 |
Two things to notice. The z scores are negative for marks below the mean, and the 80 stands out most, at 1.71. And after standardizing, the z scores have a mean of 0 and a standard deviation of 1. Check the code below.
Population or sample? If your data are the whole group, divide by the population standard deviation. If they are a sample, the sample version, with n minus 1, is usually used. The z scores change a little. Python’s stats.zscore uses the population version unless you set ddof to 1.
A common rule marks a value as an outlier if its z score is above 3 or below minus 3. For normal data, only about 0.27 percent of values lie that far out. In my test, I made 49 normal values with a mean of 60 and a standard deviation of 15, and added one extreme value, 140. Its z score was 4.18, and it was the only value with an absolute z score above 3.
A warning: an outlier raises the standard deviation, which makes its own z score smaller. In small data sets, extreme values can hide. Also, for skewed data, the rule of three can flag too many or too few points.
| Z score | Area to the left | Meaning |
|---|---|---|
| Minus 2 | 0.0228 | Lowest 2.3 percent |
| Minus 1 | 0.1587 | Lowest 15.9 percent |
| 0 | 0.5000 | The median |
| 1 | 0.8413 | Top 15.9 percent |
| 1.645 | 0.9500 | 95th percentile |
| 1.96 | 0.9750 | Used for 95 percent intervals |
| 2.576 | 0.9950 | Used for 99 percent intervals |
I ran the code below, and the output is real.
| Mistake | Fix |
|---|---|
| Dividing by the variance | Divide by the standard deviation |
| Forgetting the sign | A negative z means below the mean |
| Subtracting in the wrong order | Value minus mean, not mean minus value |
| Using a z table for non normal data without a check | Percentages need a roughly normal shape |
| Mixing population and sample standard deviation | State which one you used |
| Comparing raw scores from different exams | Compare z scores |
| Calling every large z an error | A large z flags a value to check, not a mistake |
| Writing the formula only as an image | Put it in text as well |
Answers: 1) (68 minus 50) divided by 10 = 1.8. 2) 80 + (minus 1.5) times 12 = 62. 3) Exam A, since 2 is higher than 1.2. 4) Yes, it is beyond minus 3, so check it. These are my own answers, so please recheck them before publishing.
A z score takes a raw number and gives it context: how far from the average, in which direction and in units that work everywhere. Learn the formula, remember that the sign gives the direction, and you can compare almost anything.