Variance Calculator

Variance measures how far each number in a data set is from the mean, calculated as the average of squared deviations. For the data set {2, 4, 4, 4, 5, 5, 7, 9}, the mean is 5 and the population variance is 4. Enter your numbers below to calculate both population and sample variance instantly.

Quick Answer

For the data set {2, 4, 4, 4, 5, 5, 7, 9}, the population variance is 4.0 and the sample variance is approximately 4.571.

Separate values with commas, spaces, or newlines

Common Examples

Input Result
2, 4, 4, 4, 5, 5, 7, 9 Pop variance: 4.0, Sample variance: 4.571
10, 12, 23, 23, 16, 23, 21, 16 Pop variance: 24.0, Sample variance: 27.429
1, 2, 3, 4, 5 Pop variance: 2.0, Sample variance: 2.5
100, 100, 100 Pop variance: 0, Sample variance: 0

How It Works

The formula

Population variance is the average of squared deviations from the mean:

\[\sigma^2 = \frac{\sum_{i=1}^{N}(x_i - \mu)^2}{N}\]

Where each x is a data point, μ is the population mean, and N is the total number of values.

Sample variance uses N - 1 instead of N in the denominator:

\[s^2 = \frac{\sum_{i=1}^{N}(x_i - \bar{x})^2}{N - 1}\]

This adjustment is called Bessel’s correction. When you compute variance from a sample rather than an entire population, dividing by N tends to underestimate the true variance. Dividing by N - 1 corrects for that bias.

When to use each version

Use population variance when your data includes every member of the group you are studying, such as all test scores in a single class. Use sample variance when your data is a subset drawn from a larger group, such as survey responses from 500 people representing a city of 100,000.

Relationship to standard deviation

Standard deviation is the square root of variance. Variance is measured in squared units (if your data is in meters, variance is in meters squared), which makes it less intuitive to interpret directly. Standard deviation converts back to the original units. Both measure spread, but variance has better mathematical properties for theoretical work and is the basis for many statistical tests.

Properties of variance

Variance is always zero or positive. It equals zero only when every value in the data set is identical (no spread at all). Adding a constant to every value does not change the variance. Multiplying every value by a constant c multiplies the variance by c squared.

Worked example

For the data set {2, 4, 4, 4, 5, 5, 7, 9}: The mean is (2+4+4+4+5+5+7+9)/8 = 40/8 = 5. The squared deviations are (2-5)²=9, (4-5)²=1, (4-5)²=1, (4-5)²=1, (5-5)²=0, (5-5)²=0, (7-5)²=4, (9-5)²=16. Their sum is 32. Population variance = 32/8 = 4.0. Sample variance = 32/7 = 4.571.

Related Calculators

Frequently Asked Questions

What is variance?
Variance measures how spread out numbers are from their mean. It is calculated by averaging the squared differences between each data point and the mean. A higher variance indicates more spread in the data.
What is the difference between population and sample variance?
Population variance divides the sum of squared deviations by N (the total count). Sample variance divides by N minus 1, which corrects for the tendency of samples to underestimate the true population variance. This adjustment is called Bessel's correction.
Can variance be negative?
No. Variance is computed from squared differences, which are always non-negative. The smallest possible variance is zero, which occurs when every value in the data set is identical.
What is the relationship between variance and standard deviation?
Standard deviation is the square root of variance. If the variance of a data set is 16, its standard deviation is 4. Variance is in squared units, while standard deviation is in the original units of the data, making it easier to interpret.
Why is variance important in statistics?
Variance quantifies the spread of a distribution and is the foundation for many statistical methods including hypothesis testing, confidence intervals, ANOVA, and regression analysis. It has useful mathematical properties: the variance of a sum of independent variables equals the sum of their variances.

Learn More