Variance Calculator
The sample or population variance of a data set, with the standard deviation, mean, sum of squares and coefficient of variation.
Result
Variance: 4
Exact arithmetic on the values entered. Nothing is estimated.
- Standard deviation
- 2
- Mean
- 5
- Sum of squared deviations
- 32
- Coefficient of variation
- 40%
- Count
- 8
https://calcgallery.com/statistics/variance-calculator/
Results follow the mathematical operation and values shown. Check that you selected the intended operation, convention and dataset type before relying on the result. Read the full disclaimer
How to use the Variance Calculator
- Choose whether your numbers are a sample or the whole population.
- Enter the numbers, one per row.
- Read the variance, with the standard deviation, the mean and the working below it.
The formulas
sum of squares SS = Σ(x − x̄)²population σ² = SS ÷ nsample s² = SS ÷ (n − 1)standard deviation = √variance
Why the working is done in two passes
There is a shortcut, the mean of the squares minus the square of the mean, that finds the variance in one pass through the data. It is exact on paper and unreliable on a computer. With values like 1,000,001, 1,000,002 and 1,000,003, both terms are about a trillion and the difference between them is about 1, so almost every digit of precision cancels. The shortcut can then return a variance that is badly wrong, or even negative.
This page always works in two passes. It finds the mean first, then adds up the squared distance of each value from it. For those three numbers as a sample, it gives exactly 1.
A sample of one
A single value has no sample variance: n − 1 is zero, and one number says nothing about how a group varies. The page gives the population variance of that one value, which is zero, and says it has done so.
Reading the result
A variance of zero means every value is the same. The larger the variance, the more the values differ from their mean. For data that are roughly bell-shaped, about two thirds of the values lie within one standard deviation of the mean. The diagram marks that band.
With your numbers
- Mean = 5
- Sum of squared deviations = Σ(x − 5)² = 32
- Variance = 32 ÷ 8 (n) = 4
Quick reference
Exact arithmetic on the values entered. Nothing is estimated.
| Example | Variance |
|---|---|
| 2, 4, 4, 4, 5, 5, 7, 9 as a population | 4 |
| 2, 4, 4, 4, 5, 5, 7, 9 as a sample | 4.571429 |
| 1000001, 1000002, 1000003 as a sample | 1 |
| 10, 12, 23, 23, 16, 23, 21, 16 as a sample | 27.428571 |
| −2, 0, 2 as a population | 2.666667 |
| 1.5, 2.5, 3.5, 4.5 as a sample | 1.666667 |
Common questions about the Variance Calculator
- Sample or population, which do I choose?
- Population when you have measured every member of the group you care about, such as every pupil in one class when the class is the group. Sample when your numbers are drawn from a larger group you want to describe, such as a survey of customers. Most real data are samples. The sample variance divides by n − 1 rather than n, which makes it slightly larger and corrects for a sample tending to understate the spread of the group it came from.
- Why divide by n − 1?
- Because deviations are measured from the sample’s own mean, which is by construction the point closest to the sample values. The squared deviations from it are a little smaller on average than those from the true mean of the population. Dividing by n − 1 instead of n makes up for that exactly on average. It is called Bessel’s correction.
- What is the difference between variance and standard deviation?
- The standard deviation is the square root of the variance. Variance is in squared units, square centimetres for heights in centimetres, so it is hard to picture. The standard deviation is back in the original units, which is why it is the one usually reported. Variances add up when independent quantities are added, which is why the variance is the one used in calculations.
- What is the coefficient of variation?
- The standard deviation divided by the mean, as a percentage. It compares spread between data sets on different scales: a standard deviation of 5 is large for values around 10 and small for values around 1,000. It is meaningless when the mean is zero or when the data can be negative, so use it for positive measurements only.