Standard deviation formulas
Sample: s = √(Σ(x − x̄)² / (n − 1))
Population: σ = √(Σ(x − μ)² / n)
These are the ordinary textbook definitions (descriptive statistics). No proprietary smoothing or robust estimators are applied.
Standard deviation in practice
Manufacturing: shaft diameters in millimeters
Five shafts measure 10.02, 9.98, 10.01, 9.99, and 10.00 mm. Mean = 50.00 ÷ 5 = 10.00. Deviations: +0.02, −0.02, +0.01, −0.01, 0. Squares: 0.0004, 0.0004, 0.0001, 0.0001, 0, with a total of 0.001. If these five are a sample from a production run, sample variance = 0.001 ÷ 4 = 0.00025 and s = 0.0158 mm. If they are the entire batch, population variance = 0.001 ÷ 5 = 0.0002 and σ = 0.0141 mm.
Class test scores: same mean, different spread
Class A scored 60, 70, 80, 90, 100. Class B scored 78, 79, 80, 81, 82. Both means are 80. For A, deviations are −20, −10, 0, 10, 20 and the squares total 1,000, so sample variance = 1,000 ÷ 4 = 250 and s = 15.81. For B, the squares are 4, 1, 0, 1, 4 = 10, so variance = 10 ÷ 4 = 2.5 and s = 1.58. The mean hides the fact that A is ten times more spread out.
Monthly investment returns: measuring volatility
Six monthly returns: 4%, −2%, 6%, 0%, 2%, 2%. Sum = 12, mean = 2%. Deviations: 2, −4, 4, −2, 0, 0. Squares: 4, 16, 16, 4, 0, 0 = 40. Sample variance = 40 ÷ 5 = 8, so s = 2.83 percentage points. Roughly speaking, a typical month lands within about 2.83 points of the 2% average, though real returns are rarely perfectly bell-shaped.
Population versus sample: how much it matters
Suppose the sum of squared deviations is 40. The divisor (n or n − 1) matters a lot for small lists and barely at all for large ones.
| n | Population SD (÷ n) | Sample SD (÷ n − 1) |
|---|---|---|
| 4 | 3.162 | 3.651 |
| 10 | 2.000 | 2.108 |
| 50 | 0.894 | 0.904 |
Common mistakes
- Using population SD on a sample. It underestimates the true spread, especially with fewer than about 30 values.
- Forgetting the square root. Variance is in squared units; the standard deviation is back in the original units.
- Squaring the average deviation. Deviations must be squared individually before summing, otherwise they cancel out to zero.
- Applying the 68-95-99.7 rule to skewed data. It only holds for roughly bell-shaped distributions.
- Computing SD of a single value. With n = 1 a sample SD is undefined (division by zero).
When to use this vs related tools
Use the standard deviation calculator when you need spread, consistency, or volatility. For the center of the data, use the average calculator or the mean, median, and mode calculator. For a refresher on percentages used when comparing spread to the mean, see the guide on how to calculate percentages. More tools are in the math calculators hub.