Variance Calculator

StatisticsLast updated: August 17, 2026

Variance is the average of the squared deviations of the values from their mean, and it measures how widely a distribution is spread out. The larger the variance, the further the values sit from the mean; a variance of zero means every value is identical. The standard deviation is the square root of the variance and is interpreted in the unit of the data itself.

This calculator returns both the sample variance (with the n−1 denominator, used for research data) and the population variance (with the n denominator), together with the mean and the standard deviation. A step table showing each value's deviation and squared deviation lets you check a hand calculation line by line.

Both decimal points and decimal commas are accepted (e.g. 3.14 or 3,14). At least 2 values are required.

Formula

Sample variance:     s² = Σ(xᵢ − x̄)² / (n − 1)
Population variance: σ² = Σ(xᵢ − μ)² / n
Standard deviation = √variance

The most common mistake is picking the wrong denominator: if your data is a sample (a survey, an experiment, a set of measurements), divide by n−1 (Bessel's correction); divide by n only when you have measured the entire population without exception.

How to Calculate

  1. Paste your data values into the box — separate them with commas, spaces, or line breaks.
  2. Choose whether your data is a sample (n−1 denominator) or the entire population (n denominator).
  3. Read the variance, the standard deviation, and the mean in the results section.
  4. Use the step-by-step table to check the deviation and the squared deviation of every value.

Worked Examples

Sample variance of exam scores

The mean of the scores 70, 75, 80, 85, 90 is 80. The sum of squared deviations is 100 + 25 + 0 + 25 + 100 = 250; divided by n − 1 = 4 this gives a sample variance of 62.5 and a standard deviation of √62.5 ≈ 7.91.

Sample variance (s²): 62.5000 · Sample standard deviation (s): 7.9057 · Mean (x̄): 80.0000

Population variance of the same data

If these five scores make up the whole class (the population), the same sum of squares, 250, is divided by n = 5 instead: the population variance is 50 and the population standard deviation is √50 ≈ 7.07. The choice of denominator visibly changes the result.

Population variance (σ²): 50.0000 · Population standard deviation (σ): 7.0711 · Mean (x̄): 80.0000

A classic textbook example

For the data 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5; the sum of squared deviations is 32, and dividing by n = 8 gives a population variance of exactly 4 and a standard deviation of 2. Had the sample option been selected, the same sum of 32 would be divided by n − 1 = 7 and the variance would come out somewhat larger.

Population variance (σ²): 4.0000 · Population standard deviation (σ): 2.0000 · Mean (x̄): 5.0000

Frequently Asked Questions

Why is variance divided by n−1 instead of n?
Because the sample mean is itself an estimate of the population mean, the deviations come out systematically a little too small. Dividing by n−1 (Bessel's correction) removes that bias and gives an unbiased estimate of the population variance. If you have measured the entire population, no correction is needed and you divide by n.
What is the difference between variance and standard deviation?
The standard deviation is the square root of the variance. Variance is expressed in the square of the data's unit (points², for example), which makes it hard to interpret directly; the standard deviation is in the unit of the data itself and is therefore preferred for reporting. Variance is what gets used inside mathematical procedures such as ANOVA and regression.
Can variance be negative?
No. Variance is built from a sum of squared deviations, so it is always 0 or positive. When every value is identical the variance is exactly 0. If a hand calculation produces a negative number there is an arithmetic error, usually deviations summed without being squared first.
Which Excel function gives the same result?
With Sample selected the result matches VAR.S (and STDEV.S for the standard deviation); with Population selected it matches VAR.P (and STDEV.P). SPSS and R use the sample formula (n−1) by default.
How much does a single outlier affect the variance?
A great deal. Because deviations are squared, one value far from the mean inflates the variance dramatically. With outlier-prone data it is wise to look at robust measures of spread such as the interquartile range (IQR) alongside the variance.
Can I compare the variability of two data sets using variance?
For sets with the same unit and similar means, yes: the one with the larger variance is more spread out. When the units or the means differ substantially, the coefficient of variation (CV = standard deviation / mean × 100) gives a fairer comparison.