Two formulas, one confusing difference: the sample vs population standard deviation question comes down to a single choice, divide by n, or divide by n − 1? Pick wrong and your measure of spread is systematically off. This guide works through the arithmetic step by step in plain English, explains why the correction exists, and gives you a rule you will never forget. Find more stats help in our tools collection.
Standard deviation in one paragraph

Standard deviation measures spread: how far data points typically wander from the average. A class where everyone scores near 70 has a small standard deviation; a class with scores scattered from 30 to 100 has a large one. It is the square root of the variance, which is the average of the squared distances from the mean. We square the distances so that below average and above average deviations do not cancel each other out.
Worked example: the same data, two answers
Take five quiz scores: 2, 4, 6, 8, 10. The mean is (2 + 4 + 6 + 8 + 10) ÷ 5 = 6.
Step 1, find each distance from the mean: −4, −2, 0, 2, 4.
Step 2, square each distance: 16, 4, 0, 4, 16.
Step 3, add the squares: 16 + 4 + 0 + 4 + 16 = 40.
Now the fork in the road:
- Population standard deviation: variance = 40 ÷ 5 = 8 → SD = √8 ≈ 2.83
- Sample standard deviation: variance = 40 ÷ (5 − 1) = 40 ÷ 4 = 10 → SD = √10 ≈ 3.16
Same data, two different answers, the sample version is always a little larger. The only difference is the divisor: n (the count) versus n − 1 (the count minus one). That “minus one” is called Bessel’s correction, and it exists for a genuinely good reason.
Why n − 1? The honest explanation
Here is the subtle problem. When you work with a sample, you do not know the true population mean, so you estimate it with the sample mean. But the sample mean is, by construction, the number that sits closest to your particular data points. Your points will always look slightly less spread out around their own sample mean than they would around the true population mean.
Think of it this way: the sample mean is “fitted” to the sample, like a tailor made suit, of course it fits snugly. Measuring spread around it therefore underestimates the real spread in the population. Dividing by the slightly smaller n − 1 instead of n inflates the result just enough to cancel out that bias. With the correction, the sample variance becomes an unbiased estimate of the population variance, right on average, across many samples.
When you have the entire population every member, no estimation involved, there is no bias to correct, because you used the true mean. So you divide by plain n.
The rule you will never forget
Ask one question: is my data the whole group, or a sample standing in for a bigger group?
- Whole group → population (÷ n). All 30 students in your class, every sale your shop made this year, the complete census of a small town. You are describing, not estimating.
- Sample of something bigger → sample (÷ n − 1). 200 survey respondents representing a country, 50 light bulbs tested from a production run of millions, a clinical trial group. You are estimating the population’s spread from limited data.
In practice, most real world statistics work uses the sample formula, surveys, experiments, and studies are almost always samples. That is why spreadsheet functions and calculators often default to it: in Excel, STDEV.S is the sample version (÷ n − 1) and STDEV.P is the population version (÷ n). The good news: with large datasets the two answers converge, because the difference between dividing by 1,000 and by 999 is negligible. The choice matters most with small samples, exactly when getting it right counts.
A second example to lock it in
A bakery tests the weight of 4 loaves from today’s batch of 2,000: 480, 500, 510, 510 grams. Mean = 2000 ÷ 4 = 500. Squared distances: 400, 0, 100, 100 → sum = 600.
- Population SD (÷ 4): √(600 ÷ 4) = √150 ≈ 12.25 g wrong here, because 4 loaves are a sample of 2,000, not the whole batch.
- Sample SD (÷ 3): √(600 ÷ 3) = √200 ≈ 14.14 g correct, the honest estimate of the batch’s spread.
If instead those 4 loaves were the entire production of a tiny artisan batch, the population formula (12.25 g) would be the right description. Same numbers, different question, and that is the whole decision.
Worked example 3: reaction times and a decision that matters
The quiz scores and loaves above teach the mechanics. This example adds the judgement call, because in real work the arithmetic is the easy part. A researcher measures the reaction times of five drivers 210, 220, 230, 240, and 300 milliseconds as the first batch of a much larger road safety study. The five drivers are not the population of interest; they are a sample standing in for all drivers. Watch how that single fact decides the formula.
The mean is (210 + 220 + 230 + 240 + 300) ÷ 5 = 1,200 ÷ 5 = 240 ms. The distances from the mean are −30, −20, −10, 0, and 60. Squared, they are 900, 400, 100, 0, and 3,600, summing to 5,000. Now the fork. Divide by n = 5 and the variance is 1,000, giving a standard deviation of √1,000 ≈ 31.62 ms. Divide by n − 1 = 4 and the variance is 1,250, giving √1,250 ≈ 35.36 ms. The sample answer is about 11.8% larger (3.74 ÷ 31.62 ≈ 0.118), with only five values, Bessel’s correction is not a rounding detail, it is a visible chunk of the answer. You can verify both square roots in seconds with a scientific calculator, and express that 11.8% gap precisely with a percentage calculator if you are reporting it.
Which answer should the researcher publish? The sample figure, 35.36 ms, without hesitation. The study’s claims are about drivers in general, and the five measured drivers were chosen to estimate that larger group’s spread. Publishing 31.62 ms would understate how variable drivers really are, and in a safety study, understating variability is the dangerous direction of error, because design decisions get built on it. Contrast the bakery earlier: had the four loaves been the entire batch, the population figure would have been the honest one. The numbers never decide; the question decides. Ask what your data represents before you touch a formula, and the divisor chooses itself.
The two formulas compared
Everything in this guide compresses into one table. Keep it beside you whenever a spreadsheet offers you two functions with confusingly similar names.
| Question | Population standard deviation | Sample standard deviation |
|---|---|---|
| Divisor | n, the number of values | n − 1, Bessel’s correction |
| Mean used | The true population mean | The sample mean, estimated from your data |
| Use it when | Your data is the complete group you are describing | Your data is a sample estimating a larger group |
| Excel and Sheets function | STDEV.P | STDEV.S |
| Size on identical data | Always the smaller answer | Always the larger answer, by a factor of √(n ÷ (n − 1)) |
| Gap at n = 5 | Baseline | About 11.8% larger |
| Gap at n = 100 | Baseline | About 0.5% larger, nearly identical |
That factor row explains the whole behaviour of the correction. Because the sample result is the population result multiplied by √(n ÷ (n − 1)), the inflation is large exactly when data is scarce and shrinks towards nothing as the sample grows: about 11.8% at five values, about 0.5% at a hundred. This is also why arguments about the divisor matter in small studies and classroom exercises, and why nobody sensible fights over it in a dataset of a million rows.
Common mistakes to avoid
- Reaching for STDEV.P because its answer looks tidier. On sample data the population function does not give a cleaner answer, it gives a biased one, systematically too small. Choose by what the data represents, never by which output you prefer.
- Expecting the sample result to be smaller. Students often assume the “corrected” version trims the answer down. It does the opposite: dividing by the smaller n − 1 inflates the result to cancel the underestimate built into using the sample mean.
- Averaging standard deviations together. You cannot average the standard deviations of two classes, two weeks, or two shops to get the combined spread, the operation is not valid for medians either. Pool the raw data, or combine variances properly with the group sizes and means.
- Using the sample formula on a complete census. If you genuinely hold every value in the group, all thirty students, every sale of the year, there is no estimation happening and no bias to correct. Dividing by n − 1 there overstates a spread you know exactly.
- Reporting a standard deviation without saying which kind. “The standard deviation is 35” is an incomplete sentence in any write up. Name the formula, the function, or the divisor, your reader cannot reproduce or trust the figure without it.
Degrees of freedom: the idea under the correction
Statisticians describe the n − 1 divisor with the phrase degrees of freedom, and the intuition is worth having plainly. Once you know the sample mean and any n − 1 of your values, the last value is no longer free. It is forced, because all the values must average out to that mean. So although you collected n data points, only n − 1 of them carry independent information about the spread around the estimated mean; one point’s worth of information was spent estimating the mean itself. Dividing by n − 1 is simply charging the calculation for what it spent.
The extreme case makes the idea unforgettable. Take a sample of exactly one value. The population formula returns a standard deviation of zero, the single point sits exactly on its own mean, which would absurdly claim perfect knowledge that the population has no spread at all. The sample formula divides by n − 1 = 0, which is undefined, and that refusal is the honest answer: one observation contains no information whatsoever about variability. Whenever the divisor debate feels abstract, return to that single data point. The mathematics is protecting you from claiming knowledge you do not have.
Frequently asked questions
What is the difference between sample and population standard deviation?
The formulas differ only in the divisor: population SD divides the sum of squared deviations by n (the number of values), while sample SD divides by n − 1. The sample version is always slightly larger and is the correct choice when your data is a sample of a larger group.
Why do we divide by n − 1 for a sample?
Because the sample mean is fitted to the sample data, points always look slightly less spread around it than around the true population mean. Dividing by the smaller n − 1 corrects that systematic underestimate, this is Bessel’s correction.
Which one should I use in Excel or Google Sheets?
Use STDEV.S (sample, ÷ n − 1) when your data is a sample of something bigger, which covers surveys, experiments, and most real datasets. Use STDEV.P (population, ÷ n) only when your data is the complete group you are describing.
Does it matter with large datasets?
Barely. Dividing by 10,000 versus 9,999 changes almost nothing. The choice matters most with small samples (under ~30), where the n − 1 correction makes a meaningful difference.
Can standard deviation be zero or negative?
It can be zero, that happens when every value is identical (no spread at all). It can never be negative, since it is a square root of a sum of squares.

