Variance Calculator
Paste a list of numbers and this variance calculator shows how spread out they are. Choose sample or population variance and you get the variance, the standard deviation, the mean, the sum of squared deviations and the divisor used, plus a step-by-step table with each value's deviation from the mean, so you can check homework or a spreadsheet line by line.
Updated
Results
- Standard deviationSquare root of the variance
- Mean
- Count (n)
- Sum of squared deviationsΣ(x − mean)²
- Divisorn − 1 for a sample, n for a population
| Value (x) | x − mean | (x − mean)² |
|---|
Results are estimates. See the methodology below.
How to use the variance calculator
- Enter your numbers separated by commas, spaces or line breaks, for example
12, 15, 9, 20, 17, 11. You can paste a column from Excel or Google Sheets. Don't use thousands separators: type1250.5, not1,250.5. - Choose the type. Pick Sample when your data is a subset used to estimate a larger group, such as survey answers or a few weeks of measurements. Pick Population when you have every value of the group you care about.
- Read the results. Variance comes first, then standard deviation, mean, count, sum of squared deviations and the divisor (n − 1 or n). The table lists each value, its deviation and the squared deviation for up to 100 values.
A sample needs at least two values; you can enter up to 10,000.
Variance formulas
Variance is the average squared distance of the values from their mean:
- Population variance:
σ² = Σ(xᵢ − μ)² ÷ n - Sample variance:
s² = Σ(xᵢ − x̄)² ÷ (n − 1)
The numerator, Σ(x − mean)², is the sum of squared deviations (also called the sum of squares, SS). The standard deviation is the square root of the variance.
Why divide by n − 1?
A sample's own mean always sits closer to its values than the true population mean does, so dividing by n understates the spread. Dividing by n − 1, known as Bessel's correction, makes the sample variance an unbiased estimator of the population variance. Note that the square root of that unbiased variance is still not an unbiased estimate of the standard deviation.
The calculator uses Welford's algorithm, which updates the mean and the sum of squares one value at a time. It avoids the rounding errors of the shortcut Σx² − (Σx)²/n, which can go wrong with large numbers that differ only slightly.
Worked examples
1. Step by step: 12, 15, 9, 20, 17, 11
The mean is 14. Subtract it from each value and square the result:
| x | x − mean | (x − mean)² |
|---|---|---|
| 12 | −2 | 4 |
| 15 | 1 | 1 |
| 9 | −5 | 25 |
| 20 | 6 | 36 |
| 17 | 3 | 9 |
| 11 | −3 | 9 |
The squared deviations add up to 84. As a sample, the variance is 84 ÷ 5 = 16.8 and the standard deviation 4.10. As a population, it is 84 ÷ 6 = 14, with a standard deviation of 3.74.
2. A textbook data set
For 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5 and the sum of squares is 32. The population variance is exactly 4 (standard deviation 2); the sample variance is 4.571429 (standard deviation 2.13809).
3. One long commute
Five commutes take 24, 31, 27, 45 and 28 minutes. The mean is 31 minutes and the sample variance 67.5 square minutes, a standard deviation of 8.22 minutes. The 45-minute trip alone contributes 196 of the 270 in the sum of squares, which shows how strongly variance reacts to outliers.
Reading the result
Variance is in squared units: minutes², dollars², points². That makes it awkward to read directly, which is why the standard deviation, in the original units, is shown next to it. Variance is still the quantity that adds up: for independent variables, the variance of a sum is the sum of the variances, and it is the basis of ANOVA and regression.
A variance of 0 means all values are equal. Because deviations are squared, a single extreme value can dominate the result; check the table for outliers before drawing conclusions.
Frequently asked questions
What is the difference between sample and population variance?
Only the divisor. Population variance divides the sum of squared deviations by n, sample variance by n − 1. For 12, 15, 9, 20, 17, 11 that gives 14 versus 16.8. The gap shrinks as n grows.
Which one should I use?
Use sample variance when your numbers are a subset and you want to estimate the spread of a larger group. Use population variance when the data covers the whole group, such as every employee on a small team.
How is variance related to standard deviation?
The standard deviation is the square root of the variance. A sample variance of 16.8 means a standard deviation of about 4.10 in the same units as the data.
Can variance be negative?
No. It is an average of squared numbers, so it is zero when every value is the same and positive otherwise.
What are VAR.S and VAR.P in Excel?
VAR.S is the sample variance (divides by n − 1) and VAR.P the population variance (divides by n). They match the two options in this calculator.
Why does a sample need at least two values?
With one value, n − 1 is zero and the spread can't be estimated. As a population, a single value has a variance of 0.
Sources
Results are computed from the numbers you enter and are for general information. For research or regulated reporting, confirm which estimator and rounding rules your method requires.