How to calculate standard deviation
Standard deviation measures how spread out a set of numbers is around their mean. A small value means the data is tightly clustered; a large one means it is widely scattered. This calculator gives both the population and the sample standard deviation, because which one you need depends on your data.
The formula
Find the mean, then for each value square its distance from the mean, average those squared distances (that is the variance), and take the square root. Population divides by n; sample divides by n minus 1.
Worked example
For 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5. The population standard deviation is 2, and the sample standard deviation is about 2.14. The variance is simply the square of each.
Population vs sample
Use population when your numbers are the entire group you care about. Use sample when they are a subset used to estimate a larger population; dividing by n minus 1 corrects the slight bias that would otherwise creep in.
Frequently asked questions
What is the difference between population and sample standard deviation?
Population uses all the data and divides by n. Sample estimates a larger group from a subset and divides by n minus 1, giving a slightly larger, unbiased result.
How is standard deviation related to variance?
Variance is the average of the squared differences from the mean. Standard deviation is the square root of the variance, in the same units as your data.
Sample or population, which do I need?
Use sample if your numbers are a sample of a larger group (the usual case). Use population if they are the whole group.
What is variance?
Variance is the square of the standard deviation, the average of the squared differences from the mean.
Why divide by n minus 1?
For a sample, dividing by n minus 1 corrects a bias and gives a better estimate of the true population spread.