How spread out are your numbers?
Two data sets can share the same mean and look nothing alike. Test scores of 79, 80 and 81 and scores of 50, 80 and 110 both average 80, but the second set is far more spread out. Standard deviation puts a number on that spread. This calculator gives the population and sample standard deviation, the variance, the coefficient of variation and the standard error of the mean for up to eight values.
The formulas
- Mean: x̄ = sum of the values ÷ n.
- Sum of squares: SS = Σ(xᵢ − x̄)².
- Population variance: σ² = SS ÷ n, and population standard deviation σ = √σ².
- Sample variance: s² = SS ÷ (n − 1), and sample standard deviation s = √s².
- Coefficient of variation = s ÷ x̄. Standard error = s ÷ √n.
Worked example: 2, 4, 4, 4, 5, 5, 7, 9
- Mean: 40 ÷ 8 = 5.
- Deviations from the mean: −3, −1, −1, −1, 0, 0, 2, 4. Squared: 9, 1, 1, 1, 0, 0, 4, 16, which add up to 32.
- Population variance: 32 ÷ 8 = 4, so σ = 2.
- Sample variance: 32 ÷ 7 = 4.571, so s = 2.138.
- Coefficient of variation: 2.138 ÷ 5 = 42.76 percent. Standard error: 2.138 ÷ √8 = 0.756.
How one value changes the spread
| Last value | Mean | σ | s |
|---|---|---|---|
| 5 | 4.50 | 1.32 | 1.41 |
| 9 | 5.00 | 2.00 | 2.14 |
| 15 | 5.75 | 3.73 | 3.99 |
| 25 | 7.00 | 6.93 | 7.41 |
A single outlier can triple the standard deviation, which is why it pays to look at the data, not just the summary.
Population or sample?
Divide by n when the values are the entire group you want to describe: every employee of a small company, every game a team played this season. Divide by n − 1 when the values are a sample used to estimate a larger population: 8 bags of chips weighed from a production line of thousands. The n − 1 correction, named after Friedrich Bessel, compensates for the fact that a sample’s own mean is closer to its values than the true population mean would be. Spreadsheet functions follow the same split: STDEV.P for populations, STDEV.S for samples.
Interpreting the result
For data with a bell-shaped distribution, the 68-95-99.7 rule applies: about 68 percent of values fall within one standard deviation of the mean, 95 percent within two and 99.7 percent within three. If adult men’s heights in the US average 69 inches with a standard deviation of about 3 inches, roughly two thirds of men are between 66 and 72 inches tall.
The coefficient of variation compares spreads across data of different scales: a standard deviation of $2 on an average price of $10 (20 percent) is much larger, relatively, than $50 on an average of $1,000 (5 percent).
Standard error versus standard deviation
The standard deviation describes the spread of individual values. The standard error describes how precisely the sample mean estimates the true mean, and it shrinks as the sample grows: quadrupling the sample size halves it. Polls and scientific studies report margins of error based on it, typically about twice the standard error for 95 percent confidence.