There are two versions of the standard deviation formula. The population version divides by the number of values, N. The sample version divides by one less, n − 1. They give slightly different answers, and using the wrong one is a common mistake in statistics homework.
Our standard deviation calculator shows both results, and lets you choose which one to highlight.
Try the Standard Deviation Calculator. Sample and population standard deviation with steps
Open the calculatorThe two formulas
Everything is the same except the divisor.
What is a population and what is a sample?
- A population is every member of the group you care about. If you want to describe the test scores of the 28 students in your class, and you have all 28 scores, that is the population.
- A sample is a subset used to learn about a bigger group. If you survey 200 people to estimate the habits of a whole city, those 200 are a sample.
The question to ask is: do I want to describe only these numbers, or use them to estimate something about a bigger group?
Why divide by n − 1?
When you work with a sample, you do not know the true population mean, so you use the sample mean instead. The sample mean is, by definition, the point that sits closest to the sample values. As a result, deviations measured from it tend to be slightly smaller than deviations from the true population mean would be.
Dividing by n − 1 instead of n makes the result a little bigger, which corrects for this. It is called Bessel's correction. The variance it produces is an unbiased estimate of the population variance.
How big is the difference?
For the data 2, 4, 4, 4, 5, 5, 7, 9 (sum of squared deviations = 32):
| Divisor | Variance | Standard deviation | |
|---|---|---|---|
| Population | 8 | 4.000 | 2.000 |
| Sample | 7 | 4.571 | 2.138 |
The gap shrinks as the data set grows. With 5 values, dividing by 4 instead of 5 raises the variance by 25%. With 100 values, dividing by 99 instead of 100 raises it by only about 1%.
Which one should you use?
| Situation | Use |
|---|---|
| You have every value in the group you are describing | Population |
| Your data is a subset used to estimate a larger group | Sample |
| Survey or experiment results | Sample |
| A statistics class question that doesn't say | Usually sample |
| Quality control data from a production run | Usually sample |
In spreadsheets and calculators
Software uses different names for the two versions:
| Tool | Sample | Population |
|---|---|---|
| Excel and Google Sheets | STDEV.S or STDEV | STDEV.P or STDEVP |
| Calculator notation | s or Sx | σ or σx |
If a spreadsheet result doesn't match your hand calculation, check which function was used.
Notation reminders
- Population mean: μ (mu). Sample mean: x̄ (x-bar).
- Population standard deviation: σ (sigma). Sample standard deviation: s.
- Population size: N. Sample size: n.
For a full walkthrough of the calculation, see standard deviation explained step by step.
Was this page helpful?
Thanks for telling us.
What was missing or wrong? Email us and we will fix it.