How to Calculate Standard Deviation Step by Step
By the BrainSnail editorial team. How these articles are written and checked, and how to tell us when one is wrong.
Calculating standard deviation becomes easier when you see it as a measure of how spread out data is around its mean. The calculation finds typical squared distance from the mean and then converts that result back to the original units.
From a data set to a single number
Start by finding the arithmetic mean. Suppose your data values are 2, 4, 4, 6. Their total is 16, so the mean is 4. Next find each value's difference from the mean. The differences are -2, 0, 0, and 2. These differences show how far each observation lies above or below the centre.
If you simply added those differences, positive and negative values would cancel. That is why the calculation includes squaring each difference. The squared differences are 4, 0, 0, and 4. Their total is 8. The next step uses these squared distances to find the variance.
Variance comes before standard deviation
For a complete population, divide the sum of squared differences by the number of values. In this example, 8 divided by 4 gives a population variance of 2. Standard deviation is the square root of variance, so the population standard deviation is the square root of 2, which is about 1.41.
The reason for the final square root is useful to remember. Squaring the deviations created squared units. If the original data was measured in centimetres, the variance would involve square centimetres. Taking the square root returns standard deviation to centimetres. This connection helps make the calculation feel less like an arbitrary sequence of buttons.
Samples use a slightly different calculation
If your data is a sample being used to estimate variation in a larger population, the usual sample variance formula divides by n minus 1 instead of n. This adjustment helps correct the tendency of a sample to underestimate the population's variability. Your course or calculator may therefore distinguish population standard deviation from sample standard deviation.
When calculating standard deviation, first check which version the question expects. Then keep the stages organised: mean, deviations, squared deviations, variance, square root. A smaller standard deviation means values are generally clustered more closely around the mean. A larger standard deviation means they are more spread out, although the shape of the data still matters.
A sample calculation, and what the number tells you
Take the same data, 2, 4, 4, 6, but now treat it as a sample from a larger population. The mean is still 4 and the squared deviations still sum to 8, but you divide by n minus 1, which is 3, giving a sample variance of 2.67 and a sample standard deviation of about 1.63. The sample figure is larger, which is the point: four observations cannot reveal the full spread of the population they came from, so the formula compensates.
Interpreting the result is the other half of the skill. For data that is roughly bell-shaped, about two thirds of the values sit within one standard deviation of the mean and about 95 percent within two. A test score of 85 with a class mean of 70 and a standard deviation of 5 is exceptional; the same score with a standard deviation of 15 is merely good. The number only means something next to the mean it was measured from.
How one outlier can distort the result
Because standard deviation squares every deviation, large deviations count for far more than small ones. Return to the data 2, 4, 4, 6, which has a population standard deviation of about 1.41, and add one unusual value, 24. The mean jumps to 8. The deviations become -6, -4, -4, -2 and 16, and their squares are 36, 16, 16, 4 and 256. The single outlier contributes 256 of the 328 total, and the population standard deviation rises to about 8.1, nearly six times larger than before.
That sensitivity is useful when unusual values genuinely matter, but it can mislead when they come from a typing error or a rare one-off event. In those situations statisticians often report the median with the interquartile range, the spread of the middle half of the data, which barely moves when one extreme value is added. A good habit is to plot the data before trusting any summary. A quick dot plot or box plot shows at a glance whether one point is doing most of the work in your standard deviation.
A quicker formula and what happens when data is rescaled
There is a second way to calculate the variance that is often quicker with a calculator: find the mean of the squares, then subtract the square of the mean. For 2, 4, 4 and 6, the squares are 4, 16, 16 and 36, which total 72, so their mean is 18. The mean of the data is 4, and 4 squared is 16. Subtracting gives 18 minus 16, which is 2, the same population variance as before. This version is handy when data arrives as running totals, but rounding the mean too early can make the answer noticeably wrong.
It also helps to know how standard deviation reacts when data is changed. Adding the same amount to every value moves the mean but leaves the spread untouched, so 12, 14, 14 and 16 still have a population standard deviation of about 1.41. Multiplying every value by a number multiplies the standard deviation by that number too. If the data were temperatures in degrees Celsius, converting to Fahrenheit means multiplying by 1.8 and adding 32, so the standard deviation becomes about 2.55 degrees Fahrenheit. The added 32 makes no difference, because shifting every value equally changes none of the distances.
Why square at all? Standard deviation against mean absolute deviation
A natural alternative is to ignore the signs instead of squaring. For 2, 4, 4 and 6, the distances from the mean are 2, 0, 0 and 2, and their average, called the mean absolute deviation, is 1. That is easier to explain than 1.41, so why is standard deviation the standard? Part of the answer is history. Karl Pearson coined the term standard deviation in the 1890s, and in 1920 the statistician Ronald Fisher showed that, for data following a normal distribution, it estimates spread from a sample more precisely than the absolute version does.
The bigger reason is that squared spreads combine neatly. When independent quantities are added, their variances add too, which is not true of absolute deviations. Roll one fair die and the variance of the score is about 2.92. Roll two and add them, and the variance of the total is twice that, about 5.83, giving a standard deviation of about 2.42. This rule lets statisticians predict the spread of totals and averages without listing every possible outcome, which is why variance sits underneath so much of statistics, from survey margins of error to quality control in factories.
The takeaway
Calculating standard deviation is a step-by-step process for measuring spread. Find the mean, calculate each deviation, square those deviations, find the appropriate variance, and take its square root. Also check whether the question treats your data as a whole population or as a sample from something larger.