Skip to content
Popular Calculators
Browse Statistics calculators

Variance Calculator

Find the sample or population variance of a list of numbers, with a table of deviations and squared deviations and the standard deviation.

Separate values with commas, spaces or new lines. You can paste a column from a spreadsheet.

Data is a (optional)

About the Variance Calculator

Variance measures how spread out a set of numbers is by averaging the squared distances of each value from the mean. It is the foundation of much of statistics: the standard deviation is its square root, analysis of variance compares it between groups, and regression, finance and quality control all build on it. Learning to calculate it by hand, and checking the result, is a core skill in any statistics course.

This variance calculator finds the sample or population variance of any list of numbers and gives both figures for comparison. It lays out a table of each value's deviation from the mean and the squared deviation, shows the sum of squares, and gives the standard deviation as well.

How to Use the Variance Calculator

Enter your numbers, separated by commas, spaces or new lines.

Choose whether the data is a sample or the whole population.

The variance appears with the table of deviations and every step of the working.

The Formulas

  mean                x̄ = Σx ÷ n
  deviation           d = x − x̄
  sum of squares      SS = Σd²

  sample variance     s² = SS ÷ (n − 1)
  population variance σ² = SS ÷ n

An equivalent shortcut, useful for large data sets, is SS = Σx² − (Σx)² ÷ n, which avoids calculating each deviation separately.

Step-by-Step Example

The values 2, 4, 4, 4, 5, 5, 7, 9.

  value   deviation   squared
    2        −3          9
    4        −1          1
    4        −1          1
    4        −1          1
    5         0          0
    5         0          0
    7         2          4
    9         4         16
                  sum = 32

The mean is 40 ÷ 8 = 5 and the sum of squared deviations is 32.

  Population variance:  32 ÷ 8 = 4
  Sample variance:      32 ÷ 7 = 4.57143

The standard deviations are √4 = 2 and √4.57143 = 2.13809.

Checking with the shortcut: Σx² = 4 + 16 + 16 + 16 + 25 + 25 + 49 + 81 = 232, and (Σx)² ÷ n = 40² ÷ 8 = 200, so SS = 232 − 200 = 32, the same.

Why Square the Deviations?

The deviations from the mean always add up to exactly zero — the positive and negative ones cancel — so their plain average says nothing about spread. Squaring makes every term positive. It also gives extra weight to values far from the mean: a deviation of 4 contributes 16, four times as much as a deviation of 2. That makes variance sensitive to outliers, which is sometimes useful and sometimes a drawback.

Sample Versus Population Variance

The population variance divides by n and describes the spread of a complete group. The sample variance divides by n − 1 and estimates the spread of a larger population from a sample. Because a sample's own mean is always the best fit to that sample, deviations around it are slightly too small; dividing by n − 1 corrects this so that, on average, the sample variance equals the true population variance.

Units and Interpretation

Variance is in squared units. If the data is in centimetres, the variance is in square centimetres; if it is in pounds, square pounds. That makes variance awkward to interpret directly, which is why the standard deviation — back in the original units — is usually reported alongside it. Variance comes into its own in calculations: the variances of independent quantities simply add, so the variance of a total of several independent measurements is the sum of their variances.

Where Variance Is Used

Variance sits at the heart of several major statistical methods.

Analysis of variance (ANOVA) compares the variance between groups with the variance within them to test whether group means differ. Regression splits the total variance into the part explained by a model and the part left over. Portfolio theory in finance uses variances and covariances of returns to measure risk. Quality control tracks process variance to keep products consistent.

Adding Variances

A useful property of variance is that, for independent quantities, variances add even though standard deviations do not. If a journey has two legs whose times vary independently with variances of 9 and 16 square minutes, the total time has a variance of 25 square minutes, and so a standard deviation of 5 minutes — not 3 + 4 =

  1. This rule underlies error propagation in science, the risk of combined investments

in finance and the tolerance stack-up of assembled parts in engineering. It is one of the main reasons statisticians work with variance, even though the standard deviation is easier to interpret.

Understanding Your Result

The headline is the variance, s² for a sample or σ² for a population.

The sample and population line gives both variances.

The table line lists each value with its deviation and squared deviation.

The sum of squares line gives SS and the mean it was measured from.

The standard deviation line gives the square root of the variance.

When Should You Use This Calculator?

Use it for statistics homework, checking each step against the table.

Use it to measure the spread of experimental results or measurements.

Use it as a step toward ANOVA, regression or other analyses.

Use it to compare the variability of different data sets.

Common Mistakes

Dividing by the wrong number. Use n − 1 for a sample and n for a population.

Forgetting to square negative deviations. Every squared deviation is positive.

Reporting variance in the original units. It is in squared units.

Rounding the mean too early. Keep full precision until the end, or small errors grow when squared.

Confusing variance with standard deviation. The SD is the square root.

Adding standard deviations of independent quantities. Add the variances first, then take the square root of the total.

Frequently Asked Questions

How do I calculate the variance?

Find the mean, subtract it from each value, square each difference, add the squares and divide. For 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5 and the squares add to 32, so the population variance is 32 ÷ 8 = 4.

What is the sample variance of the same data?

Divide the sum of squares by n − 1 instead of n: 32 ÷ 7 = 4.57143. The sample variance is always a little larger than the population variance, because it corrects for estimating the mean from the same data.

Why are the deviations squared?

Because the deviations from the mean always add up to zero, so they cannot be averaged directly. Squaring makes them all positive and gives more weight to values far from the mean, which also makes the maths convenient.

What units is variance in?

Squared units. If the data is in metres, the variance is in square metres, which is hard to interpret. That is why the standard deviation, the square root of the variance, is usually reported alongside or instead of it.

Can the variance be negative?

No. It is an average of squared numbers, so it is always zero or positive. It is zero only when every value is the same. A negative result means a calculation mistake, often subtracting in the wrong order.

Where is variance used?

In analysis of variance, regression, finance, where it measures the risk of returns, and quality control. Variances of independent quantities add together, a useful property that standard deviations do not share.

Last reviewed September 28, 2026 by the CalculatorPeak editorial team.