# Sample vs Population Standard Deviation: Why n − 1, and When It Matters

Dividing by n − 1 instead of n is not a convention or a safety margin. It corrects a specific, provable bias. Here is the same dataset both ways, the size of the error at every sample size, and the software defaults that silently pick for you.

---

- **Canonical URL:** https://dothecalculation.com/blog/math/sample-vs-population-standard-deviation
- **Category:** Math
- **Author:** Do The Calculation Team
- **Published:** 2026-08-03
- **Reading time:** 11 min read
- **Publisher:** Do The Calculation (https://dothecalculation.com)
- **Methodology:** https://dothecalculation.com/methodology

---

## Sample vs Population Standard Deviation

Two formulas, one difference: the denominator. The population version divides the sum of squared deviations by N. The sample version divides by n − 1. Everything else is identical, and the choice is not stylistic.

The rule is about what your data represents, not how much of it you have. If your numbers are the entire group you care about, use N. If they are a subset standing in for a larger group, use n − 1. A census of a 30-person department uses N. A survey of 3,000 voters uses n − 1.

Tool: [Try the standard deviation calculator](https://dothecalculation.com/calculators/standard-deviation-calculator) — Paste a dataset and toggle between sample and population mode to see both results and the full working.

## The two formulas

**Population and sample standard deviation**

```
σ = √( Σ(xᵢ − μ)² / N )    ·    s = √( Σ(xᵢ − x̄)² / (n − 1) )
```
- μ is the true mean of the whole population; x̄ is the mean of your sample.
- The numerator, the sum of squared deviations, is computed identically in both.
- Because n − 1 is smaller than n, the sample version always returns the larger number.

## The same eight numbers, both ways

Eight test scores: 72, 85, 78, 90, 66, 81, 94, 74. They sum to 640, so the mean is 80.

**Squared deviations from the mean of 80**
| Score | Deviation | Squared |
| --- | --- | --- |
| 72 | −8 | 64 |
| 85 | +5 | 25 |
| 78 | −2 | 4 |
| 90 | +10 | 100 |
| 66 | −14 | 196 |
| 81 | +1 | 1 |
| 94 | +14 | 196 |
| 74 | −6 | 36 |
| Total | 0 | 622 |

**Both results from the same sum of 622**

```
σ = √(622 / 8) = √77.75 = 8.818    ·    s = √(622 / 7) = √88.857 = 9.426
```
- The sample figure is 6.9% larger than the population figure.
- The deviations always sum to zero, which is a useful check that you took the mean correctly.

> **What those two numbers claim** — The 8.818 says: these eight scores, considered as the whole story, vary by about 8.8 points. The 9.426 says: given these eight, my best unbiased estimate of the spread in the class they came from is about 9.4 points. Different questions, different answers.

## Why n − 1 is a correction, not a fudge

When you compute deviations from the sample mean rather than the true population mean, you understate the spread. Not sometimes: always, on average. The reason is that the sample mean sits wherever your particular sample happens to sit, and by construction it is the point that minimises the sum of squared deviations for that sample.

Any other centre, including the true population mean, would give a larger sum of squares. So using x̄ pulls the number down every time, and dividing by n leaves an estimate that is systematically too small. Dividing by n − 1 corrects exactly that shortfall.

The n − 1 is the degrees of freedom. Once you know the mean and any seven of the eight scores, the eighth is determined, because the deviations must sum to zero. Only seven of the eight deviations carry independent information, so you divide by seven.

> **The name** — This adjustment is called Bessel's correction. It makes the sample variance an unbiased estimator of the population variance. Note the wording: the variance is unbiased, and the standard deviation, being a square root, is still very slightly biased low. That residual bias is small enough to ignore in practice and nobody corrects for it.

## How much the choice actually changes the answer

The gap depends only on n, and it shrinks fast. The sample figure exceeds the population figure by a factor of √(n / (n − 1)).

**How much larger the sample result is**
| n | Correction factor | Sample result is larger by |
| --- | --- | --- |
| 3 | 1.2247 | 22.5% |
| 5 | 1.1180 | 11.8% |
| 8 | 1.0690 | 6.9% |
| 10 | 1.0541 | 5.4% |
| 30 | 1.0172 | 1.7% |
| 100 | 1.0050 | 0.5% |
| 1,000 | 1.0005 | 0.05% |

Past about n = 100 the distinction is academic for reporting purposes. Below n = 10 it is large enough to change a conclusion. That is exactly the range where small studies, pilot batches, and quality samples live, which is why the correction matters most precisely where people are most casual about it.

## Deciding which one you need

**Common cases**
| Your data | Use | Why |
| --- | --- | --- |
| Every employee in your company | Population, N | There is no wider group you are inferring about |
| A survey of 400 customers | Sample, n − 1 | You are estimating all customers |
| All 12 monthly sales figures for the year | Population, N | The year is complete and is the thing being described |
| 12 months used to forecast next year | Sample, n − 1 | You are treating the year as a draw from a process |
| Every measurement from a finished production run | Population, N | Describing that run |
| Hourly samples from an ongoing process | Sample, n − 1 | Estimating the process, not the samples |
| Exam scores for a single class you teach | Either, state which | Depends on whether the class is the subject or a stand-in |

The last row is honest rather than evasive. The same numbers can be a population or a sample depending on the question. If you are reporting how this class did, the class is the population. If you are asking what the material does to students generally, the class is a sample. Say which you meant.

## The software defaults that choose for you

Most tools default to one or the other silently, and they do not agree with each other. This is a genuine source of mismatched numbers between a spreadsheet and a script.

**What each tool does by default**
| Tool | Sample (n − 1) | Population (N) | Default |
| --- | --- | --- | --- |
| Excel and Google Sheets | STDEV.S, VAR.S | STDEV.P, VAR.P | No default, you must pick |
| Excel legacy names | STDEV | STDEVP | Still supported |
| Python statistics module | stdev | pstdev | No default, you must pick |
| NumPy | np.std(x, ddof=1) | np.std(x) | Population |
| pandas | series.std() | series.std(ddof=0) | Sample |
| R | sd(x) | no built-in | Sample |
| Most calculators, 1-Var Stats | Sx | σx | Both shown |

> **The NumPy and pandas trap** — NumPy defaults to the population formula and pandas defaults to the sample formula. Running np.std on a column and .std() on the same column returns two different numbers, and neither warns you. If a notebook and a spreadsheet disagree by a few percent on a small dataset, check this first.

## Where the choice propagates

Standard deviation rarely stops at itself. It feeds confidence intervals, t-tests, control limits, z-scores, and coefficient of variation. Using the population formula on sample data makes every one of those downstream numbers too narrow or too confident.

On the eight scores above, a 95% confidence interval for the mean built on s = 9.426 with seven degrees of freedom spans roughly 72.1 to 87.9. Built incorrectly on σ = 8.818 with a normal critical value, it spans about 73.9 to 86.1: nearly two points narrower on each side, from an error that looked like a rounding difference.

Tool: [Try the confidence interval calculator](https://dothecalculation.com/calculators/confidence-interval-calculator) — See how the interval width responds to the standard deviation, the sample size, and the confidence level.

## What this does not tell you

- Bessel's correction fixes bias, not small-sample unreliability. With n = 5, the estimate is unbiased on average and still wildly variable from one sample to the next.
- It assumes the sample is random and independent. A biased sample gives a biased spread no matter which denominator you use, and no correction repairs that.
- Standard deviation is a poor summary for skewed or multi-modal data. Two datasets can share a mean and a standard deviation and look nothing alike.
- It is sensitive to outliers, because deviations are squared. One extreme value can dominate the result, and neither formula protects you.
- For finite populations sampled without replacement, a further finite population correction applies, which this article ignores.
- The confidence interval figures above assume approximate normality, which is a strong assumption at n = 8.

**Which should I use if I am not sure?**

Use the sample formula. Most real data is a sample of something, and the sample formula is the conservative choice: it reports slightly more spread rather than less. Understating uncertainty is the more damaging error.

**Does n − 1 matter with large datasets?**

Not numerically. At n = 1,000 the two differ by 0.05%, well below the precision of anything you would report. It still matters conceptually, because it signals whether you are describing your data or inferring beyond it.

**Why does the sample version give a bigger number?**

Because dividing by a smaller denominator produces a larger quotient, and that is the intended effect. Deviations measured from the sample mean understate the true spread, so the correction inflates the result back to an unbiased level.

**What is a degree of freedom, concretely?**

The number of values that could still vary once you have fixed what you already know. Fix the mean of eight numbers and seven of them, and the eighth has only one possible value. Seven pieces of independent information, so seven degrees of freedom.

**Can I convert between the two after the fact?**

Yes, if you know n. Multiply the population figure by √(n / (n − 1)) to get the sample figure, or divide to go the other way. On the eight scores, 8.818 × 1.0690 = 9.426.

**Why did my spreadsheet and my Python script disagree?**

Almost certainly the NumPy default. np.std uses the population formula unless you pass ddof=1, while STDEV.S in a spreadsheet uses the sample formula. On a small dataset the gap is several percent and looks like a bug elsewhere.

---

_Source: [Do The Calculation](https://dothecalculation.com/blog/math/sample-vs-population-standard-deviation). Quote freely with attribution and a link to this page._
