Variance Calculator

Enter data to get the sample variance (n − 1) and population variance (N), with the squared deviations shown.

Your data is a

Sample variance (s²)22.5
Population variance (σ²)18
Mean12
Count (n)5
mean681012141618
values mean mean ± 1 SD box plot (Q1–Q3, median)

Step by step

  1. Mean: add the values and divide by the count: x̄ = 60 ÷ 5 = 12
  2. Subtract the mean from each value and square the result (table below)
  3. Add the squares: Σ(x − x̄)² = 90
  4. Divide by n − 1 = 4: variance s² = 90 ÷ 4 = 22.5
xx − x̄(x − x̄)²
6−636
9−39
1200
1539
18636
Count (n)5
Sum60
Mean12
Median12
Modenone
Minimum6
Maximum18
Range12
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 mean2.1213
Coefficient of variation39.53%
Mean absolute deviation3.6
Sum of squares (Σ(x − x̄)²)90
Outliers (1.5 × IQR rule)none
Sorted data

6, 9, 12, 15, 18

Variance formula

Sample: s² = Σ(x − x̄)² ÷ (n − 1)
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.