What is a z-score and how is it related to normal distribution?

Updated May 17, 2026

Short answer

A z-score (or standard score) measures how many standard deviations a data point is away from the mean of a distribution. It is calculated as (z = \frac{x-\mu}{\sigma}), where (x) is the observation, (\mu) is the mean, and (\sigma) is the standard deviation. In a normal distribution, z-scores allow values from different distributions to be compared on a common scale and help determine probabilities using the standard normal distribution.

Deep explanation

A z-score is a normalization technique that transforms an individual data value into a standardized value relative to the distribution it came from.

The formula is:

[ z = \frac{x-\mu}{\sigma} ]

Where:

  • (x) = observed value
  • (\mu) = population mean
  • (\sigma) = population standard deviation
  • (z) = number of standard deviations the value is away from the mean

The interpretation is:

  • A z-score of 0 means the value is exactly at the mean.
  • A positive z-score means the value is above the mean.
  • A negative z-score means the value is below the mean.
  • A z-score of 2 means the value is two standard deviations above the mean.
  • A z-score of -1.5 means the value is one and a half standard deviations below the mean.

Relationship with normal distribution

A normal distribution is a symmetric, bell-shaped probability distribution described by its mean and standard deviation. Many statistical techniques rely on the fact that values in a normal distribution follow predictable patterns.

When a normal distribution is converted into z-scores, it becomes the standard normal distribution, which has:

  • Mean = 0
  • Standard deviation = 1

The transformation is:

[ Z = \frac{X-\mu}{\sigma} ]

This allows statisticians to use a single reference distribution instead of calculating probabilities separately for every normal distribution.

For example, in a normal distribution:

  • About 68% of values fall between z-scores -1 and +1.
  • About 95% of values fall between z-scores -2 and +2.
  • About 99.7% of values fall between z-scores -3 and +3.

This is known as the empirical rule or the 68-95-99.7 rule.

Why z-scores are useful

Z-scores are useful because raw values often cannot be compared directly.

For example:

  • A score of 85 on a difficult exam may be more impressive than a score of 95 on an easy exam.
  • A transaction amount of $5,000 may be unusual for a small account but normal for a corporate account.

By converting values into z-scores, we compare their position relative to their own distributions.

Z-score and probability

For a normally distributed variable, the z-score can be used to calculate the probability of observing a value at or below a certain point.

For example:

[ P(X \leq x) = P(Z \leq z) ]

A z-score of 1.96 corresponds to approximately the 97.5th percentile. This means about 97.5% of normally distributed values are below that observation.

Sample vs population z-score

In practice, the population mean and standard deviation are often unknown. When working with sample data, estimates are used:

[ z = \frac{x-\bar{x}}{s} ]

Where:

  • (\bar{x}) = sample mean
  • (s) = sample standard deviation

For hypothesis testing involving small samples, a t-score is often preferred because the sample standard deviation introduces additional uncertainty.

Python example

Python
import scipy.stats as stats
value = 85
mean = 70
std_dev = 10
z_score = (value - mean) / std_dev
percentile = stats.norm.cdf(z_score)
print(z_score)
print(percentile)

Output:

TEXT
1.5
0.9332

The value is 1.5 standard deviations above the mean and is higher than approximately 93.3% of values in a normal distribution.

Real-world example

A data science team monitors server response times. Historically, response times are normally distributed with:

  • Mean response time: 200 ms
  • Standard deviation: 25 ms

A new request takes 275 ms.

The z-score is:

[ z = \frac{275-200}{25}=3 ]

The response time is 3 standard deviations above the normal response time. Since a z-score of 3 is unusually high in a normal distribution, the monitoring system may flag it as a potential performance issue.

A simple implementation:

Python
response_time = 275
average = 200
std_dev = 25
z = (response_time - average) / std_dev
if abs(z) > 3:
print("Potential anomaly detected")
else:
print("Response time is normal")

This type of z-score based anomaly detection is commonly used in monitoring systems, fraud detection, and quality control.

Common mistakes

  • * Assuming a z-score tells whether a value is "good" or "bad" instead of only describing its position relative to a distribution.
  • * Using z-scores when the underlying data is highly non-normal without considering whether the normality assumption is reasonable.
  • * Forgetting that a z-score depends on the mean and standard deviation of the specific distribution.
  • * Confusing a z-score with a percentile, since a z-score measures distance from the mean while a percentile measures relative rank.
  • * Using population standard deviation when working with a sample without understanding the impact on statistical inference.
  • * Assuming that every value beyond a z-score of 3 is automatically an error, because rare events can still be valid observations.

Follow-up questions

  • Why does converting a normal distribution into z-scores help with probability calculations?
  • What does a z-score of 2.5 mean in practical terms?
  • How are z-scores used for anomaly detection?
  • What is the difference between a z-score and a t-score?
  • Can z-scores be used for data that is not normally distributed?

More Statistics interview questions

View all →