Standard deviation is one of the most useful numbers in statistics, and it shows up everywhere: school marks, investment returns, quality control, sports stats. If you have ever wondered how to calculate standard deviation by hand, this guide walks you through the formula, the difference between population and sample standard deviation, and a complete worked example you can follow with a basic calculator.
What Is Standard Deviation?
Standard deviation measures how spread out a set of numbers is around its average (the mean). A small standard deviation means the values are clustered close to the mean. A large standard deviation means the values are more scattered.
For example, two classes can both have an average mark of 75%. In the first class, most students scored between 70% and 80%. In the second, marks range from 40% to 100%. The averages are identical, but the second class has a much higher standard deviation.
Because standard deviation is built on the mean, it helps to be comfortable with averages first. Our guide to mean, median and mode covers the basics.
The Standard Deviation Formula
There are two versions of the formula, depending on whether your data is a whole population or a sample.
Population standard deviation (σ)
Use this when your data includes every member of the group you care about (for example, the marks of every student in one class).
σ = √[ Σ(x − μ)² ÷ N ]
Sample standard deviation (s)
Use this when your data is a sample taken from a larger group (for example, 50 customers surveyed out of thousands).
s = √[ Σ(x − x̄)² ÷ (n − 1) ]
Where:
- x = each value in the data set
- μ or x̄ = the mean of the values
- N or n = the number of values
- Σ = “the sum of”
The only difference is the denominator: N for a population, n − 1 for a sample. Dividing by n − 1 (called Bessel’s correction) slightly increases the result to compensate for the fact that a sample tends to underestimate the true spread.
How to Calculate Standard Deviation Step by Step
- Step 1: Find the mean. Add all the values and divide by how many there are.
- Step 2: Subtract the mean from each value to get each deviation.
- Step 3: Square each deviation (this removes negative signs).
- Step 4: Add up all the squared deviations.
- Step 5: Divide by N (population) or n − 1 (sample). This result is the variance.
- Step 6: Take the square root of the variance. That is the standard deviation.
Worked Example
Let’s use this data set of 8 values: 2, 4, 4, 4, 5, 5, 7, 9.
Step 1 – Mean: 2 + 4 + 4 + 4 + 5 + 5 + 7 + 9 = 40. Then 40 ÷ 8 = 5.
Steps 2 and 3 – Deviations and squares:
| Value (x) | x − mean | (x − mean)² |
|---|---|---|
| 2 | −3 | 9 |
| 4 | −1 | 1 |
| 4 | −1 | 1 |
| 4 | −1 | 1 |
| 5 | 0 | 0 |
| 5 | 0 | 0 |
| 7 | 2 | 4 |
| 9 | 4 | 16 |
| Sum | 32 | |
Step 5 – Variance:
- Population: 32 ÷ 8 = 4
- Sample: 32 ÷ 7 ≈ 4.571
Step 6 – Standard deviation:
- Population: √4 = 2
- Sample: √4.571 ≈ 2.138
So, on average, the values sit about 2 units away from the mean of 5.
How to Interpret Standard Deviation
For data that follows a roughly bell-shaped (normal) distribution, a useful rule of thumb is the 68-95-99.7 rule:
- About 68% of values fall within 1 standard deviation of the mean.
- About 95% fall within 2 standard deviations.
- About 99.7% fall within 3 standard deviations.
If test scores have a mean of 70 and a standard deviation of 10, roughly two-thirds of students scored between 60 and 80. Standard deviation is also expressed in the same units as the data, which makes it easier to interpret than variance.
Standard Deviation in Everyday Life
- School: teachers use it to see whether a test separated students or whether everyone scored about the same.
- Investing: the standard deviation of returns is a common measure of volatility. Our sister site has practical guides on Canadian tax and money calculations if you want to go further with personal finance.
- Manufacturing: a low standard deviation in product measurements means consistent quality.
- Weather: it describes how much daily temperatures vary from the monthly average.
When some values matter more than others, a plain mean is not enough; see how to calculate a weighted average.
Common Mistakes to Avoid
- Using the population formula for a sample (or the reverse).
- Forgetting to square the deviations, which makes them add up to zero.
- Stopping at the variance and forgetting the square root.
- Rounding the mean too early, which introduces errors in every step.
FAQ: Standard Deviation
What is the difference between variance and standard deviation?
Variance is the average of the squared deviations. Standard deviation is the square root of the variance, so it is in the same units as the original data.
Can standard deviation be negative?
No. Because it comes from squared values and a square root, standard deviation is always zero or positive.
What does a standard deviation of 0 mean?
It means every value in the data set is identical, so there is no spread at all.
Should I use sample or population standard deviation?
Use the population formula only when you have data for the entire group. In most real-world surveys and studies, you are working with a sample, so use n − 1.