How to Calculate Standard Deviation (Step by Step)
Published 10/28/2025 · 3 min read · Everyday calculators
Standard deviation measures how far values sit from the mean, on average. To calculate it: find the mean, subtract it from each value and square the result, average those squares (the variance), then take the square root. For 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5 and the standard deviation is 2. Divide by n for a whole population, or n − 1 for a sample.
Standard deviation measures how spread out your data is. Here's the formula, a worked example, and the difference between population and sample.
What standard deviation tells you
Standard deviation puts a single number on how spread out your data is around its mean. A small value means the numbers cluster tightly; a large one means they scatter widely. Because it is in the same units as the data — euros, centimetres, seconds — it reads naturally as a typical distance from the average.
The steps, worked through
Take 2, 4, 4, 4, 5, 5, 7, 9. The mean is 40 ÷ 8 = 5. The squared differences from 5 are 9, 1, 1, 1, 0, 0, 4, 16, which sum to 32. Dividing by 8 gives a variance of 4, and its square root is 2 — the standard deviation. So values sit, on average, about 2 units from the mean of 5.
Population vs sample (n or n − 1)
If your numbers are the entire group you care about, divide by n. If they are a sample used to estimate a larger population, divide by n − 1 instead — this Bessel's correction slightly increases the result to make up for the extra uncertainty of a sample. Choosing the wrong one is the most common standard-deviation mistake.
Reading it: the 68–95–99.7 rule
For roughly bell-shaped (normal) data, about 68% of values fall within one standard deviation of the mean, 95% within two, and 99.7% within three. So with a mean of 5 and a standard deviation of 2, most values (95%) land between 1 and 9. This rule turns the number into a quick sense of what is typical and what is unusual.
Worked with our own calculator
Standard deviation calculator
Given
- Numbers
- 12, 18, 20, 25, 30
Result
- Std. deviation (σ)
- 6.132
- Variance
- 37.6
- Mean
- 21
These figures are produced by the calculator below, not typed in by hand — they are recomputed whenever the tool changes.
Run it on your own figures →Frequently asked questions
- What's 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 the spread back in the original units.
- When do I use n vs n − 1?
- Use n when your data is the whole population, and n − 1 when it is a sample estimating a larger population.
- What is a 'good' standard deviation?
- There isn't one in absolute terms — it depends on the scale of the data. Compare it to the mean (the coefficient of variation) to judge whether the spread is large or small.
Articles you may find interesting
All guides →Related tools
Sources
Spotted a mistake in this article?