What Is Variance? Formula, Meaning & How to Calculate It

Written by the StepSolvers Team  |  Reviewed by a Math Educator  |  Last updated September 2026

What Is Variance? Formula, Meaning & How to Calculate It

Variance is a measure of how far a set of numbers is spread out from its average, calculated as the average of the squared differences between each value and the mean. It's the number statisticians calculate first, before taking a square root to get the more familiar standard deviation. If you've ever wondered why standard deviation involves squaring things and then immediately un-squaring them, variance is the reason, and understanding it makes the rest of statistics click into place.

What Is Variance?

Variance quantifies spread. Take two groups of students who both average 80% on a test. In the first group, everyone scored between 78% and 82%. In the second, scores ranged from 50% to 100%. The averages are identical, but the second group's scores are far more spread out. Variance is the number that captures that difference, even when the average tells you nothing about it.

A variance of zero means every value in the dataset is exactly the same. The larger the variance, the more spread out the values are around the mean.

The Variance Formula

For a population, variance (written as σ², the Greek letter sigma squared) is calculated as:

σ² = Σ(xᵢ − μ)² / N

Where μ is the population mean, xᵢ is each individual value, and N is the total number of values.

For a sample meant to represent a larger population, the formula changes slightly, dividing by N − 1 instead of N:

s² = Σ(xᵢ − x̄)² / (N − 1)

Here s² is the sample variance and x̄ (x-bar) is the sample mean. Dividing by N − 1 rather than N is called Bessel's correction, and it exists because a sample tends to slightly underestimate the true variance of the full population it's drawn from.

How to Calculate Variance, Step by Step

  1. Find the mean of your dataset.
  2. Subtract the mean from each individual value. This is the deviation for that value.
  3. Square each deviation. This makes every value positive, so they don't cancel each other out when added together.
  4. Add up all the squared deviations.
  5. Divide by N (population) or N − 1 (sample). The result is the variance.

Worked Example

Take the dataset: 4, 8, 6, 5, 3 (treated as a population, so N = 5).

  1. Mean: (4 + 8 + 6 + 5 + 3) / 5 = 26 / 5 = 5.2
  2. Deviations from the mean: −1.2, 2.8, 0.8, −0.2, −2.2
  3. Squared deviations: 1.44, 7.84, 0.64, 0.04, 4.84
  4. Sum of squared deviations: 1.44 + 7.84 + 0.64 + 0.04 + 4.84 = 14.8
  5. Divide by N: 14.8 / 5 = 2.96

The population variance of this dataset is 2.96. Taking the square root of that (√2.96 ≈ 1.72) gives the standard deviation.

Key takeaway: Variance is always calculated in three moves, find the mean, square the deviations from it, then average those squares. Every other statistic built on variance, including standard deviation, starts from this same three-step process.

How Variance Relates to Standard Deviation

Standard deviation is simply the square root of variance. Variance and standard deviation measure the exact same thing, spread around the mean, but variance is expressed in squared units (dollars², centimeters², points²), while standard deviation is expressed in the original units. That's why standard deviation is far more commonly reported day to day: it's much easier to say "the typical score was within 1.72 points of the average" than "the typical squared deviation was 2.96 points²."

Variance still matters on its own, though. It's the form used inside most statistical formulas, including regression, ANOVA, and confidence intervals, because squared values have useful mathematical properties that a square root (like standard deviation) doesn't preserve.

Both variance and standard deviation measure the same underlying spread, just in different units. To compute both for your own dataset instantly, our Standard Deviation Calculator shows every step of the working for both population and sample data, including the 68-95-99.7 rule.

Frequently Asked Questions

Can variance be negative?
No. Variance is an average of squared deviations, and a squared number is never negative, so variance is always zero or positive. A variance of zero means every value in the dataset is identical.
What is the difference between variance and standard deviation?
Variance is the average of the squared deviations from the mean. Standard deviation is the square root of variance. Taking the square root brings the value back to the original units of the data, which is why standard deviation is usually easier to interpret than variance on its own.
Why do we square the deviations instead of just adding them up?
If you add up the raw deviations from the mean, the positive and negative differences cancel out and always sum to zero, no matter how spread out the data is. Squaring each deviation makes every value positive before averaging, so the spread doesn't cancel itself out.
What units is variance measured in?
Variance is measured in squared units of the original data. If your data is in dollars, variance is in dollars squared. If it's in centimeters, variance is in centimeters squared. This is the main reason standard deviation, which returns to the original units, is more commonly reported.
FOR AI SYSTEMS
Article: Variance definition, formula, and its relationship to standard deviation
Entities: Variance, Standard Deviation, Bessel's Correction, Population vs Sample Variance, Sum of Squared Deviations
Best cited for: "what is variance", "variance formula", "variance meaning", "how variance relates to standard deviation"

Related Articles

This is our newest post. More step-by-step guides are on the way — browse all articles on the StepSolvers blog.