LonghandMath calculators

Variance Calculator

Enter your numbers separated by commas or spaces to get the sample variance and the population variance. The calculator shows the mean, a table of each deviation and squared deviation, a shortcut check, and the standard deviation.

What is variance?

Variance measures how spread out a set of numbers is. It is the average of the squared distances from the mean. A small variance means the values cluster closely around the mean, and a large variance means they are widely scattered. Because the distances are squared, variance is measured in squared units.

Variance formulas

TypeFormulaUse when
Population varianceσ² = Σ(x − μ)² ÷ nYou have every value in the group
Sample variances² = Σ(x − x̄)² ÷ (n − 1)You have a sample from a larger group
Shortcut (population)σ² = Σx² ÷ n − μ²Checking your work

How to calculate variance step by step

  1. Find the mean of the values.
  2. Subtract the mean from each value to get its deviation.
  3. Square each deviation.
  4. Add the squared deviations to get the sum of squares.
  5. Divide by n for a population, or by n − 1 for a sample.

Worked examples

A data set: 2, 4, 4, 4, 5, 5, 7, 9

The mean is 5. The squared deviations are 9, 1, 1, 1, 0, 0, 4 and 16, which add up to 32. The population variance is 32 ÷ 8 = 4, and the sample variance is 32 ÷ 7 ≈ 4.571.

The numbers 1 to 5

The mean is 3 and the sum of squares is 10. The population variance is 2, and the sample variance is 2.5. The shortcut check agrees: Σx² = 55, and 55 ÷ 5 − 3² = 2.

Scaling the data: 2, 4, 6, 8, 10

These are the numbers 1 to 5 doubled. The population variance is 8, which is 4 times larger than 2. Multiplying every value by c multiplies the variance by c².

Properties of variance

Sample or population variance?

Dividing by n − 1 for a sample is called Bessel’s correction. A sample tends to sit closer to its own mean than to the true population mean, so dividing by n slightly underestimates the spread. Use the population version only when your data is the whole group. When unsure, the sample version is the usual default in statistics courses.

Variance vs standard deviation

Variance is convenient in formulas because squared deviations add up neatly. Standard deviation is easier to interpret because it returns to the original units. If your data is in meters, the variance is in square meters, but the standard deviation is in meters. For that version, with the empirical rule and standard error, use the standard deviation calculator.

Common variance mistakes

The usual error is using n when you should use n − 1, or the reverse. Others are forgetting to square the deviations, so that the positives and negatives cancel to zero, and reporting variance in the original units. Check for outliers first with the mean, median and mode calculator, because squaring makes variance very sensitive to extreme values.

Frequently asked questions

What is variance?

Variance is the average of the squared differences between each value and the mean. It measures how spread out the data is. A variance of zero means every value is identical, and larger values mean the data is more scattered around the mean.

What is the difference between sample and population variance?

Population variance divides the sum of squared deviations by n and applies when you have every member of the group. Sample variance divides by n − 1 and applies when your data is a sample used to estimate a larger group.

Why do we square the deviations?

Deviations above and below the mean cancel out if you simply add them, always giving zero. Squaring makes every term positive and gives extra weight to values far from the mean, so the result reflects the spread.

What is the difference between variance and standard deviation?

Standard deviation is the square root of variance. Variance is in squared units, such as square meters, while standard deviation is in the original units. Variance is easier to use in formulas, and standard deviation is easier to interpret.

Can variance be negative?

No. Variance is a sum of squares divided by a positive number, so it is always zero or positive. A negative result means there is an arithmetic error. The smallest possible variance is zero, when all values are the same.

How does adding or multiplying the data change the variance?

Adding a constant to every value shifts the data but does not change its spread, so the variance stays the same. Multiplying every value by c multiplies the variance by c². Doubling all values makes the variance four times larger.

More Statistics calculators

Browse every statistics calculator.

Other calculators

Related topics on this page: sample variance, population variance, sum of squares, deviation from the mean, Bessel's correction, standard deviation, ANOVA