How to Calculate Standard Deviation: Step-by-Step Guide
Standard deviation is one of the most important concepts in statistics. It tells you how spread out a set of values is from the average (mean). A low standard deviation means the data points cluster tightly around the mean, while a high standard deviation means they are more spread out.
This guide explains both population and sample standard deviation, walks through a complete worked example with real numbers, and shows you how to interpret the result.
Population vs Sample Standard Deviation
There are two versions of the standard deviation formula, and choosing the correct one matters.
Population Standard Deviation
Use this when you have data for an entire population (e.g. every student in a school, every product in a warehouse):
Where is the total number of values, is each individual value, and is the population mean.
Sample Standard Deviation
Use this when your data is a sample drawn from a larger population (which is more common in practice):
The key difference is dividing by instead of . This is called Bessel's correction, and it compensates for the fact that a sample tends to underestimate the true population variability.
Step-by-Step: Calculating Sample Standard Deviation
Let us work through a complete example. Suppose you recorded the daily temperatures (in degrees Celsius) over 8 days:
Step 1: Find the Mean
Add all values and divide by the number of data points:
Step 2: Find Each Deviation from the Mean
Subtract the mean from each data point:
| 23 | -1.5 | 2.25 |
| 25 | 0.5 | 0.25 |
| 28 | 3.5 | 12.25 |
| 22 | -2.5 | 6.25 |
| 26 | 1.5 | 2.25 |
| 24 | -0.5 | 0.25 |
| 27 | 2.5 | 6.25 |
| 21 | -3.5 | 12.25 |
Step 3: Sum the Squared Deviations
Step 4: Divide by n - 1
Since we have 8 data points and this is a sample, we divide by :
This value (6.00) is called the variance.
Step 5: Take the Square Root
The sample standard deviation is approximately 2.45 degrees Celsius.
Interpreting the Result
A standard deviation of 2.45 means that, on average, each daily temperature is about 2.45 degrees away from the mean of 24.5. In this dataset, temperatures ranged from 21 to 28, a spread of 7 degrees, and the standard deviation captures the typical magnitude of deviation from the centre.
Population Standard Deviation for the Same Data
If these 8 days were the entire population of interest (not a sample), we would divide by instead of 7:
Notice that the population standard deviation (2.29) is slightly smaller than the sample standard deviation (2.45). This is always the case due to Bessel's correction.
When to Use Each Version
- Population (): You have every data point in the group. For example, the ages of all employees in a small company.
- Sample (): You are working with a subset of a larger group. For example, surveying 100 customers out of 10,000. This is the more common scenario in research and business.
Common Mistakes
- Using the wrong denominator. Dividing by when you should use (or vice versa) will give an incorrect result.
- Forgetting the square root. If you stop after dividing by , you have the variance, not the standard deviation.
- Rounding too early. Keep extra decimal places during calculations and only round the final answer.
- Confusing standard deviation with standard error. The standard error is and measures uncertainty of the mean, not the spread of data.
Relationship Between Variance and Standard Deviation
Variance is the square of the standard deviation. It uses the same formula but without the final square root:
Variance is useful in mathematical proofs and some statistical tests, but standard deviation is generally preferred for interpretation because it is in the same units as the original data.
Try It Yourself
Enter your own dataset into our free Standard Deviation Calculator to get instant results for both population and sample standard deviation, along with the variance, mean, and more.
Related Articles
How to Calculate Percentages: A Complete Guide with Examples
Learn how to calculate percentages step by step. Covers the core formula, percentage increase and decrease, finding a percentage of a number, and common mistakes to avoid.
How to Find the Derivative: Rules, Formulas, and Worked Examples
Master differentiation with this guide to derivative rules. Covers the power rule, product rule, quotient rule, and chain rule with step-by-step KaTeX examples.
A Guide to Matrix Operations: Addition, Multiplication, and Inverses
Master matrix operations including addition, scalar multiplication, matrix multiplication, determinants, and inverses with step-by-step examples.