Variance Calculator

Calculate sample or population variance and standard deviation from a list of numbers, with mean, count, sum, and range.

Share this calculator

4.57

Sample variance

2.14

Sample std dev

5

Mean

Count8
Sum40
Minimum2
Maximum9

Also in Statistics

Statistical Spread

Variance — measuring how spread out a dataset is from its mean

A variance calculator finds how far a set of numbers are spread from their average. Variance is the average of the squared differences from the mean, and it is the foundation of standard deviation, ANOVA, and most inferential statistics. Understanding whether to use sample or population variance is the first practical decision in any data analysis.

Sample variance versus population variance

Population variance (σ²) divides the sum of squared deviations by n — the total count — and describes the exact spread of a complete, closed dataset. Sample variance (s²) divides by n − 1 instead. The reduction, known as Bessel's correction, compensates for the fact that a sample mean is calculated from the same data, which causes the raw squared deviations to slightly underestimate the true population spread.

Use sample variance whenever your data is a subset drawn from a larger population; use population variance only when you have every member of the group.

Variance and standard deviation formulas

Standard deviation is simply the square root of variance. Variance is expressed in squared units (e.g. metres² if your data is in metres), which makes it less intuitive for direct interpretation. Taking the square root returns the spread to the original units, giving standard deviation.

Population variance: σ² = Σ(x − μ)² / n

Sum all squared deviations from the population mean, then divide by n.

Sample variance: s² = Σ(x − x̄)² / (n − 1)

Sum all squared deviations from the sample mean, then divide by n − 1 (Bessel's correction).

Standard deviation: σ (or s) = √variance

Square root of the variance, returning spread to the original units.

Step-by-step worked example

For the dataset 2, 4, 4, 4, 5, 5, 7, 9: the mean is (2+4+4+4+5+5+7+9) ÷ 8 = 40 ÷ 8 = 5. The squared deviations are (2−5)²=9, (4−5)²=1, (4−5)²=1, (4−5)²=1, (5−5)²=0, (5−5)²=0, (7−5)²=4, (9−5)²=16, totalling 32.

Population variance = 32 ÷ 8 = 4; population standard deviation = 2. Sample variance = 32 ÷ 7 ≈ 4.57; sample standard deviation ≈ 2.14.

When variance is zero or very large

Variance of zero means every value in the dataset is identical — there is no spread at all. Very large variance relative to the mean suggests outliers or a wide range. Because variance squares the deviations, a single extreme value contributes disproportionately to the total.

For datasets with suspected outliers, the interquartile range or mean absolute deviation may give a more robust picture of typical spread.

Common uses of variance

Variance appears in finance as a measure of investment risk (portfolio variance combines individual asset variances and covariances), in quality control to monitor process consistency, in experimental science to partition sources of variation (ANOVA), and in machine learning to describe model uncertainty.

Frequently asked questions

Why does sample variance divide by n − 1 instead of n?

Dividing by n − 1 (Bessel's correction) corrects for bias. Because the sample mean is estimated from the same data, the sample squared deviations are on average slightly smaller than the true population squared deviations. Dividing by n − 1 inflates the estimate just enough to make it unbiased.

Can variance be negative?

No. Variance is the average of squared values, and squares are always zero or positive. The minimum possible variance is zero, which occurs when every value in the dataset is the same.

What is the difference between variance and standard deviation?

Standard deviation is the square root of variance. They measure the same thing — spread around the mean — but variance is in squared units while standard deviation is in the same units as the original data, making it easier to interpret.

Which should I use — sample or population variance?

Use population variance when your dataset contains every member of the group you are studying. Use sample variance when your data is a sample drawn from a larger population and you want to estimate the true population spread.

Related

More from nearby categories

These related calculators come from the same leaf category, nearby sibling categories, or the same top-level topic.