Statistics & Probability
Intermediate

Variance

Average squared deviation from the mean.

Formula

σ2=1n∑i=1n(xi−xˉ)2\sigma^2 = \frac{1}{n}\sum_{i=1}^{n}(x_i - \bar{x})^2

Variables

x_iData values
\bar{x}Mean
nCount

Example

For 2, 4, 6 (mean 4): σ² = (4+0+4)/3 ≈ 2.67.

How it works

Variance measures how spread out a set of values is by looking at how far each value lies from the mean, then averaging those departures after squaring them. Squaring is important because it makes all deviations positive and gives extra weight to values that are unusually far from the center. Dividing by the number of data points turns the total squared spread into a typical squared distance from the mean.

When to use it

Use variance when you want a precise numerical measure of variability in a dataset, especially in statistics, data analysis, and science. It is also the starting point for standard deviation, which is often preferred when you want spread reported in the original units.

Worked example, step by step

Data: 5, 7, 8, 10 Step 1: Find the mean. \bar{x} = (5 + 7 + 8 + 10) / 4 = 30 / 4 = 7.5 Step 2: Subtract the mean from each value. 5 - 7.5 = -2.5, 7 - 7.5 = -0.5, 8 - 7.5 = 0.5, 10 - 7.5 = 2.5 Step 3: Square each deviation. (-2.5)^2 = 6.25, (-0.5)^2 = 0.25, (0.5)^2 = 0.25, (2.5)^2 = 6.25 Step 4: Add the squared deviations. 6.25 + 0.25 + 0.25 + 6.25 = 13 Step 5: Divide by n = 4. σ² = 13 / 4 = 3.25 Final answer: the variance is 3.25.

Common mistakes to avoid

  • Using the wrong mean, which makes every deviation incorrect
  • Forgetting to square the deviations before averaging
  • Mixing up variance with standard deviation and taking the square root too early

Did You Know?

Variance squares the deviations so positives and negatives can't cancel out.

Share this formula

Reviewed & maintained by the FormulaWon editorial teamLast reviewed September 2026