Variance Calculator

Variance Calculator

Paste your data to get both the sample and population variance, with the sum of squares worked out by the definition and by the shortcut formula so you can check your own working.

s² = Σ(x − x̄)² ÷ (n − 1) · σ² = Σ(x − μ)² ÷ N

Separate with commas, spaces or new lines.

Enter at least two numbers to see their variance

What is Variance?

Variance is the average of the squared distances from the mean. It's 0 when every value is the same and grows as the data spreads out. Its square root is the standard deviation.

Because it's built from squares, variance is in squared units (cm², £², seconds²), which makes it hard to picture. Most people report the standard deviation instead. Variance earns its place in the maths: the variances of independent quantities add together, which is the foundation of ANOVA, regression, error propagation and portfolio risk.

Use the sample variance (divide by n − 1) when your data is a sample from a larger group, and the population variance (divide by N) only when you have every member of the group.

Variance Formulas

Formulas as given in the NIST/SEMATECH e-Handbook of Statistical Methods. See Sources.

1. Sum of squares, by definition

SS = Σ(x − x̄)²

2. Sum of squares, shortcut

SS = Σx² − (Σx)² ÷ n

Handy by hand because you never need the individual distances. On a computer, the definition is safer: with large values close together, the shortcut subtracts two nearly equal numbers and can lose precision.

3. Divide

Sample variance s² = SS ÷ (n − 1)
Population variance σ² = SS ÷ N

Worked Example: the Classic Eight-Value Set

Given:
The values 2, 4, 4, 4, 5, 5, 7, 9, a set used in many textbooks because the numbers come out whole.
Step 1:
Mean:
40 ÷ 8 = 5
Step 2:
Sum of squares, both ways:
Definition: 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32
Shortcut: Σx² = 232, so 232 − 40² ÷ 8 = 232 − 200 = 32
Step 3:
Divide:
σ² = 32 ÷ 8 = 4 · s² = 32 ÷ 7 = 4.571
Result:
Population variance 4, sample variance 4.571.

The population standard deviation is exactly √4 = 2.

How Shifting and Scaling Change Variance

The classic set after some simple changes. Adding a constant moves the data without spreading it; multiplying by k multiplies the variance by k². This is why converting units (cm to mm, say) multiplies the variance by 100, not 10.

Mean and population variance after shifting and scaling
ChangeMeanσ²σ
None542
Add 10 to every value1542
Multiply every value by 210164
Multiply every value by 105040020
Multiply every value by −1-542

Common Variance Mistakes

  • Mixing up Σx² and (Σx)². Σx² means square each value and then add (232 in the example). (Σx)² means add first and then square (1,600). The shortcut formula needs both, in the right places.
  • Reporting variance in the original units. A variance of 4 cm² is a standard deviation of 2 cm. Take the square root before comparing it with the data.
  • Dividing by n for a sample. That's the population formula; it underestimates the spread of the wider population the sample came from.
  • Adding standard deviations instead of variances. For independent quantities, variances add; standard deviations don't. Two independent errors with SD 3 and 4 combine to SD 5, not 7.

Variance Calculator FAQs

What is the difference between variance and standard deviation?

Standard deviation is the square root of variance. They carry the same information; the standard deviation is in the data’s own units, which makes it easier to interpret.

Why divide by n − 1 for a sample?

A sample’s values sit closer to their own mean than to the true population mean, so dividing by n would underestimate the spread on average. Dividing by n − 1 corrects that bias.

Can variance be negative?

No. It’s an average of squares, so it’s zero or positive. A negative result from the shortcut formula means a rounding or typing error.

Can the variance be bigger than the mean?

Yes. They’re in different units, so there’s no rule linking their sizes. For counts, a variance much bigger than the mean is called overdispersion.

Which Excel function should I use?

VAR.S for a sample and VAR.P for a whole population. Older versions use VAR and VARP.

What does a variance of zero mean?

Every value is identical. There is no spread at all.

Why is variance used in ANOVA and regression?

Because variances of independent sources add up. That lets the total variation in a dataset be split into parts, such as the part explained by groups or by a trend line and the part left over.

How do I find the variance of a frequency table?

Count each value as many times as its frequency, or use the population variance calculator’s frequency mode, which does this for you.

Sources

Related Tools