The z-score formula
z = (x − μ) ÷ σ
Subtract the mean, then divide by the standard deviation. The result expresses the value's position relative to the mean in standard-deviation units rather than in the original units, which makes values from different scales comparable in terms of their distance from their respective means.
- Positive — above the mean.
- Negative — below it.
- Zero — exactly at the mean.
- Magnitude — how far, in standard deviations.
A z-score cannot be calculated when the standard deviation is zero, because there is no spread against which to measure the value.
Sample or population? It changes the answer
When the standard deviation comes from data rather than being given, you have to choose a divisor, and the two are not interchangeable.
Population: σ = √(Σ(x − μ)² ÷ n)Sample: s = √(Σ(x − x̄)² ÷ (n − 1))
For the data 2, 4, 4, 4, 5, 5, 7, 9 the population standard deviation is exactly 2, and the sample standard deviation is about 2.138 — a 7% difference, and every z-score moves with it. The difference shrinks as the data set grows, but for a finite sample the two divisors still give different results.
Which to use: divide by n when your data is the entire population you care about, and by n − 1 when it is a sample used to estimate the spread of a larger population. The sample mean is calculated from the same observations, which tends to make their measured spread smaller. Using n − 1 corrects this bias in the variance estimate under standard sampling assumptions. It is the usual choice for estimating population variability from a sample.
The calculator shows both so the choice is visible rather than hidden.
Comparing things measured differently
This is where z-scores earn their keep. A score of 1850 on a test with mean 1500 and standard deviation 300 is z = 1.17. A 28 on a test with mean 21 and standard deviation 5 is z = 1.40. The raw numbers cannot be compared — 1850 and 28 are not on the same measuring stick — but the z-scores can, and the second score is farther above its mean relative to its standard deviation.
What counts as an unusual z-score
| |z| | Meaning | How often |
|---|---|---|
| Under 1 | Within one standard deviation | 68.27% |
| 1 to 2 | Between one and two standard deviations | 27.18% |
| 2 to 3 | Between two and three standard deviations | 4.28% |
| Over 3 | More than three standard deviations from the mean | 0.27% (about 1 in 370) |
These frequencies assume the data follows a normal distribution. A z-score can be calculated for data from any distribution, provided its standard deviation is greater than zero, but the frequency estimates above only apply to normally distributed data. In a heavily skewed distribution, for example, a z-score of 2 may be less unusual than the normal-distribution figures suggest.
Turning a z-score into a probability
The z-score says how far out a value is; converting that to a percentile or a tail probability is the next step, and the normal distribution calculator does it — including the reverse, from a percentile back to a value.
Frequently asked questions
How do you calculate a z-score?
Subtract the mean from the value, then divide by the standard deviation: z = (x − μ) ÷ σ. For x = 115 with a mean of 100 and a standard deviation of 15, z = 15 ÷ 15 = 1 — exactly one standard deviation above the mean.
Should I divide by n or n − 1?
By n when the data is the whole population you care about, and by n − 1 when it is a sample representing something larger — the usual choice when estimating population variability from a sample. The two give different standard deviations and therefore different z-scores, so the choice has to be made deliberately.
Can a z-score be negative?
Yes — it simply means the value is below the mean. The sign is the direction and the magnitude is the distance, so −2 and +2 are equally far out, on opposite sides.
What is a good z-score?
There is no universally good value — it depends entirely on what is being measured and which direction is favourable. A high z-score is excellent for an exam result. The z-score tells you how unusual something is, not whether it is good.