What a z-score is
A z-score says how many standard deviations a value lies from the mean. It turns a measurement in any unit into a position on one common scale, which is what lets you compare a test mark with a height or a blood-pressure reading.
z = (x − μ) ÷ σ
x = μ + z × σ
Here x is the value, μ (mu) is the mean of the distribution and σ (sigma) is its standard deviation, which must be greater than zero. A positive z means the value is above the mean, a negative z means it is below, and z = 0 is exactly at the mean. The second formula is the first one rearranged, for when you know z and want the value.
Area to the left of z = Φ(z) Area to the right = 1 − Φ(z) Area between a and b = Φ(b) − Φ(a)
Φ (capital phi) is the cumulative distribution function of the standard normal curve: the proportion of a normally distributed population that falls below z. Multiplied by 100 it is the percentile. The total area under the curve is 1.
Worked example by hand
Exam marks have a mean of 70 and a standard deviation of 8. A student scores 82.
- Distance from the mean. 82 − 70 = 12 marks.
- In standard deviations. z = 12 ÷ 8 = 1.5. The mark is one and a half standard deviations above the mean.
- Area to the left. From a normal table, Φ(1.5) = 0.9332. If marks are normally distributed, the student did better than about 93.3% of the group: the 93rd percentile.
- Area to the right. 1 − 0.9332 = 0.0668, so about 6.7% scored higher.
- Within and outside. The area between z = −1.5 and z = 1.5 is 1 − 2 × 0.0668 = 0.8664, and the area outside that band is 0.1336.
Between two values. What share of students score between 62 and 82? The z-scores are (62 − 70) ÷ 8 = −1 and 1.5. Φ(1.5) − Φ(−1) = 0.9332 − 0.1587 = 0.7745, or about 77%.
Going backwards. A z-score of −0.5 corresponds to a mark of 70 + (−0.5) × 8 = 66. The mark needed to reach the 90th percentile has z = 1.2816, so it is 70 + 1.2816 × 8 = 80.25.
Z-scores worth remembering
| z | Area to the left | What it is used for |
|---|---|---|
| −2 | 0.0228 | Two standard deviations below the mean |
| −1 | 0.1587 | One standard deviation below |
| 0 | 0.5 | The mean, and the median |
| 1 | 0.8413 | One standard deviation above |
| 1.645 | 0.95 | 95th percentile; 90% two-sided confidence |
| 1.96 | 0.975 | 95% two-sided confidence |
| 2 | 0.9772 | Two standard deviations above |
| 2.576 | 0.995 | 99% two-sided confidence |
| 3 | 0.9987 | Three standard deviations above |
These give the familiar rule of thumb: 68.27% of a normal population lies within one standard deviation of the mean, 95.45% within two and 99.73% within three. Only about 1 value in 370 falls more than three standard deviations away, which is why |z| > 3 is a common flag for an unusual observation.
Using z-scores properly
Comparing results on different scales
Is 82 on the exam above better than 640 on a test with mean 500 and standard deviation 100? The second z-score is (640 − 500) ÷ 100 = 1.4. Since 1.5 is larger than 1.4, the 82 is the stronger result relative to its own group, even though the raw numbers cannot be compared directly.
The percentile is only right if the data is normal
The z-score itself is plain arithmetic and is valid for any data. The areas and percentiles are not: they assume a bell-shaped distribution. For skewed quantities such as income, waiting times or house prices, a z of 1.5 does not correspond to the 93rd percentile. Check the shape of the data before quoting a percentage.
A z-score for an average needs the standard error
The formula above is for a single value. To ask how unusual a sample mean is, divide by the standard error, σ ÷ √n, instead of σ. With σ = 8 and a class of 16 students, the standard error is 8 ÷ 4 = 2, so a class average of 73 has z = (73 − 70) ÷ 2 = 1.5, the same z as one student scoring 82. Averages vary much less than individuals.
Sample or population figures
Strictly, μ and σ describe the whole population. If you only have a sample mean and sample standard deviation, the result is an estimate, and for small samples a t-distribution describes the uncertainty better than the normal curve. The confidence interval calculator handles that case.
How the areas are calculated
There is no simple formula for Φ, so it has to be computed numerically. For |z| below 3 this calculator sums the power series for the normal integral until further terms no longer change the answer; from 3 outwards it uses a continued-fraction expansion of the tail, which stays accurate where the tail area is tiny. Both agree with published 15-figure tables to at least 12 significant figures, far more than the four decimal places of a printed table. For the reverse step, from a percentile to z, it uses Acklam’s rational approximation and then one correction step, which gives z correct to at least 9 decimal places.