How to Calculate Standard Deviation (Sample and Population)
Standard deviation measures how spread out numbers are around their mean. To calculate it, find the mean, square each value's distance from the mean, average those squares and take the square root. For 2, 4, 4, 4, 5, 5, 7 and 9, the population standard deviation is exactly 2 and the sample standard deviation is 2.14.
Step by step
Data: 2, 4, 4, 4, 5, 5, 7, 9 (8 values).
- Mean: the sum is 40, so the mean is 40 ÷ 8 = 5. The mean calculator gives this.
- Distances from the mean: −3, −1, −1, −1, 0, 0, 2, 4.
- Square them: 9, 1, 1, 1, 0, 0, 4, 16.
- Add the squares: 32.
- Divide to get the variance (see the next section).
- Take the square root to get the standard deviation.
Population or sample?
- Population: your data includes every member of the group you care about. Divide by n. Variance = 32 ÷ 8 = 4, so the standard deviation is √4 = 2.
- Sample: your data is a sample from a bigger group. Divide by n − 1 to correct for the sample's tendency to underestimate spread. Variance = 32 ÷ 7 = 4.57, so the standard deviation is √4.57 = 2.14.
The population standard deviation calculator and the sample standard deviation calculator apply the right divisor. The sample variance calculator stops at the variance.
What the number means
A small standard deviation means values sit close to the mean; a large one means they are spread out. For data that roughly follows a bell curve:
- About 68% of values fall within 1 standard deviation of the mean.
- About 95% fall within 2.
- About 99.7% fall within 3.
Comparing spread between data sets
When means are very different, compare the coefficient of variation, the standard deviation divided by the mean. The coefficient of variation calculator gives it as a percentage.
Spreadsheet formulas
- =STDEV.S(range) for a sample
- =STDEV.P(range) for a population
- =VAR.S and =VAR.P for the variances
Most real-world data, such as survey responses or test results from some students, is a sample, so STDEV.S is usually the right choice.
Questions and answers
Why divide by n minus 1 for a sample?
A sample tends to be less spread out than the whole population. Dividing by n minus 1 corrects that bias in the variance.
What is the difference between variance and standard deviation?
Standard deviation is the square root of the variance. It is in the same units as the data, which makes it easier to interpret.