Z-Score Calculator Formula

Understand the math behind the z-score calculator. Each variable explained with a worked example.

Formulas Used

Z-Score

z_score = (x - mu) / sigma

Absolute Distance (in SDs)

abs_z = abs((x - mu) / sigma)

Raw Deviation

raw_deviation = x - mu

Variables

VariableDescriptionDefault
xValue (x)85
muMean (mu)70
sigmaStandard Deviation (sigma)10

How It Works

How to Calculate a Z-Score

Formula

Z = (X - mu) / sigma

The z-score expresses how far a data point is from the population mean in units of standard deviations. A positive z-score means the value is above the mean; a negative z-score means below. Z-scores allow comparison across different scales and distributions.

Worked Example

A student scores 85 on a test where the class mean is 70 and SD is 10.

x = 85mu = 70sigma = 10
  1. 01Z = (X - mu) / sigma
  2. 02Z = (85 - 70) / 10
  3. 03Z = 15 / 10 = 1.5
  4. 04The score is 1.5 standard deviations above the mean

When to Use This Formula

  • Determining how unusual a data point is relative to its distribution — a z-score of 2.5 means the value is 2.5 standard deviations above the mean, which is in roughly the top 0.6%.
  • Comparing scores from different scales — converting SAT and ACT scores to z-scores lets you compare students fairly even though the tests have different scoring systems.
  • Looking up probabilities in a standard normal table — the z-score is the input needed to find the cumulative probability (area under the curve) for any normally distributed variable.
  • Identifying outliers in a dataset by flagging any observation with |z| > 2 or |z| > 3 as potentially anomalous.
  • Standardizing variables before running machine learning algorithms that are sensitive to feature scale, such as k-nearest neighbors, SVM, or principal component analysis.
  • Performing hypothesis tests where the test statistic is a z-score — for example, testing whether a sample mean differs significantly from a known population mean when σ is known.

Common Mistakes to Avoid

  • Using the sample standard deviation when the population standard deviation is known (or vice versa) — the z-score formula uses σ (population). When σ is unknown and estimated from a sample, the appropriate statistic is a t-score, not a z-score.
  • Applying z-scores to non-normal distributions and interpreting probabilities as if the data were normal — the empirical rule (68-95-99.7%) only applies to normally distributed data. For skewed distributions, z-scores still measure distance from the mean but the probability interpretation breaks down.
  • Confusing the z-score of a single observation with the z-score of a sample mean — for a sample mean, the denominator is the standard error (σ/√n), not σ. Using σ alone understates how unusual the sample mean is.
  • Reversing the subtraction — z = (x - μ)/σ, not (μ - x)/σ. Reversing the order flips the sign, which changes the direction of the conclusion.

Frequently Asked Questions

What is a "good" z-score?

It depends on context. In testing, z > 0 means above average. A z-score beyond 2 or -2 is unusual (roughly top/bottom 2.5%). Beyond 3 or -3 is very rare (about 0.1%).

Can z-scores be used with non-normal data?

You can always compute a z-score, but its probabilistic interpretation (using normal tables) is only valid when the data is approximately normally distributed.

How do I convert a z-score back to the original value?

Use X = mu + Z * sigma. For example, z = 1.5 with mean 70 and SD 10 gives X = 70 + 1.5*10 = 85.

Learn More

Guide

Understanding the Normal Distribution

Learn what the normal distribution is, why it matters in statistics, and how to use the bell curve for probability calculations, z-scores, and real-world data analysis.

Ready to run the numbers?

Open Z-Score Calculator