How to Calculate Z-Score
What Is a Z-Score?
A z-score (also called a standard score) measures how many standard deviations a data point lies above or below the mean of its distribution. A z-score of 0 means the value equals the mean, a positive z-score means the value is above the mean, and a negative z-score means the value is below the mean. Z-scores allow you to compare values from different datasets that may have different units or scales.
The Z-Score Formula
The z-score formula is: z = (x - μ) / σ, where x is the raw data value, μ (mu) is the population mean, and σ (sigma) is the population standard deviation. For sample data, you substitute the sample mean x̄ and sample standard deviation s. The result z tells you the relative position of x within the distribution.
Step-by-Step Calculation
Step 1: Find the mean of your dataset by summing all values and dividing by the count. Step 2: Calculate the standard deviation — find each value's squared deviation from the mean, average those squared deviations (for population) or divide by n−1 (for sample), then take the square root. Step 3: Subtract the mean from your data point x, then divide that result by the standard deviation. The quotient is your z-score.
Worked Example
Suppose a class has a mean test score of 72 and a standard deviation of 8. A student scored 88. The z-score is z = (88 − 72) / 8 = 16 / 8 = 2.0. This means the student scored 2 standard deviations above the class average. Another student who scored 60 would have z = (60 − 72) / 8 = −1.5, placing them 1.5 standard deviations below the mean.
Interpreting Z-Scores
In a standard normal distribution, approximately 68% of values fall within z = ±1, about 95% within z = ±2, and 99.7% within z = ±3 — this is the empirical rule. A z-score beyond ±2 is often considered unusual, and beyond ±3 is considered an outlier in many applications. You can look up a z-score in a standard normal table to find the corresponding percentile rank.
Common Applications
Z-scores are used in hypothesis testing to determine whether a sample mean differs significantly from a population mean. They are used in quality control to detect defects and in finance to measure how far an asset's return deviates from its historical average. In education and psychology, z-scores standardize test results so scores from different instruments can be compared directly.
Population vs. Sample Z-Scores
When you know the true population parameters μ and σ, use the standard formula. When working with a sample and only estimates of the parameters are available, the calculation is identical in form but uses the sample mean and sample standard deviation. For small samples (typically n < 30) where the population standard deviation is unknown, a t-score is more appropriate than a z-score.