Variance Calculator
Enter data to get the sample variance (n − 1) and population variance (N), with the squared deviations shown.
Step by step
- Mean: add the values and divide by the count: x̄ = 60 ÷ 5 = 12
- Subtract the mean from each value and square the result (table below)
- Add the squares: Σ(x − x̄)² = 90
- Divide by n − 1 = 4: variance s² = 90 ÷ 4 = 22.5
| x | x − x̄ | (x − x̄)² |
|---|---|---|
| 6 | −6 | 36 |
| 9 | −3 | 9 |
| 12 | 0 | 0 |
| 15 | 3 | 9 |
| 18 | 6 | 36 |
| Count (n) | 5 |
|---|---|
| Sum | 60 |
| Mean | 12 |
| Median | 12 |
| Mode | none |
| Minimum | 6 |
| Maximum | 18 |
| Range | 12 |
| Q1 (first quartile) | 7.5 |
| Q3 (third quartile) | 16.5 |
| Interquartile range (IQR) | 9 |
| Sample standard deviation (s) | 4.7434 |
| Population standard deviation (σ) | 4.2426 |
| Sample variance (s²) | 22.5 |
| Population variance (σ²) | 18 |
| Standard error of the mean | 2.1213 |
| Coefficient of variation | 39.53% |
| Mean absolute deviation | 3.6 |
| Sum of squares (Σ(x − x̄)²) | 90 |
| Outliers (1.5 × IQR rule) | none |
Sorted data
6, 9, 12, 15, 18
Variance formula
Population: σ² = Σ(x − μ)² ÷ N
For 6, 9, 12, 15, 18 the mean is 12 and the squared deviations add to 90, so s² = 90 ÷ 4 = 22.5 and σ² = 90 ÷ 5 = 18.
Variance vs standard deviation
Variance is measured in squared units (cm², $²), which is hard to interpret; the standard deviation is its square root and is back in the original units. Variance is still central in statistics because variances of independent variables add.
Frequently asked questions
How do you calculate variance?
Find the mean, square each value's distance from it, add the squares, and divide by n − 1 (sample) or N (population).
Why divide by n − 1?
Using n − 1 corrects the bias that comes from measuring spread around the sample mean instead of the true mean.
Is variance the square of standard deviation?
Yes: variance = SD², and SD = √variance.
Last reviewed November 2026. Results are rounded to 4 decimal places; all math runs in your browser.