IQR Calculator

Variance Calculator

The mean squared deviation. Standard deviation before the square root is taken.

Variance calculatorRuns entirely in your browser
Separate values with commas, spaces or line breaks. Paste a column straight from a spreadsheet.
Try:
Data represents
ResultExclusive method · n = 8
Sample variance (s²)27.428571192 ÷ 7mean squared deviation from the mean
Count
n = 8
Mean
18
Sum of squares
192
Divisor
n − 1 = 7
Variance s²
27.428571
Std dev s
5.237229

The other convention, for comparison

Population σ²
24

How we calculated it

Find the mean
x̄ = 144 ÷ 8 = 18
Subtract the mean from each value, then square it
See the deviation table below for every row.
Σ(x − x̄)² = 192
Divide by n − 1
s² = 192 ÷ 7 = 27.428571
The n − 1 divisor (Bessel’s correction) compensates for using the sample mean rather than the unknown population mean.

Deviation table

xx − x̄(x − x̄)²
10-864
12-636
23525
23525
16-24
23525
2139
16-24
Total192

The formulas

Population: σ² = Σ(x − μ)² ÷ N Sample: s² = Σ(x − x̄)² ÷ (n − 1) The only difference is the divisor. Use n − 1 when your data is a sample from a larger group.

Variance is the mean squared deviation from the mean. Take the square root and you have the standard deviation; the two carry identical information in different units.

The units problem

Squaring the deviations squares the units too. Variance on a set of heights in centimetres comes out in square centimetres — a quantity with no physical meaning. That is the main reason reports quote standard deviations instead.

Variance earns its keep in the mathematics rather than the reporting. It adds: the variance of a sum of independent variables is the sum of their variances, which is not true of standard deviations. That property is what makes variance the natural currency of analysis of variance, portfolio theory and error propagation.

Why the sample divisor is n − 1

A sample's values cluster more tightly around their own mean than around the unknown population mean, because the sample mean is computed from those very values. Dividing by n would therefore underestimate the population variance consistently — not occasionally, but on average, every time. Using n − 1 removes that bias exactly.

The intuition: once you know the mean and n − 1 of the deviations, the last one is determined, since the deviations must sum to zero. Only n − 1 of them are free to vary.

Worked example

Both divisors on the same data

Data: 10, 12, 23, 23, 16, 23, 21, 16

Mean = 18. Sum of squared deviations = 192.

  • Population variance σ² = 192 ÷ 8 = 24
  • Sample variance s² = 192 ÷ 7 ≈ 27.4286

The sample figure is always the larger of the two, because the divisor is always smaller.

Questions

Can variance be negative?

No. It averages squared quantities, so it is always zero or positive. Zero variance means every value is identical.