Two classes can share the same mean score of 70 while one has every student between 65 and 75 and the other swings from 30 to 100. The mean alone cannot tell those stories apart, so statistics needs a measure of spread. The standard deviation fills the gap: it is, roughly, the typical distance between a value and the mean. A small standard deviation means the values huddle close to the average. A large one means they are scattered widely. It is reported in the same units as the data, which is why it beat its older sibling, the variance, in everyday popularity. Spread is not a footnote to the average; for risk, quality and consistency, the spread is often the story itself, and two data sets with identical means can deserve opposite decisions.
Start with the mean. Subtract it from every value to get the deviations, then square each deviation, which removes the minus signs and punishes big misses more than small ones. Average the squared deviations, then take the square root to return to the original units. For the classic set 2, 4, 4, 4, 5, 5, 7, 9, the mean is 5, the squared deviations add to 32, and dividing by 8 gives a variance of 4, so the population standard deviation is exactly 2. Try it in the calculator below and you will get the same figures, which is a good way to check your own hand working. Squaring also has a quiet benefit: it makes the standard deviation the natural partner of the normal distribution, whose width it controls completely.
When your data is a sample from a larger population, dividing by n understates the true spread, because the sample mean sits closer to the sampled values than the real population mean does. Dividing by n minus 1 instead corrects that bias, and the result is called the sample standard deviation. The difference matters for small samples and fades as n grows. The rule of thumb is simple: if your numbers are the whole group you care about, divide by n; if they are a sample used to describe something bigger, divide by n minus 1. Most software and exam courses default to the sample version. The distinction sounds pedantic until a quality engineer and a researcher compare figures computed the two ways and argue over a gap that is nothing but this choice.
The free calculators that go with this guide:
Calculate variance and standard deviation