Variance Calculator
Paste a list of numbers to get the variance, with every deviation squared and summed in a table you can check by hand.
- Free
- No sign-up
- Private
Paste or type numbers separated by commas, spaces or new lines (e.g. a column copied from a spreadsheet).
Choose sample unless you have every member of the group.
- Count
- 8
- Mean
- 5
- Sum of squared deviations
- 32
- Sample variance (sยฒ)
- 4.571429
- Population variance (ฯยฒ)
- 4
- Standard deviation (s)
- 2.13809
| x | x โ mean | (x โ mean)ยฒ |
|---|---|---|
| 2 | โ3 | 9 |
| 4 | โ1 | 1 |
| 4 | โ1 | 1 |
| 4 | โ1 | 1 |
| 5 | 0 | 0 |
| 5 | 0 | 0 |
| 7 | 2 | 4 |
| 9 | 4 | 16 |
How this was calculated
- Count the values: n = 8.
- Find the mean: 40 รท 8 = 5.
- Subtract the mean from each value and square the result (see the table).
- Add the squares: ฮฃ(x โ mean)ยฒ = 32.
- Divide by n โ 1 = 7 to get the sample variance: 32 รท 7 = 4.571429.
- Take the square root: s = โ4.571429 = 2.13809.
How this variance calculator works
Variance measures how spread out a set of numbers is. It is the average of the squared distances from the mean. This variance calculator finds the mean of your data, subtracts it from every value, squares each difference, adds the squares and divides, exactly as you would on paper. The deviation table shows every intermediate number so you can check your homework line by line.
The two formulas
For a population, ฯยฒ = ฮฃ(x โ ฮผ)ยฒ รท N. For a sample, sยฒ = ฮฃ(x โ xฬ)ยฒ รท (n โ 1). Spreadsheets split the same way: VAR.S is the sample formula and VAR.P the population formula. Use the sample version when your numbers are a subset used to learn about a bigger group, which covers nearly all homework and research. Use the population version only when your list is the whole group.
Worked example
Take 2, 4, 4, 4, 5, 5, 7, 9. The sum is 40 and there are 8 values, so the mean is 5. The squared deviations are 9, 1, 1, 1, 0, 0, 4 and 16, which add to 32. The population variance is 32 รท 8 = 4; the sample variance is 32 รท 7 = 4.5714. The standard deviation is the square root of the variance: 2 for the population and about 2.138 for the sample.
Variance vs. standard deviation
Variance is in squared units. If your data is in dollars, the variance is in dollarsยฒ, which is hard to picture. The standard deviation takes the square root and returns to the original units, so it is easier to interpret, while variance is easier to work with mathematically because variances of independent variables simply add. When you need to describe the spread to other people, quote the standard deviation; use variance in formulas, ANOVA and regression. The standard deviation calculator adds z-scores and the 68โ95โ99.7 spread table.
Common mistakes
- Using the wrong divisor. If your answer is slightly off from the textbook, switch between sample and population.
- Squaring too early or too late. Square each deviation, then add. Adding the raw deviations always gives zero.
- Expecting a small number from skewed data. One extreme value can dominate the variance, because squaring magnifies large deviations. Check the table for the row that contributes the most.
A variance of zero means every value is identical. A sample needs at least two values, since the divisor n โ 1 would otherwise be zero. For a broader summary including median, quartiles and outliers, use the statistics calculator.
Frequently asked questions
How do you calculate variance?
Find the mean, subtract it from each value and square the result, add the squares, then divide by n โ 1 for a sample or N for a population. For 2, 4, 4, 4, 5, 5, 7, 9 the population variance is 4.
What is the difference between sample and population variance?
Sample variance divides the sum of squared deviations by n โ 1 and is used when your data is a subset of a larger group. Population variance divides by N and is used when you have the entire group.
What is the relationship between variance and standard deviation?
Standard deviation is the square root of variance, and variance is the square of the standard deviation. A variance of 4 means a standard deviation of 2.
Can variance be negative?
No. Variance is an average of squared numbers, so it is zero or positive. It is zero only when every value is identical.
Why is variance in squared units?
Because the deviations are squared. If your data is in dollars, the variance is in dollars squared; take the square root to get the standard deviation back in dollars.