Sample vs. Population Variance: What's the Difference?
One of the most common questions about variance is whether to use the sample or the population formula. Choosing the wrong one gives a misleading answer, especially for small data sets. This guide explains the difference and the reasoning behind it.
The Core Difference
The distinction is about what your data represents:
- Population variance (σ²): use it when your data contains every member of the group you are studying. For example, you are describing the heights of one class of 15 students and you have measured all 15.
- Sample variance (s²): use it when your data is a subset of a larger group you want to draw conclusions about. For example, you measure 100 students to estimate the spread of heights of all students in a city.
The Formulas
Both use the sum of squared deviations from the mean. They differ in the denominator:
- Population variance: σ² = Σ(xᵢ − μ)² / N
- Sample variance: s² = Σ(xᵢ − x̄)² / (n − 1)
Dividing by n − 1 instead of n is called Bessel’s correction.
Worked Example
Five students’ heights, in centimetres: 162, 170, 158, 175, 165.
- The mean is 830 / 5 = 166.
- Deviations: −4, 4, −8, 9, −1.
- Squared deviations: 16, 16, 64, 81, 1. The sum of squares is 178.
- If these five students are the whole group you are describing: σ² = 178 / 5 = 35.6, so σ ≈ 5.967 cm.
- If they are a sample from a larger school: s² = 178 / 4 = 44.5, so s ≈ 6.671 cm.
Why Subtract 1?
A sample’s deviations are measured from the sample mean, and the sample mean always sits in the middle of that particular sample. The true population mean is usually a bit further away. So squared deviations from the sample mean tend to be slightly too small, and dividing by n would underestimate the population’s spread.
Dividing by the smaller number n − 1 enlarges the result just enough to cancel that bias on average. The result is an unbiased estimator of the population variance.
Summary Table
| Sample variance | Population variance | |
|---|---|---|
| Symbol | s² | σ² |
| Data | A subset of the group | The entire group |
| Denominator | n − 1 (Bessel’s correction) | N |
| Purpose | Estimate the spread of a larger group | Describe the group exactly |
| Minimum data | 2 values | 1 value |
Which One Should You Use?
In most research and data analysis, sample variance is the right choice, because it is rarely possible to measure an entire population (all smartphone users, every oak tree in a forest, every part a factory will ever make). Use population variance only when you genuinely have every value.
The variance calculator gives both results, with the working for each, so you can see how much the choice matters for your data.