calcmintly← Back to all tools

Statistics

Variance Calculator

Population and sample variance of a data set — with the mean and both standard deviations alongside.

Your data

Enter at least two numbers. Results update as you type. All calculations run locally in your browser.

Population variance

—

Sample variance: —Mean: —SD (pop / sample): —

—

Formula

First the mean x̄ = (sum of values) ÷ n. Then the sum of squared deviations SS = Σ(x − x̄)². Population variance (when the data is the whole group) is SS ÷ n; sample variance (when the data is a sample from a larger group) is SS ÷ (n − 1). Standard deviation is the square root of variance, back in the original units. The n − 1 divisor (Bessel's correction) compensates for the fact that a sample's own mean sits closer to its points than the true mean does.

Worked example

2, 4, 4, 4, 5, 5, 7, 9: the sum is 40 and n = 8, so the mean is 5. The squared deviations are 9, 1, 1, 1, 0, 0, 4, 16, summing to SS = 32. Population variance = 32 ÷ 8 = 4.00 (SD 2.00); sample variance = 32 ÷ 7 = 4.57 (SD 2.14). The sample figure is larger because it divides by the smaller number — the standard adjustment when generalising from a sample to a population.

Scope and limitations

This page describes spread only; it says nothing about the shape of the distribution, outliers, or whether the mean is a good summary. Variance is in squared units (square dollars, square centimetres), which is why standard deviation is usually the reported figure — it returns to the original units. A single extreme value inflates variance a lot, so for skewed data consider the median and interquartile range alongside. Sample variance needs at least two values; with one value it is undefined.

FAQ

Which variance do I use, population or sample?

Population when your data is everyone you care about (all employees, all products tested). Sample when your data is a subset meant to stand for a larger group (a survey, a trial batch). Most real-world analysis uses the sample version.

Why divide by n − 1 for a sample?

Because the sample mean is itself fitted to the data, the squared deviations around it are systematically a little too small. Dividing by n − 1 instead of n corrects that bias on average — Bessel's correction.

Why square the deviations at all?

Because plain deviations sum to zero by definition of the mean — positives cancel negatives. Squaring makes every deviation positive before averaging, and it also penalises large deviations more than small ones.

What is the difference between variance and standard deviation?

Standard deviation is the square root of variance. Variance is the mathematically convenient quantity; standard deviation is the interpretable one, because it is back in the original units (dollars, centimetres, points).

Can variance be zero?

Yes, when every value is identical — there is no spread at all. It can never be negative, since it is an average of squares.

Does variance tell me about outliers?

Indirectly: a large variance relative to the mean often signals outliers or a wide spread, but variance alone cannot identify them. Look at the sorted values and the range alongside.

Related tools

Results are estimates only and do not constitute professional advice.