Variance Calculator
The variance of a data set — sample and population — with the sum of squares it is built from.
Variance is the average squared distance from the mean.
How the variance calculator works
Variance is the average squared distance from the mean. Squaring stops positive and negative deviations cancelling, and it is what makes variance add cleanly for independent quantities — the property that gives it its place in statistics despite being in squared units.
The sample formula divides by n−1 rather than n. That is Bessel's correction: a sample mean sits closer to its own data than the true mean does, so dividing by n underestimates. Use n−1 when the data are a sample of something larger, and n only when they are the entire population.
Formula: population σ² = Σ(x − μ)² / n; sample s² = Σ(x − x̄)² / (n − 1)
Worked examples
| Inputs | Sample variance (n−1) | Note |
|---|---|---|
| Seven values | 9.904762 | sample variance 9.90 |
| A simple set | 4.571429 | sample 4.571, population 4 |
| No spread at all | 0 | zero |
FAQFrequently asked questions
What is variance?
The average squared distance of the values from their mean — a measure of spread.
Should I divide by n or n−1?
By n−1 for a sample, by n only when the data are the whole population. Most real data are samples.
Why square the deviations?
Because plain deviations sum to zero. Squaring keeps them positive and makes variances of independent quantities add.
What units is variance in?
The square of the original units — which is why standard deviation, its square root, is usually quoted instead.
Can variance be negative?
No. It is an average of squares, so it is zero or positive; zero means every value is identical.
Where these figures come from
- NIST Digital Library of Mathematical Functions — reference definitions for elementary and special functions
- Wolfram MathWorld — definitions and formulas for every topic on this page
- NIST/SEMATECH e-Handbook of Statistical Methods — the statistical formulas (mean, variance, z, confidence intervals, sample size)
- Common Core State Standards — Mathematics — the terms and methods taught in US schools
Last checked: September 2026. Formulas are fixed by mathematics and do not change with tax years or regulations.