Statistics
Population and sample variance of a data set — with the mean and both standard deviations alongside.
Enter at least two numbers. Results update as you type. All calculations run locally in your browser.
—
—
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.
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.
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.
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.
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.
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.
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).
Yes, when every value is identical — there is no spread at all. It can never be negative, since it is an average of squares.
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.
Results are estimates only and do not constitute professional advice.