Calculate variance from a list of data values or a value and frequency table.
Variance Formula
This calculator can return sample variance, population variance, or both. The two formulas share the same numerator and differ only in the denominator.
Sample variance:
s^2 = sum( (x_i - x_bar)^2 ) / (n - 1)
Population variance:
sigma^2 = sum( (x_i - mu)^2 ) / N
- s^2 = sample variance
- sigma^2 = population variance
- x_i = each individual value in the data set
- x_bar = the sample mean (sum of values divided by n)
- mu = the population mean (sum of values divided by N)
- n = number of values in the sample
- N = number of values in the full population
You first find the mean of your data. For each value you subtract the mean and square the result, which gives the squared deviation. You add all of those squared deviations together to get the numerator. Dividing by n - 1 gives the sample variance, and dividing by N gives the population variance. The "Solve for" selector controls which denominator the calculator uses, and choosing "Both" returns each result side by side. If you enter a value and frequency table instead of a raw list, each value is counted as many times as its frequency, so a value with a frequency of 3 contributes three squared deviations to the sum and adds 3 to the count.
Sample vs Population Variance
Use the table below to decide which result you need. The only practical difference is the denominator, but it changes the answer, especially for small data sets.
| Item | Sample variance | Population variance |
|---|---|---|
| Symbol | s squared | sigma squared |
| Denominator | n - 1 | N |
| Use when | Your data is a subset drawn from a larger group | Your data covers every member of the group |
| Result size | Slightly larger | Slightly smaller |
Variance is the square of the standard deviation. The table below shows how to read a variance once you have it.
| What you see | What it means |
|---|---|
| Variance of 0 | Every value is identical, with no spread |
| Small variance | Values sit close to the mean |
| Large variance | Values are spread widely from the mean |
| Square root of variance | The standard deviation, in the original units |
Examples
Example 1. Find the sample variance of 4, 8, 6, 5, 3.
The mean is (4 + 8 + 6 + 5 + 3) / 5 = 26 / 5 = 5.2. The squared deviations are (4 - 5.2)^2 = 1.44, (8 - 5.2)^2 = 7.84, (6 - 5.2)^2 = 0.64, (5 - 5.2)^2 = 0.04, and (3 - 5.2)^2 = 4.84. Their sum is 14.8. Dividing by n - 1 = 4 gives a sample variance of 3.7.
Example 2. Find the population variance of the same numbers, 4, 8, 6, 5, 3.
The mean and the sum of squared deviations are the same, 5.2 and 14.8. This time you divide by N = 5, which gives a population variance of 2.96. Notice the population result is smaller because the denominator is larger.
FAQ
Should I use sample or population variance?
Use population variance when your data includes every member of the group you care about, such as the test scores of all 30 students in one class when that class is the whole population. Use sample variance when your data is a smaller selection taken from a larger group and you want to estimate the variance of that larger group. When you are unsure, sample variance is the more common choice in statistics because most real data sets are samples.
Why does sample variance divide by n - 1 instead of n?
Dividing by n - 1 is called Bessel's correction. Because the sample mean is calculated from the same data you are measuring, using n would slightly underestimate the true spread of the larger population. Subtracting one from the denominator corrects that bias and gives a fairer estimate. The adjustment matters most for small data sets and becomes almost invisible once the sample is large.
How is variance related to standard deviation?
Standard deviation is the square root of variance. Variance is reported in squared units, which can be hard to interpret, so taking the square root brings the measure back to the original units of your data. If the variance is 9, the standard deviation is 3.
