All Tools

Z-Score Calculator from a Data Set

Work out the z-score of a value against the mean and standard deviation of your data, with both the population and the sample SD, free in your browser.

Separate numbers with commas, spaces or new lines.

Z-score

z with the population SD
2
z with the sample SD
1.87082869339

z = (x − mean) / SD.

Standard deviation

Population standard deviation (σ, divide by n)
2
Sample standard deviation (s, divide by n − 1)
2.1380899353

Sum of squared deviations Σ(x − mean)² = 32 over n = 8 values.

Variance

Population variance (σ², divide by n)
4
Sample variance (s², divide by n − 1)
4.57142857143

Sum of squared deviations Σ(x − mean)² = 32 over n = 8 values.

Quartiles and IQR

First quartile (Q1)
4
Third quartile (Q3)
6
Interquartile range (IQR = Q3 − Q1)
2

Exclusive median method (TI-84): Q1 and Q3 are the medians of the lower and upper halves, leaving out the median itself when the count is odd. Spreadsheet functions such as Excel's QUARTILE.INC may give different values.

Summary

Count (n)
8
Sum
40
Mean
5
Median
4.5
Mode
4
Minimum
2
Maximum
9
Range
7

Deviations from the mean

xx − mean(x − mean)²
2-39
4-11
4-11
4-11
500
500
724
9416

Z-Score Calculator

This page opens with the z-score first. Paste a data set, type a value x, and the calculator shows how many standard deviations x lies from the mean. It gives the z-score with both the population and the sample standard deviation, and below it the standard deviation, variance, quartiles and a summary of the data. The example data 2, 4, 4, 4, 5, 5, 7, 9 and x = 9 are filled in so the answer shows straight away.

The z-score formula

z=x−xˉσz = \frac{x - \bar{x}}{\sigma}

The numerator is the distance from the mean and the denominator is the standard deviation, so the z-score is distance measured in standard deviations. A positive z-score is above the mean, a negative one below it, and 0 is exactly the mean.

How to use it

Steps

  1. Put your numbers in Data set, separated by commas, spaces or new lines.
  2. Type the number you want to compare in Value x. It does not have to be one of the data values.
  3. Read the two z-scores: one uses the population standard deviation and one the sample standard deviation.

Worked example

x = 9 in 2, 4, 4, 4, 5, 5, 7, 9

The mean is 5 and the population standard deviation is 2, so z = (9 − 5) / 2 = 2. With the sample standard deviation of 2.1380899353, z = 4 / 2.1380899353 = 1.87082869339. Either way, 9 sits about two standard deviations above the mean.

Reading a z-score

For data shaped roughly like a bell curve, about 68% of values have a z-score between -1 and 1, about 95% between -2 and 2 and about 99.7% between -3 and 3. A value with a z-score beyond ±2 is unusual, and beyond ±3 it is often treated as an outlier. Z-scores also let you compare values from different scales, such as a test score and a race time.

When the z-score is undefined

If every value in the data set is the same, the standard deviation is 0 and the z-score would divide by zero. The page then says "Undefined: the standard deviation is 0" instead of showing a number. With a single value the sample standard deviation is missing, so that z-score reads "Needs at least 2 values".

Privacy

Nothing is uploaded; every calculation runs in your browser and never leaves your device.

Related tools

The Standard Deviation Calculator opens the same tool with the spread first, and the Quartile Calculator puts the quartiles first. The Number List Calculator gives a plain summary of a list.

Frequently asked questions

What is a z-score?

A z-score says how many standard deviations a value lies above or below the mean: z = (x − mean) / SD. A z-score of 2 means the value is two standard deviations above the mean, and a negative z-score means it is below the mean.

Should I use the population or the sample standard deviation?

Use the population SD when your data are the whole group and the sample SD when they are a sample from a larger group. The page shows both: for 2, 4, 4, 4, 5, 5, 7, 9 and x = 9 they give 2 and 1.87082869339.

Why is the z-score undefined?

When every value is the same, the standard deviation is 0 and dividing by it is impossible. The page then reads 'Undefined: the standard deviation is 0' instead of a number.

Can x be a value that is not in the data set?

Yes. x can be any number between -1e150 and 1e150, and it does not have to appear in the list. The mean and standard deviation always come from the data set.

What counts as an unusual z-score?

For data that are roughly bell-shaped, about 95% of values have a z-score between -2 and 2, so values beyond ±2 are often treated as unusual and beyond ±3 as outliers.

Other related tools