standarddeviationcalculator.net

Sample vs population standard deviation

The two standard deviations differ in one place: the sample version divides by n − 1, the population version by N. Which you should use has nothing to do with how much data you have, and everything to do with what you are trying to describe.

The deciding question

Ask: are these numbers the entire group I want to draw a conclusion about?

The same dataset can be either. Twelve monthly sales figures are a population if you want the variability of last year, and a sample if you want to estimate how much sales vary in general. Nothing about the numbers changes — only the question.

SituationWhichWhy
Survey of 500 people in a city of 900,000SampleStanding in for the city
Every test score in one class, describing that classPopulationNothing is left out
Every test score in one class, generalising to the schoolSampleThe class stands in for more
Six replicate lab measurementsSampleEstimating what the method would keep doing
Daily returns for a stock over its full listed historyPopulationThat history is complete…
…the same returns, used to forecast future volatilitySample…but the future is not in it
All 50 US state populations from the censusPopulationThere are exactly 50

See the difference on your own data

Enter numbers and switch the mode to compare the two directly.

Separate values with commas, spaces, tabs or new lines — paste a column straight from a spreadsheet and it will parse. Decimals and negatives are fine.

Treat the data as
Standard deviation — sample 3.02372
Count (n)7
Mean (x̄)10.8571
Standard deviation3.02372
Variance9.14286
Sum76
Σ(x − x̄)²54.8571
Standard error1.14286
Coefficient of variation0.2785
Relative SD (%RSD)27.85%
Minimum7
Maximum15
Range8
Median (Q2)11
Q18.5
Q313
IQR4.5
x̄ = 10.86 −1σ +1σ 1.786 19.93

The shaded bands are one, two and three standard deviations either side of the mean. 4 of 7 values — 57% — fall inside the innermost band.

Show the working, step by step

How large is the gap?

The sample variance is always the population variance multiplied by n/(n − 1). The standard deviations therefore differ by the square root of that factor:

nVariance is larger bySD is larger by
2100%41.4%
525%11.8%
1011.1%5.4%
303.4%1.7%
1001.0%0.5%
10000.1%0.05%

Beyond about n = 100 the choice is cosmetic. Below about n = 20 it is not, and small datasets are exactly where people are most likely to be calculating by hand and least likely to have thought about which mode they are in.

Why n − 1 rather than n

Here is the intuition. The sample mean x̄ is calculated from your sample, which means it is positioned to sit as centrally among those particular numbers as it possibly can. The true population mean μ sits somewhere else, and on average slightly further from your data points.

So Σ(x − x̄)² is systematically smaller than Σ(x − μ)² would have been. Not sometimes — always, except in the vanishing case where x̄ happens to land exactly on μ. Dividing by n would inherit that shortfall and understate the population's spread every single time.

The mathematics works out cleanly: the expected value of Σ(x − x̄)² is exactly (n − 1)σ². So dividing by n − 1 rather than n gives an estimator whose long-run average is σ² exactly. That is Bessel's correction.

The n − 1 is also the degrees of freedom. Once you know the mean and n − 1 of the values, the last one is determined — the deviations must sum to zero. Only n − 1 of them are free to vary, and the divisor counts free pieces of information rather than raw data points.

The mistake to watch for

The word "population" appearing in a problem is not evidence. "The standard deviation of the population of fish in the lake, based on a catch of 40" is a sample calculation — 40 fish are not the lake. What matters is whether the numbers in front of you are exhaustive, not what the group is called.

Related calculators

Common questions

Should I use sample or population standard deviation?

Use population only if your numbers are the complete group you want to describe, with nothing left out. Use sample in every other case — whenever the numbers are a subset being used to say something about a wider group.

Sample is correct far more often in practice. If you genuinely cannot decide, choose sample: it produces the slightly larger, more conservative estimate.

How much difference does the choice make?

The sample variance is always larger by a factor of n/(n − 1). With n = 5 that is 25%; with n = 30 it is 3.4%; with n = 1000 it is 0.1%. The standard deviations differ by the square root of those factors, so the effect is smaller still — but on small datasets it is easily large enough to change a conclusion.

Is a class of 30 students a population or a sample?

Both, depending on your question. If you want to describe that class — the mean score in Period 3 — the 30 students are the population. If you want to use them to say something about students in general, or about how the class would do on a different test, they are a sample.

The data does not decide this. Your question does.

Which one does Excel use by default?

STDEV() and STDEV.S() are the sample version; STDEV.P() is the population version. The plain STDEV() — the one people reach for without thinking — is the sample version, which is usually the right default.

Why does dividing by n − 1 fix the bias?

A sample's mean is computed from that sample, so it sits closer to those specific points than the true population mean does. Spread measured around it is therefore too small every time, not just sometimes. The expected value of Σ(x − x̄)² turns out to be exactly (n − 1)σ², so dividing by n − 1 rather than n makes the estimate unbiased by construction.

Note the correction is exactly unbiased for the variance. Because the square root is a non-linear function, s is still very slightly biased as an estimate of σ — a subtlety that almost never matters in practice.

Written and reviewed by our editorial team. Last updated . Method and sources: how these numbers are computed.