Variance Calculator

Find the sample or population variance of a data set, with a table of squared deviations and both the definition and shortcut formulas.

Separate values with commas, spaces or new lines.
Treat the data as a
Sample SD (s)
2.13809
Population variance (σ²)
4
Mean
5
Sum of squares Σ(x − x̄)²
32
Count (n)
8
Sum (Σx)
40
Sum of x² (Σx²)
232
Sample variance (s²)4.571429

Show the work

  1. Mean: x̄ = Σx ÷ n = 40 ÷ 8 = 5
  2. Square each deviation from the mean and add them (table below): Σ(x − x̄)² = 32
  3. Divide by n − 1 = 7: s² = 32 ÷ 7 = 4.571429
  4. Shortcut check: Σx² − (Σx)² ÷ n = 232 − 40² ÷ 8 = 32, the same sum of squares
  5. Standard deviation is the square root: √4.571429 = 2.13809
Squared deviations from the mean
#xx − x̄(x − x̄)²
12−39
24−11
34−11
44−11
5500
6500
7724
89416
Σ40032

Variance measures how spread out a set of numbers is by averaging the squared distances from the mean. It is the building block behind standard deviation, regression, analysis of variance (ANOVA) and most of inferential statistics. Enter your data and this calculator returns the sample or population variance with every intermediate value laid out in a table.

How to use the variance calculator

  1. Paste or type at least two numbers, separated by commas, spaces or new lines.
  2. Pick Sample (s², n − 1) if your numbers are a sample from a larger group, or Population (σ², N) if they include every member of the group.
  3. Read the variance on the tape. The other version, the standard deviation, the mean and the sum of squares are listed below it, and the table shows each deviation and its square.

Variance formulas

Population variance σ² = Σ(x − μ)² ÷ N
Sample variance s² = Σ(x − x̄)² ÷ (n − 1)

The numerator, Σ(x − x̄)², is called the sum of squares (SS). A shortcut that avoids computing every deviation is

SS = Σx² − (Σx)² ÷ n

The shortcut is handy on paper, but with large numbers and few significant digits it can lose precision, so the calculator uses the deviation form and shows the shortcut only as a check.

Worked example

Take the eight values 2, 4, 4, 4, 5, 5, 7, 9.

  1. Mean: they add to 40, so x̄ = 40 ÷ 8 = 5.
  2. Deviations: −3, −1, −1, −1, 0, 0, 2, 4.
  3. Squares: 9, 1, 1, 1, 0, 0, 4, 16, which add to SS = 32.
  4. Population variance: 32 ÷ 8 = 4, so σ = 2.
  5. Sample variance: 32 ÷ 7 ≈ 4.5714, so s ≈ 2.1381.

Shortcut check: the squares of the raw values add to 232, and 232 − 40² ÷ 8 = 232 − 200 = 32, the same sum of squares.

Why divide by n − 1?

A sample’s values sit, on average, closer to their own mean than to the true population mean, because the sample mean is calculated from those very values. Dividing by n would therefore underestimate the population’s variance. Dividing by n − 1 — Bessel’s correction — removes that bias exactly. The n − 1 is also called the degrees of freedom: once you know the mean and n − 1 of the deviations, the last deviation is fixed because they must add to zero.

The difference matters for small samples. With 8 values the sample variance is 8/7, about 14%, larger than the population formula gives; with 100 values the gap is only about 1%.

Variance and standard deviation

Measure Units Typical use
Variance (s² or σ²) squared units Formulas, ANOVA, combining independent risks
Standard deviation (s or σ) original units Describing spread, z-scores, error bars

Because variances of independent quantities add, finance and engineering often work in variance and convert to standard deviation at the end. For example, if two independent processes have variances of 9 and 16, their total has variance 25 and standard deviation 5 — not 3 + 4 = 7.

For the square root with full steps, use the standard deviation calculator; to see variance alongside quartiles, skewness and more, try the descriptive statistics calculator.

Frequently asked questions

What is the difference between sample and population variance?

Population variance divides the sum of squared deviations by N, the number of values, and is used when the data cover the whole group. Sample variance divides by n − 1 and is used when the data are a sample from a larger group; the smaller divisor corrects the tendency of a sample to understate spread.

Why are the deviations squared?

Deviations from the mean always add to zero, so they cannot be averaged directly. Squaring makes every deviation positive and gives extra weight to values far from the mean. Variance also has convenient algebra: the variances of independent quantities simply add.

Can variance be negative?

No. It is an average of squares, so the smallest possible value is 0, which happens only when every value is the same. A negative result from a hand calculation means an arithmetic slip, often from rounding in the shortcut formula.

What are the units of variance?

The square of the data's units. Heights in inches give a variance in square inches, which is hard to picture. Take the square root to get the standard deviation, which is back in inches.

Last reviewed October 2026 by the CalcFluent editorial team. How we check our calculators.