Variance measures how spread out a set of numbers is by averaging the squared distances from the mean. It is the building block behind standard deviation, regression, analysis of variance (ANOVA) and most of inferential statistics. Enter your data and this calculator returns the sample or population variance with every intermediate value laid out in a table.
How to use the variance calculator
- Paste or type at least two numbers, separated by commas, spaces or new lines.
- Pick Sample (s², n − 1) if your numbers are a sample from a larger group, or Population (σ², N) if they include every member of the group.
- Read the variance on the tape. The other version, the standard deviation, the mean and the sum of squares are listed below it, and the table shows each deviation and its square.
Variance formulas
The numerator, Σ(x − x̄)², is called the sum of squares (SS). A shortcut that avoids computing every deviation is
The shortcut is handy on paper, but with large numbers and few significant digits it can lose precision, so the calculator uses the deviation form and shows the shortcut only as a check.
Worked example
Take the eight values 2, 4, 4, 4, 5, 5, 7, 9.
- Mean: they add to 40, so x̄ = 40 ÷ 8 = 5.
- Deviations: −3, −1, −1, −1, 0, 0, 2, 4.
- Squares: 9, 1, 1, 1, 0, 0, 4, 16, which add to SS = 32.
- Population variance: 32 ÷ 8 = 4, so σ = 2.
- Sample variance: 32 ÷ 7 ≈ 4.5714, so s ≈ 2.1381.
Shortcut check: the squares of the raw values add to 232, and 232 − 40² ÷ 8 = 232 − 200 = 32, the same sum of squares.
Why divide by n − 1?
A sample’s values sit, on average, closer to their own mean than to the true population mean, because the sample mean is calculated from those very values. Dividing by n would therefore underestimate the population’s variance. Dividing by n − 1 — Bessel’s correction — removes that bias exactly. The n − 1 is also called the degrees of freedom: once you know the mean and n − 1 of the deviations, the last deviation is fixed because they must add to zero.
The difference matters for small samples. With 8 values the sample variance is 8/7, about 14%, larger than the population formula gives; with 100 values the gap is only about 1%.
Variance and standard deviation
| Measure | Units | Typical use |
|---|---|---|
| Variance (s² or σ²) | squared units | Formulas, ANOVA, combining independent risks |
| Standard deviation (s or σ) | original units | Describing spread, z-scores, error bars |
Because variances of independent quantities add, finance and engineering often work in variance and convert to standard deviation at the end. For example, if two independent processes have variances of 9 and 16, their total has variance 25 and standard deviation 5 — not 3 + 4 = 7.
For the square root with full steps, use the standard deviation calculator; to see variance alongside quartiles, skewness and more, try the descriptive statistics calculator.
Frequently asked questions
What is the difference between sample and population variance?
Population variance divides the sum of squared deviations by N, the number of values, and is used when the data cover the whole group. Sample variance divides by n − 1 and is used when the data are a sample from a larger group; the smaller divisor corrects the tendency of a sample to understate spread.
Why are the deviations squared?
Deviations from the mean always add to zero, so they cannot be averaged directly. Squaring makes every deviation positive and gives extra weight to values far from the mean. Variance also has convenient algebra: the variances of independent quantities simply add.
Can variance be negative?
No. It is an average of squares, so the smallest possible value is 0, which happens only when every value is the same. A negative result from a hand calculation means an arithmetic slip, often from rounding in the shortcut formula.
What are the units of variance?
The square of the data's units. Heights in inches give a variance in square inches, which is hard to picture. Take the square root to get the standard deviation, which is back in inches.