Standard Deviation Calculator (Sample and Population)
Standard deviation measures how spread out numbers are around their mean. For 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5 and the squared deviations add up to 32, giving a population standard deviation of √(32 ÷ 8) = 2 and a sample standard deviation of √(32 ÷ 7) = 2.138.
Use sample when your numbers are a selection from a larger group, which is most real-world data.
Separate values with commas, spaces or new lines. You can paste a column from a spreadsheet.
Standard deviation (s)
2.1381
Variance (s²)
4.5714
Mean
5
Count
8
Deviations from the mean
| Value | − mean | Squared |
|---|---|---|
| 2 | -3 | 9 |
| 4 | -1 | 1 |
| 4 | -1 | 1 |
| 4 | -1 | 1 |
| 5 | 0 | 0 |
| 5 | 0 | 0 |
| 7 | 2 | 4 |
| 9 | 4 | 16 |
Show the math
- 1
Find the mean
(2, 4, 4, 4, 5, 5, 7, 9) ÷ 8 = 5
= mean = 5
Read the steps as text
- Find the mean. (2, 4, 4, 4, 5, 5, 7, 9) ÷ 8 = 5
- Square each value's distance from the mean. (2 − 5)² = 9 · (4 − 5)² = 1 · (4 − 5)² = 1 · (4 − 5)² = 1 · (5 − 5)² = 0 · (5 − 5)² = 0 · (7 − 5)² = 4 · (9 − 5)² = 16 Squaring makes every distance positive, so values above and below the mean don't cancel out.
- Add the squares. Sum of squares = 32
- Variance = sum of squares ÷ (n − 1). 32 ÷ 7 = 4.5714 Dividing by n − 1 (Bessel's correction) stops a sample from underestimating the spread of the whole population.
- Standard deviation = √variance. √4.5714 = 2.1381 Taking the square root puts the spread back in the same units as the data.
How standard deviation is calculated
First find the mean. Then, for every value, subtract the mean and square the result; squaring makes every distance positive so values above and below the mean don't cancel out. Add up those squares, divide by the number of values (or one less, for a sample) to get the variance, and take the square root to get the standard deviation.
Because of the square root, the standard deviation is in the same units as your data. A small standard deviation means the values cluster tightly around the mean; a large one means they're widely spread.
Sample or population?
Use the population formula (divide by n) when your data includes every member of the group you care about, like the test scores of everyone in one class. Use the sample formula (divide by n − 1) when your data is a sample used to estimate a larger group, such as a survey of 500 voters. Most real-world data is a sample.
Dividing by n − 1, known as Bessel's correction, makes the result slightly larger. A sample tends to sit closer to its own mean than to the true population mean, so dividing by n would systematically underestimate the spread.
Frequently asked questions
- What's the difference between variance and standard deviation?
- Variance is the average squared distance from the mean; standard deviation is its square root. Standard deviation is easier to interpret because it's in the same units as the data.
- When should I use the sample standard deviation?
- Whenever your numbers are a subset of a larger group you want to describe, which covers most experiments and surveys. Use population only when you have every value in the group.
- What does the standard deviation tell me about a normal distribution?
- For normally distributed data, about 68% of values fall within one standard deviation of the mean, 95% within two and 99.7% within three.
- Can the standard deviation be zero?
- Yes, when every value is the same. It can never be negative.