Sample vs. Population Standard Deviation: When to Divide by n − 1
October 21, 2026
Use the population standard deviation when your data includes every member of the group you care about. Use the sample standard deviation when your data is a sample drawn from a larger group. The only difference in the formulas is the divisor: n for a population and n − 1 for a sample. For the data 2, 4, 4, 4, 5, 5, 7, 9, the population value is exactly 2.00 and the sample value is about 2.14.
Skip the math and get your answer instantly:
Open the Standard Deviation Calculator →Worked Example
The mean of 2, 4, 4, 4, 5, 5, 7, 9 is 40 ÷ 8 = 5. The squared deviations from the mean are 9, 1, 1, 1, 0, 0, 4, 16, which sum to 32.
Population variance = 32 ÷ 8 = 4, so σ = 2. Sample variance = 32 ÷ 7 ≈ 4.571, so s ≈ 2.138. The sample version is a little larger, by design.
| Type | Divisor | Variance | Standard deviation |
|---|---|---|---|
| Population | n = 8 | 4.000 | 2.000 |
| Sample | n − 1 = 7 | 4.571 | 2.138 |
Why n − 1?
When you use a sample, you measure deviations from the sample mean, not the unknown true mean. The sample mean is, by construction, the point that minimizes the sum of squared deviations for that sample, so the deviations from it are systematically a bit too small.
Dividing by n − 1 instead of n corrects this bias, so that the sample variance is an unbiased estimate of the population variance. This adjustment is known as Bessel's correction. The correction also reflects the fact that once the mean is fixed, only n − 1 of the values are free to vary, which statisticians call degrees of freedom.
Which One Should You Use?
If you measured everything, such as the test scores of all 30 students in a single class you are describing, use the population formula. If those 30 students are being used to say something about all students at the school, treat it as a sample.
In practice, most real data is a sample, so n − 1 is the safer default. With large samples the difference vanishes: for n = 1,000, the two results differ by about 0.05%.
Spreadsheet and Calculator Settings
Spreadsheets have separate functions: STDEV.P for the population and STDEV.S for the sample. Calculators often label them σn and σn−1 or Sx. Check which one your tool reports by default before comparing results.
A common reason two tools give different answers for the same data is that they used different divisors.
Frequently Asked Questions
Why do we divide by n − 1 for a sample?
To correct the tendency of the sample to underestimate the spread of the population, because deviations are measured from the sample mean rather than the true mean.
When should I use population standard deviation?
When your dataset contains every member of the group you are studying, rather than a subset.
Which Excel function should I use?
STDEV.S for a sample and STDEV.P for a population.
Does it matter for large datasets?
Hardly. As n grows, n and n − 1 become nearly identical and the two results converge.