Standard deviation measures how spread out a set of numbers is around the mean — but there are two slightly different formulas, and using the wrong one introduces a small but systematic bias.
The difference: n vs. n − 1
Population standard deviation divides by n (the total count) — use this only when your data represents an entire population, not a sample drawn from a larger group. Sample standard deviation divides by n − 1 instead (known as Bessel's correction), which corrects for the fact that a sample tends to underestimate the true variability of the full population.
Worked example
For the data set 2, 4, 4, 4, 5, 5, 7, 9 (mean = 5, variance using n−1 = 4.571): the population standard deviation is exactly 2, while the sample standard deviation is slightly higher, about 2.138 — the sample formula always gives an equal or larger result than the population formula for the same data.
Which one should you use?
If your numbers are the entire group you care about (every student in one specific class, every day in a specific month), use population. If your numbers are a sample meant to represent a larger group (a survey of 200 people representing a country), use sample — this is the more common case in practice, which is why most statistical software defaults to it.
Common mistakes
- Using the population formula on sample data, which understates the true variability — a frequent error in introductory statistics.
- Assuming the two formulas give meaningfully different results for very large data sets — the gap between n and n−1 shrinks to negligible as the sample size grows.
Calculate both the sample and population standard deviation, plus the mean and variance, with the Standard Deviation Calculator.