Standard deviation measures how far the values in a data set typically sit from the mean. A small standard deviation means the values cluster tightly, and a large one means they are spread out.
The formulas
There are two versions. Which one you use depends on whether your data is an entire population or a sample drawn from a larger one.
Here Σ means "add up", x is each value, μ or x̄ is the mean, and N or n is the number of values. The only difference is the divisor: N for a population, n − 1 for a sample.
Step by step
- Find the mean.
- Subtract the mean from each value to get the deviations.
- Square each deviation.
- Add the squared deviations.
- Divide by N (population) or n − 1 (sample). This result is the variance.
- Take the square root.
Worked example 1
Data: 2, 4, 4, 4, 5, 5, 7, 9.
The sum is 40 and there are 8 values, so the mean is 5.
| Value | Deviation (x − 5) | 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 |
The squared deviations add up to 32.
- As a population: variance = 32 ÷ 8 = 4, so σ = √4 = 2.
- As a sample: variance = 32 ÷ 7 ≈ 4.571, so s ≈ 2.138.
Worked example 2
Five students are sampled from a large class. Their scores are 70, 75, 80, 85, 90.
- Mean: 400 ÷ 5 = 80.
- Deviations: −10, −5, 0, 5, 10.
- Squares: 100, 25, 0, 25, 100.
- Sum: 250.
- Sample variance: 250 ÷ 4 = 62.5.
- Sample standard deviation: √62.5 ≈ 7.91.
If those five students were the whole class, you would divide by 5 instead: variance 50, standard deviation √50 ≈ 7.07. For longer lists, the standard deviation calculator reports both versions along with the variance.
Population or sample?
- Use the population formula when you have every member of the group you care about: all 30 students in one class, every game in a finished season.
- Use the sample formula when your data is a subset used to estimate a larger group: 500 voters surveyed out of millions, 20 parts tested from a production run.
Why n − 1? A sample's values tend to sit closer to their own mean than to the true population mean, so dividing by n would underestimate the spread on average. Dividing by n − 1, known as Bessel's correction, compensates. The difference matters for small samples and fades as n grows. When in doubt, the sample formula is the usual default.
Interpreting the result
Standard deviation is in the same units as the data, which makes it easier to read than variance. For data that follows a bell-shaped (normal) distribution, the empirical rule applies:
- About 68% of values fall within 1 standard deviation of the mean.
- About 95% fall within 2.
- About 99.7% fall within 3.
If test scores have a mean of 100 and a standard deviation of 15, roughly 68% of scores lie between 85 and 115, and roughly 95% lie between 70 and 130.
A z-score states how many standard deviations a value is from the mean: z = (x − mean) ÷ standard deviation. A score of 130 in that example has z = (130 − 100) ÷ 15 = 2.
Common mistakes
- Forgetting the square root. Stopping at step 5 gives the variance, which is in squared units.
- Using the wrong divisor. Many spreadsheet and calculator functions come in pairs, one for each formula. Check which one you are using.
- Adding deviations without squaring. The raw deviations always sum to zero, as −3 −1 −1 −1 + 0 + 0 + 2 + 4 does above. Squaring is what removes the signs.
- Squaring the sum instead of summing the squares. Square each deviation individually, then add.
- Comparing spreads across different scales. A standard deviation of 5 is large for values near 10 and tiny for values near 10,000. Divide by the mean to compare relative spread.
- Applying the 68-95-99.7 rule to skewed data. It only holds for roughly normal distributions.
Standard deviation is always reported alongside a measure of center. The mean, median and mode calculator gives you that half of the summary.
Run the numbers yourself
Common questions
What is the difference between population and sample standard deviation?
The population formula divides the sum of squared deviations by N, while the sample formula divides by n − 1. Use the sample version when your data is a subset of a larger group.
What does a high standard deviation mean?
It means the values are widely spread around the mean. A low standard deviation means most values are close to the mean.
How is variance related to standard deviation?
Variance is the average squared deviation from the mean, and standard deviation is its square root. Standard deviation is easier to interpret because it is in the same units as the data.