TL;DR: Calculating standard deviation takes five steps: (1) find the mean, (2) subtract the mean from each value, (3) square each result, (4) average the squares to get the variance, (5) take the square root. For the numbers 3, 5, 7, 9, 11, the mean is 7 and the population standard deviation is 2.83.
Standard deviation looks intimidating the first time you see the formula, but the calculation itself is just five simple steps, each one using only basic arithmetic. You add, subtract, multiply and take one square root — nothing more. This guide walks through the steps in order, then works a full example you can check line by line. If you would rather skip the hand calculation, our free Standard Deviation Calculator does the same five steps instantly.
The five steps
Here is the whole method at a glance. Every standard deviation calculation, however large the data set, follows this same pattern.
- Find the mean. Add up all the values and divide by how many there are.
- Find the deviations. Subtract the mean from each value. Values above the mean give positive deviations, values below it give negative ones.
- Square each deviation. Multiply each deviation by itself. This turns every value positive so the spread cannot cancel itself out.
- Average the squared deviations. Add the squares up and divide by the number of values (or by one less, for a sample — see below). This result is called the variance.
- Take the square root. The square root of the variance is the standard deviation, back in the same units as your original data.
Worked example: the numbers 3, 5, 7, 9, 11
Let us calculate the standard deviation of five numbers: 3, 5, 7, 9, 11. They are evenly spaced, which keeps the arithmetic clean and easy to follow.
Step 1 — the mean. Add the values: 3 + 5 + 7 + 9 + 11 = 35. There are 5 values, so the mean is 35 / 5 = 7.
Step 2 — the deviations. Subtract the mean (7) from each value:
| Value (x) | Deviation (x − mean) | Squared deviation |
|---|---|---|
| 3 | 3 − 7 = −4 | 16 |
| 5 | 5 − 7 = −2 | 4 |
| 7 | 7 − 7 = 0 | 0 |
| 9 | 9 − 7 = 2 | 4 |
| 11 | 11 − 7 = 4 | 16 |
Step 3 — square the deviations. The squared deviations are 16, 4, 0, 4 and 16. Notice that the negative deviations (−4 and −2) become positive squares, so nothing cancels out. A quick check: the deviations themselves add up to zero (−4 − 2 + 0 + 2 + 4 = 0), which is always true and confirms the mean is correct.
Step 4 — average the squares. The squared deviations add up to 16 + 4 + 0 + 4 + 16 = 40. Dividing by the number of values, 5, gives the population variance: 40 / 5 = 8.
Step 5 — take the square root. √8 = 2.8284…, so the population standard deviation is 2.83 (to two decimal places). A typical value in this data set sits about 2.83 away from the mean of 7, which makes sense: the values run from 3 to 11, four points either side of the mean.
Population vs sample: divide by n or by n − 1?
Step 4 hides the one decision you have to make: what do you divide by? If your numbers are the entire population — every value there is — divide by n, the number of values. That is what we just did: 40 / 5 = 8, giving a standard deviation of 2.83.
If your numbers are only a sample drawn from a larger group, divide by n − 1 instead. For our example that means 40 / 4 = 10, so the sample variance is 10 and the sample standard deviation is √10 = 3.16. The sample figure is always a little larger, and that is deliberate: a sample usually understates how spread out the full population is, because the most extreme values are the ones most likely to be missing from it. Dividing by n − 1 instead of n corrects for that tendency. This correction is called Bessel's correction, and the guide on the standard deviation formula explains it in detail.
Which one should you use? Ask whether your data is everything or just a part of everything. Test scores for a whole class of 30 students are a population; test scores from 30 students picked out of a school of 1,000 are a sample. When in doubt, most calculators and spreadsheet functions let you choose: the population version is usually labelled STDEV.P and the sample version STDEV.S. Our calculator shows both, so you can pick the one that fits your data.
Checking your answer
Three quick checks catch most mistakes. First, the deviations must add up to zero — if they do not, the mean is wrong. Second, the standard deviation can never be negative, and it is zero only when every value is identical. Third, a rough sense check: the standard deviation is usually smaller than the range of the data, and for most data sets it is somewhere between a quarter and a half of the range. In our example the range is 11 − 3 = 8, and the standard deviation of 2.83 sits comfortably inside that band.
One more common slip is forgetting the final square root and reporting the variance instead. The variance of our example is 8, but the standard deviation is 2.83 — and only the second one is in the same units as the data. If your answer seems far too large, check whether you stopped at step 4.
A second quick example
Try a smaller set to build confidence: 4, 8, 15, 16, 23, 42. The values add up to 108 and there are 6 of them, so the mean is 18. The deviations are −14, −10, −3, −2, 5 and 24; their squares are 196, 100, 9, 4, 25 and 576, which add up to 910. The population variance is 910 / 6 = 151.67, so the population standard deviation is √151.67 = 12.32. The sample version divides by 5 instead: 910 / 5 = 182, giving √182 = 13.49. The spread here is much larger than in the first example, and the standard deviation shows it: 12.32 against 2.83. If you want to see every step for your own numbers, the standard deviation calculator shows the full working.
Frequently Asked Questions
What are the five steps to calculate standard deviation?
First find the mean of the numbers. Then subtract the mean from each number to get the deviations. Square each deviation. Average the squared deviations to get the variance. Finally, take the square root of the variance — that is the standard deviation.
Why do you square the deviations?
Deviations above the mean are positive and deviations below it are negative, so if you simply added them they would cancel out to zero. Squaring makes every deviation positive, so the spread is counted properly. The square root at the end undoes the squaring and returns the answer to the original units.
Do I divide by n or by n minus 1?
Divide by n when your numbers are the whole population, and by n minus 1 when they are a sample taken from a larger group. The n minus 1 version (the sample standard deviation) corrects for the fact that a sample tends to understate the spread of the full population.
Can I calculate standard deviation without a calculator?
Yes, for small data sets. The arithmetic is only addition, subtraction, multiplication and one square root, and the worked example in this guide uses whole numbers that keep it simple. For large data sets, use our free standard deviation calculator instead.
What is the standard deviation of 3, 5, 7, 9, 11?
The population standard deviation is 2.83 and the sample standard deviation is 3.16. The mean is 7, the squared deviations add up to 40, so the population variance is 40 / 5 = 8 (square root 2.83) and the sample variance is 40 / 4 = 10 (square root 3.16).
References
- Pearson, Karl (1894). "On the dissection of asymmetrical frequency curves." Philosophical Transactions of the Royal Society of London, Series A, 185, 71–110.
- Illowsky, Barbara & Dean, Susan (2023). Introductory Statistics 2e. OpenStax, Rice University. Chapter 2, "Descriptive Statistics". Source