Variance formulas
Sample variance
s² = Σ(x − x̄)² ÷ (n − 1)
Population variance
σ² = Σ(x − μ)² ÷ n
The top line, Σ(x − x̄)², is the sum of squares (SS). Both versions use the same sum of squares; they only divide it by different numbers.
Worked example: five quiz scores
A student scored 5, 6, 7, 8, 9 on five quizzes out of 10.
| Score x | x − 7 | (x − 7)² |
|---|---|---|
| 5 | -2 | 4 |
| 6 | -1 | 1 |
| 7 | 0 | 0 |
| 8 | 1 | 1 |
| 9 | 2 | 4 |
| Sum 35 | 0 | 10 |
- Mean: 35 ÷ 5 = 7.
- Sum of squares: 4 + 1 + 0 + 1 + 4 = 10.
- Sample variance: 10 ÷ 4 = s² = 2.5 (standard deviation 1.5811).
- Population variance: 10 ÷ 5 = σ² = 2 (standard deviation 1.4142).
If these are five quizzes picked from a whole semester, the sample variance is the right one. If they are the only five quizzes there will ever be and you only want to describe them, use the population variance.
Related tools
The standard deviation calculator runs the same steps and leads with s or σ. To compare one score against the spread, use the z-score calculator; to see the shape of the data, draw it with the histogram maker.