Variance Calculator

Enter your data and choose sample or population to find its variance.

Data is a

A sample divides by n − 1; a whole population divides by n.

Numbers separated by commas, spaces or new lines

Try

Result

You entered{1, 2, 3, 4, 5, 6, 7, 8, 9}\left\{ 1,\ 2,\ 3,\ 4,\ 5,\ 6,\ 7,\ 8,\ 9 \right\}

7.5\displaystyle 7.5

Standard deviation

2.738613\displaystyle 2.738613

Population variance

203≈6.666667\displaystyle \frac{20}{3} \approx 6.666667
Show the work
  1. Mean (arithmetic average)

    The mean shares the total out equally: add every value, then divide by how many there are. Here the values add up to 4545 and n=9n = 9.

    xˉ=∑xn=459=5\begin{aligned} \bar{x} &= \frac{\sum x}{n} \\ &= \frac{45}{9} \\ &= 5 \end{aligned}
  2. Deviations from the mean

    Subtract the mean xˉ=5\bar{x} = 5 from every value to see how far each one sits from it. A value below the mean gives a negative deviation.

    x−xˉ: −4, −3, −2, −1, 0, 1, 2, 3, 4x - \bar{x}:\ -4,\ -3,\ -2,\ -1,\ 0,\ 1,\ 2,\ 3,\ 4
  3. Sum of squared deviations

    Squaring each deviation makes every term positive, so values above and below the mean cannot cancel. Adding the squares gives SS=60SS = 60.

    SS=∑(x−xˉ)2=(−4)2+(−3)2+(−2)2+(−1)2+02+12+22+32+42=16+9+4+1+0+1+4+9+16=60\begin{aligned} SS &= \sum \left(x - \bar{x}\right)^2 \\ &= \left(-4\right)^2 + \left(-3\right)^2 + \left(-2\right)^2 + \left(-1\right)^2 + 0^2 + 1^2 + 2^2 + 3^2 + 4^2 \\ &= 16 + 9 + 4 + 1 + 0 + 1 + 4 + 9 + 16 \\ &= 60 \end{aligned}
  4. Sample variance (divide by n - 1)

    A sample is divided by n−1n - 1 rather than nn, because the mean was estimated from the same data and that makes the spread look slightly smaller. Here n=9n = 9.

    s2=SSn−1=609−1=608=7.5\begin{aligned} s^2 &= \frac{SS}{n - 1} \\ &= \frac{60}{9 - 1} \\ &= \frac{60}{8} \\ &= 7.5 \end{aligned}
  5. Result

    So the sample variance is 7.57.5.

Worked examples