Sample vs Population Standard Deviation: When to Divide by n Minus 1

Published 2026-01-10

The single most common question about standard deviation is whether to divide by n or by n minus 1. The answer depends on one thing: does your data include every member of the group you care about, or is it a sample drawn from a larger group? This guide explains both formulas, why Bessel’s correction exists, and how to decide which one to use in real situations. If you just need the number, the calculator on our homepage lets you pick either mode and shows the full working.

The two formulas side by side

Both versions of standard deviation follow the same recipe: find the mean, subtract it from each value, square the differences, average them, and take the square root. The only difference is the divisor in the averaging step:

That tiny change in the denominator is called Bessel’s correction, and it exists to fix a systematic bias.

Why the sample formula divides by n minus 1

Here is the intuition in plain language. When you work with a sample, you do not know the true population mean. You use the sample mean instead, and the sample mean is calculated from the very same data points you are measuring deviations from.

That matters because the sample mean is, by construction, the value that sits closest to your sample’s own values. It is the balance point of the sample. The true population mean is almost certainly somewhere slightly different, and the sample values are, on average, a bit farther away from that true mean than they are from their own sample mean.

The consequence: squared deviations measured from the sample mean are slightly too small on average. If you divide by n, your variance estimate systematically underestimates the true population variance. Dividing by n minus 1 inflates the result just enough to cancel out that underestimate. With the correction, the sample variance is an unbiased estimator of the population variance: across many repeated samples, it hits the true value on average.

You can also think of it in terms of degrees of freedom. Once you know the sample mean, only n minus 1 of the values are free to vary, because the last one is determined by the requirement that they all average to that mean. Dividing by the number of independent pieces of information is what makes the estimator unbiased.

A concrete example

Take the dataset [4, 8, 6, 5, 3, 7]. The mean is 5.5, and the sum of squared deviations from the mean is 17.5. (You can see every step of this arithmetic in our guide on how to calculate standard deviation by hand.)

The sample version is larger, exactly as Bessel’s correction intends. With only six values, the correction changes the answer by about 10 percent. As n grows, the difference shrinks: dividing by 999 instead of 1000 barely moves the result.

How to decide which one to use

Ask one question: is this dataset the whole group I care about, or a piece of it?

Use the population formula (divide by n) when:

Use the sample formula (divide by n minus 1) when:

Real world decision examples

Quality control: A factory measures 50 bottles pulled from a production run of 100,000. Use the sample formula. The 50 bottles stand in for the whole run.

Sports statistics: You have the points scored in all 82 games of a team’s season and want to describe that season’s consistency. Use the population formula. The season is complete and you are not inferring anything beyond it.

Scientific research: A biologist measures 30 fish from a lake. Use the sample formula. The fish are a sample of the lake’s population.

Finance: An analyst looks at daily returns for the past year to estimate volatility going forward. Use the sample formula. The past year is treated as a sample of the return-generating process, not the entire population of returns that will ever exist.

Which one do calculators and software use?

This is a frequent source of confusion. In spreadsheet software, STDEV.P divides by n and STDEV.S divides by n minus 1. Many scientific calculators have keys labeled for both. Some tools, including NumPy in Python, default to the population version, while R defaults to the sample version. Always check which one your tool applies before reporting a number, and state your choice in your work. Our standard deviation calculator labels both modes clearly so you always know which formula ran.

For a full worked calculation showing both divisors on the same data, see how to calculate standard deviation by hand. To learn what the resulting number actually means, read what standard deviation tells you, and to avoid the errors people make most often, see common standard deviation mistakes.