The formula
Mean: x̄ = Σx ÷ n
Sum of squares: SS = Σ(x − x̄)²
Sample variance: s² = SS ÷ (n − 1); population variance: σ² = SS ÷ N
Standard deviation = √variance
Standard error of the mean = s ÷ √n; z = (x − x̄) ÷ s; CV = s ÷ x̄ × 100%
Worked example
- Data: 12, 15, 11, 18, 14, 16, 13, 17, 15, 19 (n = 10).
- Mean = 150 ÷ 10 = 15.
- Sum of squared deviations = 9 + 0 + 16 + 9 + 1 + 1 + 4 + 4 + 0 + 16 = 60.
- Sample variance = 60 ÷ 9 = 6.667, so sample SD = √6.667 = 2.582.
- Population variance = 60 ÷ 10 = 6, so population SD = 2.449.
What standard deviation tells you
Standard deviation measures how spread out numbers are around their mean. A small standard deviation means most values are close to the average, while a large one means they're widely scattered. Two classes could both average 70% on a test, but if one class's scores have a standard deviation of 5 and the other's 15, the second class has far more variation. Standard deviation is in the same units as the data, which makes it easier to interpret than variance, which is in squared units.
Sample or population?
Use the population formula, dividing by N, only when your data includes every member of the group you care about, such as the heights of all players on one team. In most real situations the data is a sample from a larger group, and you use it to estimate the spread of the whole group. Then you divide by n − 1, known as Bessel's correction, because a sample's values are on average slightly closer to their own mean than to the true population mean. Dividing by n would underestimate the spread. Spreadsheet functions STDEV.S and STDEV.P give the sample and population versions.
Calculating it by hand
First find the mean. Then subtract the mean from each value to get its deviation, and square each deviation so negative and positive deviations don't cancel out. Add the squares to get the sum of squares, divide by n − 1 for a sample or N for a population to get the variance, and take the square root to get the standard deviation. The table in the calculator shows every step, which is useful for checking homework or exam answers.
The 68–95–99.7 rule
For data that follows a roughly normal, bell-shaped distribution, about 68% of values fall within one standard deviation of the mean, about 95% within two and about 99.7% within three. So if adult male height has a mean of 175 cm and a standard deviation of 7 cm, about 95% of men are between 161 cm and 189 cm. A value's z-score tells you how many standard deviations it is from the mean; values with z-scores beyond ±3 are unusual and worth checking as possible errors or outliers.
Standard error and coefficient of variation
The standard error of the mean, s ÷ √n, measures how precisely the sample mean estimates the population mean. It shrinks as the sample grows, which is why larger studies give more precise results; it's the basis of confidence intervals and of tests such as our A/B test significance calculator. The coefficient of variation expresses the standard deviation as a percentage of the mean, which lets you compare the spread of data measured on different scales, such as the variability of share prices with very different values.
Outliers and robust measures
Because deviations are squared, a single extreme value can inflate the standard deviation a lot. For skewed data, such as incomes or house prices, the median and interquartile range describe the typical value and spread more robustly.
Uses in everyday life
Standard deviation is used to measure investment risk (the volatility of returns), quality control in manufacturing, where processes aim for outputs within a set number of standard deviations of the target, weather and climate statistics, exam grading and sports performance analysis. To plan how much data you need to collect for a survey, see our sample size calculator, and to report the precision of a poll, use the margin of error calculator.