Calc Garden
Education guide

Population vs Sample Standard Deviation

The decision rule is simple: if your data is the whole group you care about, use the population standard deviation and divide by N; if it is a sample drawn from a larger group, divide by n minus 1. This guide explains why the n minus 1 step exists, works a small example both ways, and maps each to its Excel function.

By Calc Garden · Updated June 2026

The one-line decision rule

Start with the rule, because it settles most cases on its own. If your numbers are the whole group you care about, you have a population: compute the standard deviation by dividing the summed squared differences by N, the count of values. If your numbers are a sample, a subset standing in for a larger group you cannot measure in full, divide by n - 1 instead. That single swap, N versus n - 1, is the entire practical difference between the two formulas.

Both versions start the same way. You find the mean, subtract it from each value to get the deviations, square those deviations and add them up. The only thing that changes is what you divide that sum by before taking the square root. Everything else, including how you read and interpret the answer, is identical.

Why n minus 1 exists: Bessel's correction

The n - 1 step is called Bessel's correction, and it fixes a subtle bias. When you only have a sample, you do not know the true mean of the whole population, so you use the sample's own mean as a stand-in. The catch is that a sample's spread is measured around its own mean, and a sample always sits closest to its own mean, closer than it would to the true population mean. That makes the raw spread come out a little too small, which would make you underestimate the variation in the wider group.

Dividing by n - 1 instead of n nudges the result upward by just the right amount to cancel that bias on average. The intuition is that the sample mean "uses up" one piece of information, leaving n - 1 independent pieces, sometimes called degrees of freedom, to estimate the spread. The effect is large for tiny samples and fades as the sample grows: with five values you divide by four, a noticeable bump, but with a thousand values dividing by 999 barely moves the answer. That is why the choice matters most precisely when your data is sparse.

A worked example, both ways

Take the five numbers 4, 8, 6, 5 and 7. Their mean is (4 + 8 + 6 + 5 + 7) / 5 = 30 / 5 = 6. Now find each deviation from the mean and square it:

The squared deviations add up to 4 + 4 + 0 + 1 + 1 = 10. From here the two formulas part ways. For the population standard deviation, divide by N = 5: that gives a variance of 10 / 5 = 2, and the square root of 2 is about 1.41. For the sample standard deviation, divide by n - 1 = 4: the variance is 10 / 4 = 2.5, and the square root of 2.5 is about 1.58.

Same data, two answers: 1.41 if these five numbers are the whole story, 1.58 if they are a sample of something larger. The sample figure is the bigger of the two, exactly as Bessel's correction promises. If you want to skip the arithmetic, our standard deviation calculator reports both the population and sample results side by side, and you can confirm the mean step with the average calculator.

STDEV.P vs STDEV.S in Excel

Spreadsheets bake the same choice into their function names, and getting the wrong one is a common quiet error. In modern Excel and Google Sheets, STDEV.P is the population version that divides by N, and STDEV.S is the sample version that divides by n - 1. The suffixes are the giveaway: .P for population, .S for sample. Older workbooks may show STDEVP and plain STDEV, which map to the same two formulas respectively, with bare STDEV being the sample one.

A safe habit is to assume sample unless you can clearly justify population, because most real datasets are samples of a wider whole. If you typed STDEV.P over survey responses or experiment readings, you would slightly understate the spread, and on a small dataset that gap is not trivial. When you are unsure, reach for STDEV.S or the sample column in a calculator, and only switch to the population version when you genuinely hold every member of the group.

Putting it together

The whole topic collapses to one question asked before you touch a formula: is this data the entire group, or a sample of it? Answer that, and the rest follows automatically. Whole group means population, divide by N, use STDEV.P. A sample means divide by n - 1, use STDEV.S, and trust Bessel's correction to keep your estimate honest. The maths is the same until that final division, so the only real decision is being clear about what your numbers actually represent.

If you are studying statistics for a course, it is worth pairing this with the mechanics of how grades are weighted and predicted, since the same weighted-average thinking shows up there too. Once the population versus sample distinction clicks, you will find it underpins confidence intervals, standard error and most of inferential statistics, all of which lean on that single n - 1 correction.

Frequently asked questions

Do I divide by n or n-1?

Divide by n (the population formula) only when your data covers the entire group you want to describe. Divide by n minus 1 (the sample formula) when your data is a sample standing in for a bigger population, which is the more common situation in research and surveys. The n minus 1 version gives a slightly larger, less biased estimate of the wider spread.

When do I use sample vs population SD?

Use population SD when you have every member of the group, for example the marks of all 30 students in one class when the class is the whole point. Use sample SD when those 30 students are a sample meant to represent every student in the school. If in doubt, you almost certainly have a sample, so n minus 1 is the safer default.

Which Excel function is which?

STDEV.P (and the older STDEVP) is the population version that divides by N. STDEV.S (and the older STDEV) is the sample version that divides by n minus 1. The .P and .S suffixes stand for population and sample, which makes them easy to remember once you know the difference.