Variance Calculator

Variance measures how spread out data is: it is the average of the squared distances from the mean. A sample variance divides by n − 1 and a population variance divides by N. This calculator works exactly with fractions, shows each squared deviation, gives the standard deviation too, and checks the result with the shortcut formula.

Try:

How to use the variance calculator

  1. Type or paste your data values.
  2. Choose sample or population.
  3. Press Calculate to see the variance and the steps.

Formula

s2=∑(x−xˉ)2n−1s^2 = \frac{\sum (x - \bar{x})^2}{n - 1}
σ2=∑(x−μ)2N\sigma^2 = \frac{\sum (x - \mu)^2}{N}

Worked example: 6, 8, 10, 12, 14 (sample)

  • Data values: 6, 8, 10, 12, 14
  • Data type: Sample (n − 1)

✓ Answer checked

s2=10s^2 = 10
Standard deviation
≈3.16227766\approx 3.16227766
Mean
1010
Sum of squared deviations
4040
0510151: 1612: 423: 034: 445: 165
Each bar is a squared deviation from the mean. The variance is their average (dividing by n − 1 for a sample).
Step-by-step working (3 steps)
  1. Mean

    Add the 5 values and divide by 5.

    xˉ=10\bar{x} = 10
  2. Squared deviations

    Square each value’s distance from the mean and add them.

    ∑(x−xˉ)2=40\sum (x - \bar{x})^2 = 40
  3. Divide by n − 1 Variance

    For a sample, divide by one less than the count.

    40÷4=1040 \div 4 = 10
Formulas used
s2=∑(x−xˉ)2n−1s^2 = \frac{\sum (x - \bar{x})^2}{n - 1}
σ2=∑(x−μ)2N\sigma^2 = \frac{\sum (x - \mu)^2}{N}
How this was checked
  • ✓ The shortcut formula Σx² − n·x̄² gives exactly the same sum of squares.

Frequently asked questions

What is the variance of 6, 8, 10, 12, 14 as a sample?

The mean is 10, the squared deviations add to 40, and 40 ÷ 4 = 10.

How is variance related to standard deviation?

The standard deviation is the square root of the variance.

Why divide by n − 1 for a sample?

It corrects for a sample tending to be less spread out than the whole population (Bessel's correction).

Related calculators