How to Calculate Standard Deviation by Hand (Sample and Population)
By the SnapCalculations team · Updated 5 Nov 2026
The short answer
Find the mean, subtract it from each value and square the results, then add those squares. Divide by n for a population or by n − 1 for a sample to get the variance, and take the square root. That's the standard deviation.
What standard deviation tells you
Standard deviation measures how spread out a set of numbers is. A small standard deviation means the values sit close to the average; a large one means they're scattered widely. It's in the same units as your data, so a standard deviation of 5 marks on a test means scores typically sit about 5 marks from the mean.
Two classes can have exactly the same average score and still be very different. In one, everyone scored close to the average; in the other, some students did brilliantly and some struggled. The average can't show that difference, but the standard deviation can.
s = √( Σ(x − x̄)² ÷ (n − 1) )
Sample standard deviation. For a population, divide by n instead and call it σ
How to calculate it, step by step
- 1Find the mean. Add all the values and divide by how many there are.
- 2Subtract the mean from each value. Some answers will be negative; that's expected.
- 3Square each of those differences. Squaring makes every result positive.
- 4Add up the squares. This total is called the sum of squares.
- 5Divide to get the variance: by n if your data is the whole population, or by n − 1 if it's a sample.
- 6Take the square root of the variance. That's the standard deviation.
Sample or population: n or n − 1?
- Population (divide by n): your data includes every member of the group you care about, such as the marks of every student in one class when you only care about that class.
- Sample (divide by n − 1): your data is a selection from a bigger group, and you want to estimate the spread of that bigger group, such as 50 surveyed customers out of thousands.
Dividing by n − 1 (called Bessel's correction) makes the answer slightly bigger. A sample tends to sit closer to its own mean than the whole population does, so without the correction you'd underestimate the spread. If you're not sure which to use, sample is the usual choice in statistics classes and research.
In Excel and Google Sheets, STDEV.S gives the sample standard deviation and STDEV.P gives the population one. On a scientific calculator, s or σn−1 is the sample version and σ or σn is the population version.
Worked examples
Example 1: a population
Find the population standard deviation of 2, 4, 4, 4, 5, 5, 7, 9.
- Mean: 2 + 4 + 4 + 4 + 5 + 5 + 7 + 9 = 40, and 40 ÷ 8 = 5.
- Differences from 5: −3, −1, −1, −1, 0, 0, 2, 4.
- Squares: 9, 1, 1, 1, 0, 0, 4, 16. Their sum is 32.
- Population variance: 32 ÷ 8 = 4.
- Standard deviation: √4 = 2.
Answer: σ = 2
Try it in the calculatorExample 2: the same numbers as a sample
If 2, 4, 4, 4, 5, 5, 7, 9 is a sample from a larger group, what is the sample standard deviation?
- The sum of squares is still 32.
- Sample variance: 32 ÷ (8 − 1) = 32 ÷ 7 ≈ 4.5714.
- Standard deviation: √4.5714 ≈ 2.138.
Answer: s ≈ 2.138 (a little larger than the population answer of 2)
Try it in the calculatorExample 3: quiz scores
Five students sampled from a year group score 6, 8, 10, 12 and 14 on a quiz. Find the sample standard deviation.
- Mean: 50 ÷ 5 = 10.
- Differences: −4, −2, 0, 2, 4. Squares: 16, 4, 0, 4, 16, which add up to 40.
- Sample variance: 40 ÷ 4 = 10.
- Standard deviation: √10 ≈ 3.162.
Answer: s ≈ 3.162 marks
Try it in the calculatorExample 4: same mean, different spread
Group A scores 48, 50 and 52. Group B scores 30, 50 and 70. Compare their sample standard deviations.
- Both groups have a mean of 50.
- Group A: squares of the differences are 4, 0, 4, so the sum is 8. Variance 8 ÷ 2 = 4, and √4 = 2.
- Group B: squares are 400, 0, 400, so the sum is 800. Variance 800 ÷ 2 = 400, and √400 = 20.
Answer: Group A: 2. Group B: 20. Same average, ten times the spread
Try it in the calculatorWhat counts as a big standard deviation?
It depends on the size of the numbers. A standard deviation of 2 is tiny for house prices but huge for shoe sizes. Compare it with the mean, or with another group measured the same way. For data that follows a bell-shaped (normal) curve, about 68% of values fall within one standard deviation of the mean, about 95% within two, and about 99.7% within three.
Common mistakes to avoid
- Using the wrong divisor. Decide first whether your data is a sample (n − 1) or a whole population (n).
- Forgetting to square the differences. Unsquared differences always add up to zero, which is a useful check on your mean.
- Stopping at the variance. The variance is in squared units; take the square root to get the standard deviation.
- Rounding the mean too early. If the mean is a long decimal, keep several decimal places until the final step.
Check it with the calculator
Paste your numbers into our standard deviation calculator to see the sample and population answers side by side, along with the mean, variance and every step of the working.
Frequently asked questions
What is the difference between variance and standard deviation?
Variance is the average of the squared differences from the mean. Standard deviation is its square root, which puts it back into the same units as your data, so it's easier to interpret.
Can standard deviation be negative?
No. It's a square root of a sum of squares, so the smallest it can be is 0, which happens only when every value is the same.
Why divide by n − 1 for a sample?
A sample's values tend to sit closer to the sample's own mean than to the true population mean, so dividing by n would underestimate the spread. Dividing by n − 1 corrects for that.
Does one outlier change the standard deviation much?
Yes. Because differences are squared, a single value far from the mean can raise the standard deviation a lot. Check unusual values before relying on the result.