How to Calculate Standard Deviation (Step-by-Step with Examples)
How to Calculate Standard Deviation (Step-by-Step with Examples)
Standard deviation is one of the most important measures in statistics. It tells you how spread out a set of numbers is around their mean (average). A small standard deviation means the values cluster tightly around the mean; a large one means they are widely scattered. This guide walks through the calculation by hand, step by step, and explains the difference between the sample and population versions.
You can check any of the calculations below instantly with our free Standard Deviation & Statistics Calculator, which shows every step.
What Is Standard Deviation?
Standard deviation (denoted σ for a population or s for a sample) is the square root of the variance — the average of the squared distances of each value from the mean. Taking the square root returns the measure to the original units of the data, which makes it far easier to interpret than variance alone.
The Formulas
The only difference is the denominator: the population version divides by N, while the sample version divides by n − 1. This adjustment (called Bessel's correction) compensates for the fact that a sample tends to underestimate the true spread of the whole population.
Step-by-Step Example
Suppose we have the data set: 2, 4, 4, 4, 5, 5, 7, 9 (n = 8).
Step 1: Find the mean
Step 2: Subtract the mean and square each result
The squared deviations (x − 5)² are: 9, 1, 1, 1, 0, 0, 4, 16.
Step 3: Sum the squared deviations
Step 4: Divide to get the variance
Step 5: Take the square root
So the population standard deviation is exactly 2, and the sample standard deviation is about 2.14.
Sample vs. Population: Which Should You Use?
- Use the population standard deviation when your data represents the entire group you care about (every student in a class, every item produced).
- Use the sample standard deviation when your data is a subset used to estimate a larger population (a survey of 200 voters, a batch of 50 parts). This is the most common case in research and business.
Common Mistakes to Avoid
- Forgetting to square the deviations — deviations sum to zero without squaring.
- Using N instead of n − 1 for a sample — this underestimates the true spread.
- Confusing variance and standard deviation — remember to take the square root at the end.
Try It Yourself
Rather than compute this by hand every time, paste your numbers into the Standard Deviation & Statistics Calculator. It returns the mean, median, mode, variance, both standard deviations, quartiles, and the interquartile range — with a full step-by-step breakdown you can download as a PDF report.
For related analysis, see the Linear Regression & Correlation Calculator to measure relationships between two variables, or the Z-Score & Normal Distribution Calculator to turn a value into a probability.
Key Takeaways
- Standard deviation measures how spread out data is around the mean.
- Variance is the average squared deviation; standard deviation is its square root.
- Divide by N for a population and by n − 1 for a sample.
- For the data set 2, 4, 4, 4, 5, 5, 7, 9, σ = 2 and s ≈ 2.14.