Variance Calculator
Get sample and population variance from raw data, plus the sum of squares and a deviation table you can copy straight into your homework.
Variance formulas
s² = Σ(x − x̄)² ÷ (n − 1) σ² = Σ(x − μ)² ÷ N
The numerator, Σ(x − x̄)², is the sum of squares (SS). It turns up again in ANOVA and regression, where total variation is split into explained and unexplained parts, so it is worth being comfortable with it.
Worked example
For 10, 12, 23, 23, 16, 23, 21, 16 the mean is 144 ÷ 8 = 18. The squared deviations are 64, 36, 25, 25, 4, 25, 9 and 4, adding to 192. Sample variance is 192 ÷ 7 ≈ 27.43; population variance is 192 ÷ 8 = 24. Take square roots for the standard deviation: 5.237 and 4.899.
Why square the deviations?
Raw deviations always add to zero, so their average says nothing. You could use absolute values instead, which gives the mean absolute deviation. Squares win in most of statistics because they have convenient algebra: variances of independent variables add, which is the root of the standard error formula and the whole of least-squares regression.
Frequently asked questions
What is the difference between variance and standard deviation?
Variance is the average squared distance from the mean, so its units are squared (cm², dollars²). Standard deviation is the square root of the variance, which puts it back in the original units and makes it easier to interpret. They carry the same information.
When do I use sample variance (n − 1) versus population variance (n)?
Use sample variance, dividing by n − 1, when your data are a sample from a larger population. Use population variance, dividing by N, only when you have every member of the population. Most statistics coursework and all inference methods use the sample version.
What is the shortcut (computational) formula for variance?
Σ(x − x̄)² equals Σx² − (Σx)²/n, so s² = (Σx² − (Σx)²/n) ÷ (n − 1). It saves subtraction by hand but can lose precision on a computer when values are large and close together, which is why this calculator uses the deviation form.
Can variance be larger than the mean?
Yes. Variance and mean measure different things and have different units, so either can be larger. Count data with variance much bigger than the mean are called overdispersed.
How do I calculate variance in Excel?
Use =VAR.S(range) for sample variance and =VAR.P(range) for population variance.