Variance Calculator

Variance measures spread: the average squared distance from the mean. Paste a list of numbers and choose sample or population.

Answer

Sample variance s²

4.571429

Mean5
Std. deviation2.13809
Count8
23456789mean 5

Each square's side is a value's distance from the mean. The dashed square is their average area, the variance (4); its side is the standard deviation (2).

Why this answer

  1. Mean. Add the 8 values and divide by 8: 40 ÷ 8 = 5.
  2. Distances from the mean, squared. −3² = 9, −1² = 1, −1² = 1, −1² = 1, 0² = 0, 0² = 0, 2² = 4, 4² = 16. Squaring makes every distance positive and weights far values more.
  3. Add them. Sum of squares = 32.
  4. Average them. Divide by n − 1 = 7: 32 ÷ 7 = 4.571429. Dividing by n − 1 corrects for a sample's mean sitting closer to its own data than the true mean does.
  5. Standard deviation is the square root: √4.571429 = 2.13809, back in the data's own units.

Put it to use

Sample or population?

  • Population: you have every value you care about (all 25 students in a class).
  • Sample: your values are a subset used to estimate a bigger group (a survey of 25 voters). This is the usual case.
  • The picture uses the population average (÷ n) for the dashed square.
  • See the spread as a standard deviation with the Standard Deviation Calculator.

How it works

Variance measures spread as the average squared distance from the mean. Values far from the mean count heavily because their distances get squared. The result is in squared units, such as square dollars or square minutes.

Enter your numbers separated by commas, spaces, or new lines. Anything that isn't a number is skipped, and the page tells you what it skipped. The calculator finds the mean, squares each value's distance from it, and adds those squares to get the sum of squares.

Then it divides. The page starts on Sample (n − 1), which gives s². Switch to Population (n) for σ² when your list covers the whole group. The answer also shows the mean, the standard deviation (the square root of the variance), and the count.

Sum of squares: SS = Σ(x − x̄)²Sample variance: s² = SS ÷ (n − 1)Population variance: σ² = SS ÷ nStandard deviation = √variance

Worked example: Sample variance of 4, 7, 9, 10, 15

  1. Mean: (4 + 7 + 9 + 10 + 15) ÷ 5 = 45 ÷ 5 = 9.
  2. Deviations: −5, −2, 0, 1, 6. Squares: 25, 4, 0, 1, 36.
  3. Sum of squares: 25 + 4 + 0 + 1 + 36 = 66.
  4. Sample variance: 66 ÷ (5 − 1) = 66 ÷ 4 = 16.5.
  5. For comparison, population variance is 66 ÷ 5 = 13.2, and the sample standard deviation is √16.5 ≈ 4.062.

Common mistakes

  • Dividing by the wrong count. Sample variance uses n − 1, and population variance uses n.
  • Reporting variance in the data's own units. Variance is in squared units; take the square root if you need the spread in original units.
  • Squaring the values instead of their distances from the mean. Σx² is not the same as Σ(x − x̄)².
  • Rounding the mean early. Keep full precision until the last step, or small errors pile up in the squares.

Frequently asked questions

What is the difference between variance and standard deviation?

Standard deviation is the square root of variance. Variance is in squared units, while standard deviation is back in the data's own units, which makes it easier to interpret.

Why square the deviations instead of using absolute values?

Squaring makes every distance positive and gives extra weight to values far from the mean. It also has neat mathematical properties, such as variances of independent quantities adding together.

Can variance be zero?

Yes, when every value is identical. Variance can never be negative.

Does variance need at least two values?

Sample variance does, because you divide by n − 1. Population variance works with one value but is always 0 in that case.