Standard deviation explained with a worked example

An average on its own can hide a lot. Two classes can both have a mean test mark of 60, and yet in one class everybody scored between 55 and 65, while in the other half the class scored 30 and half scored 90. Standard deviation is the number that tells those two situations apart. It measures how far values typically sit from their mean. This guide explains it in plain language, walks through a full calculation with eight numbers, shows the difference between the population and sample versions, and gives you ways to interpret the result.

What standard deviation tells you

Standard deviation is a measure of spread. A small standard deviation means the values cluster tightly around the mean. A large one means they are scattered. It is expressed in the same unit as the data, so if you are measuring heights in centimetres, the standard deviation is also in centimetres.

A helpful way to think about it is as a typical distance from the mean. It is not exactly the average distance, because of how it is calculated, but it gives a similar idea. If the mean height of a group is 170 cm and the standard deviation is 7 cm, then most people are within about 7 cm of 170 cm, either side.

The measure is used well beyond school maths: in quality control, test scores, investment returns, weather data and scientific experiments. It lets you compare how consistent two sets of figures are, even when their means differ.

A worked example with eight numbers

Take this data set: 2, 4, 4, 4, 5, 5, 7, 9. There are eight values. The first step is to find the mean. Add them up: 2 plus 4 plus 4 plus 4 plus 5 plus 5 plus 7 plus 9 is 40. Divide by 8 and the mean is 5.

The second step is to find each value's deviation from the mean, which is the value minus 5. These are minus 3, minus 1, minus 1, minus 1, 0, 0, 2 and 4. The third step is to square each deviation, which removes the minus signs and gives extra weight to values far from the mean. The squares are 9, 1, 1, 1, 0, 0, 4 and 16.

The fourth step is to add the squares: 9 plus 1 plus 1 plus 1 plus 0 plus 0 plus 4 plus 16 is 32. This total is called the sum of squares. The fifth step is to divide it by the number of values to get the variance. 32 divided by 8 is 4. The final step is to take the square root of the variance. The square root of 4 is 2. The standard deviation is 2.

Population or sample: divide by n or n minus 1

There are two versions of the formula, and the only difference is the divisor. If your data is the whole group you care about, such as every pupil in a class of eight, you use the population standard deviation and divide by n, the number of values. That is what we did above.

If your data is a sample taken from a larger group, you divide by n minus 1 instead. This is the sample standard deviation. The reason is that a sample tends to underestimate the spread of the whole group, and dividing by a slightly smaller number corrects for that. For the same eight numbers, 32 divided by 7 is 4.571, and its square root is 2.138. So the sample standard deviation is 2.14, to two decimal places, compared with 2 for the population version.

The difference matters most with small data sets. With 8 values, the two answers differ by about 7 per cent. With 1,000 values, they are almost identical. If you are unsure which to use, ask whether your data is everything or just a sample. Surveys and experiments are samples. A full register is a population.

Reading the result: the 68, 95 and 99.7 rule

If data follows the familiar bell-shaped normal distribution, the standard deviation has a simple interpretation. About 68 per cent of values fall within one standard deviation of the mean, about 95 per cent fall within two, and about 99.7 per cent fall within three.

Suppose the mean adult male height in a survey is 175 cm with a standard deviation of 7 cm. Then roughly 68 per cent of men are between 168 cm and 182 cm, and about 95 per cent are between 161 cm and 189 cm. A person at 196 cm is three standard deviations above the mean, which is unusual.

This rule only works if the data is roughly bell-shaped. For skewed data, such as incomes or house prices, a few very large values drag the mean and inflate the standard deviation, and the rule gives misleading answers. In that case, check the shape of the data first.

Comparing two groups

Imagine two shops that each sell an average of 100 items a day. Shop A sells 98, 99, 100, 101 and 102. Shop B sells 60, 80, 100, 120 and 140. Both have a mean of 100. Shop A has a population standard deviation of 1.41, and Shop B has one of 28.28. The averages match, but Shop B is far less predictable.

This is useful when you plan stock, staffing or budgets. A shop with a small spread can order close to the average. A shop with a large spread needs a buffer, or it will run out on some days and have too much on others.

When you compare standard deviations, make sure the units and the scale are similar. A standard deviation of 5 is large for a dataset with a mean of 10 but tiny for a mean of 10,000. The coefficient of variation, which is the standard deviation divided by the mean, puts different scales on a common footing. For Shop B it is 28.28 divided by 100, which is 0.28, or 28 per cent.

Common mistakes

The first mistake is forgetting to square the deviations. If you add the raw deviations, they always cancel out to zero, because the mean is the balance point of the data. Squaring is what stops that.

The second is choosing the wrong divisor. A calculator or spreadsheet might offer both versions, and picking the wrong one gives a small but real error. Check which version your course, report or software expects.

The third is treating outliers as an annoyance and ignoring them. A single extreme value has a big effect on the standard deviation because it is squared. If you have an unusual value, check whether it is a typing error. If it is genuine, report the standard deviation with and without it, so the reader can see its effect.

A final tip is to keep extra decimal places during the working and round at the end. Rounding the mean or the variance too early can change the last digit of the answer.

Standard deviation, variance and range

The range is the highest value minus the lowest. It is easy to calculate but depends on only two numbers, so one unusual value can distort it. In our eight-number example, the range is 9 minus 2, which is 7.

Variance is the average squared deviation. It is useful in theory because variances add up neatly, but its units are squared, so it is harder to picture. Standard deviation is the square root of the variance and goes back to the original units.

For describing a data set to other people, use the mean and the standard deviation together, for example a mean of 5 with a standard deviation of 2. If the data is skewed, use the median and the range or interquartile range instead.

Tools mentioned in this guide

Frequently asked questions

What is a good standard deviation?

There is no universal good value. It depends on the data and what you need. A small value means the data is consistent, which is good for a manufactured part, and a large one means it varies, which may be fine for something like daily footfall.

Can standard deviation be negative?

No. It is the square root of the variance, which is a sum of squares, so it is always zero or positive. It is zero only when every value is identical.

Should I use n or n minus 1?

Use n if your data is the whole population, and n minus 1 if it is a sample from a bigger group. For the numbers 2, 4, 4, 4, 5, 5, 7, 9 the results are 2 and 2.14.

What does a standard deviation of zero mean?

It means every value is the same as the mean, so there is no spread at all. For example 7, 7, 7, 7 has a standard deviation of zero.

Is standard deviation the same as the average deviation?

No. The average deviation uses absolute differences from the mean. Standard deviation squares the differences first, so it gives extra weight to values far from the mean and is usually a little larger.