Sizely
Variance Calculator

Variance Calculator

Variance calculator: get the sample and population variance of a data set side by side, with the standard deviation, mean, count and sum of squares.

Nella Cheng

Written by

Nella Cheng

Updated

There was an error with your calculation.

Variance Calculator
Sample Population
Variance s2 = 28.5 σ2 = 24.9375
Standard Deviation s = 5.3385 σ = 4.9937
Count n = 8 n = 8
Mean x̄ = 18.25 μ = 18.25
Sum of Squares SS = 199.5 SS = 199.5

Variance at a glance#

What is variance?#

Variance is a measure of how spread out a set of values is around the mean. It represents the average of the squared distances from the mean, meaning it's always zero or positive and it is expressed in squared units. The notation for population variance is σ2, while for sample variance, it is s2.

How do you calculate variance?#

To calculate variance, you first find the mean and then subtract it from each value. You then square each of these deviations and add them together to obtain the sum of squares. For a population, divide this sum by the number of values. For a sample, divide by one less than the number of values. The standard deviation is the square root of the variance.

The mean is 18.25. What is the variance of 9, 12, 23, 22, 16, 21, 20 and 23?#

For these eight values, the sum of squares is 199.5. If we treat them as a sample, the variance is 199.5 ÷ 7 = 28.5. For the entire population, it is 199.5 ÷ 8 = 24.9375. The calculator above provides both, along with their standard deviations of 5.3385 and 4.9937.

What variance measures, and why its units are squared#

Consider five seedlings measured in centimeters: 12, 15, 9, 18, and 16 cm tall. The mean height of these seedlings is 14 cm. Each seedling's deviation is its distance from 14: −2, 1, −5, 4, and 2 cm. These deviations will always sum to zero, which is the reason variance squares them first. Once squared, they become 4, 1, 25, 16, and 4, all positive.

When you square these deviations, you also square the units. A deviation of 5 cm turns into 25 square centimeters. So the population variance of these heights is expressed as 10 square centimeters, not 10 cm. This is the main point to keep in mind when interpreting variance. As the NIST Engineering Statistics Handbook explains, variance squares the units, while the standard deviation brings them back to the original data's units. Here, the population standard deviation is √10 = 3.16 cm.

Seedling heights of 12, 15, 9, 18 and 16 cm have a mean of 14. Their deviations of −2, 1, −5, 4 and 2 cm drawn as squares with areas 4, 1, 25, 16 and 4 square cm, which add up to 50, so the population variance is 50 ÷ 5 = 10 square cm and the standard deviation is √10 = 3.16 cm
Each squared deviation is an area, which is why variance comes in square units.

How to calculate variance step by step#

Here are the same five seedlings, treated as a population:

  1. Add up all their heights and then divide by the number of seedlings to find the mean: 70 ÷ 5 = 14 cm.
  2. Subtract this mean from each individual height: −2, 1, −5, 4, and 2.
  3. Square each of these deviations: 4, 1, 25, 16, and 4.
  4. Sum up these squares to get the sum of squares (SS): SS = 50.
  5. To find the variance for the population, divide this sum by the number of observations, N = 5: σ2 = 50 ÷ 5 = 10 square centimeters.

If you're dealing with a sample instead, use n − 1 as the divisor: s2 = 50 ÷ 4 = 12.5 square centimeters.

How to calculate variance step by step
Height x (cm)Deviation x − Μ (cm)Squared Deviation (square cm)
12−24
1511
9−525
18416
1624
Sum: 700SS = 50

When you enter 12, 15, 9, 18, 16 into the calculator, it gives you both columns: σ2 = 10 and s2 = 12.5. The sum of squares (SS) is 50, with a mean of 14 and a count of 5.

The formulas for these calculations are as follows: for the population variance, σ2 = Σ(x − μ)2 ÷ N, and for the sample variance, s2 = Σ(x − x̄)2 ÷ (n − 1). In these formulas, Σ signifies "add up", while μ and x̄ refer to the population and sample means respectively, and N and n are the total counts.

Population vs sample variance#

You'll want to use population variance when your data includes the entire set, such as every seedling in a single tray. On the other hand, sample variance is appropriate when your data is just a portion representing a larger set, like selecting five seedlings from a field containing hundreds.

The sample variance calculation divides by n − 1. This is because deviations from the sample's own mean run slightly small on average. OpenStax Introductory Statistics notes that sample variance serves as an estimate of the population variance, and using n − 1 gives a better estimate. The smaller your sample is, the larger the discrepancy: consider the seedlings at 12.5 versus 10.

A sum of squares of 50 divided by N = 5 gives a population variance of 10, and divided by n − 1 = 4 gives a sample variance of 12.5
The same sum of squares, divided by N for a population and by n − 1 for a sample.

There's no requirement to choose before you start calculating. This tool displays the sample and population columns side by side.

Variance of two numbers#

When dealing with only two values, calculating variance can be simpler. You square the difference between the two numbers. For the sample variance, you divide by 2, and for the population variance, you divide by 4. For 10 and 16, the difference is 6, and its square is 36. This makes the sample variance 36 ÷ 2 = 18, while the population variance is 36 ÷ 4 = 9. The calculator requires at least two numbers and gives the same results.

Variance vs standard deviation#

Both variance and standard deviation measure the same spread. The standard deviation is simply the square root of the variance, which means it puts the spread back into the units of the data. For the seedlings as a sample, we find the variance is 12.5 square centimeters and the standard deviation is √12.5, which equals 3.54 cm. It's often easier for people to understand the standard deviation, while variance is what many statistical formulas actually use. The standard deviation calculator page covers the spread in the data's units and the 68-95-99.7 rule.

Percent variance is a different calculation#

In budgeting and accounting, variance typically refers to the difference between a planned figure and what actually occurred, and not the statistical measure we're discussing here. For instance, if you had budgeted $2,000 and ended up spending $2,300, the variance would be $300, which is $300 ÷ $2,000, or 15% over budget. This represents a percentage change, and the percentage calculator is designed to handle such calculations. This variance calculator only finds the statistical variance of a data set.

Variances of common data sets#

Each row displays what the calculator returns. Values are rounded to four decimal places, as the calculator rounds them.

Variances of common data sets
Data SetMeanSum of SquaresSample S2Population Σ2
12, 15, 9, 18, 16145012.510
9, 12, 23, 22, 16, 21, 20, 2318.25199.528.524.9375
10, 161318189
2, 4, 4, 4, 5, 5, 7, 95324.57144
3.5, 4.1, 5.84.46672.84671.42330.9489

Sources#

Frequently asked questions#

What is the symbol for variance?#

σ2, pronounced as "sigma squared", represents the population variance. s2 indicates the sample variance. The calculator labels its results with these symbols.

Can variance be negative?#

No. Variance involves adding up squared numbers, which are never negative, and then dividing by a positive count. It's zero only when all values are identical, as this makes every deviation zero.

Why does variance square the deviations?#

The deviations from the mean always sum to zero, so their plain average is zero as well. Squaring the deviations makes them positive and gives large deviations more weight, so one distant value significantly increases the variance.

How do I get the standard deviation from the variance?#

Take the square root. A variance of 28.5 gives a standard deviation of √28.5 = 5.3385. The calculator lists the standard deviation right below the variance.

What does a large variance mean?#

A large variance indicates values are spread far from the mean. Because variance is in squared units, compare it with other variances of similar data, or take the square root and compare the standard deviation with the mean.

Why is the sample variance larger?#

It divides the same sum of squares by n − 1 instead of N, a smaller number. For the seedlings, 50 ÷ 4 = 12.5 against 50 ÷ 5 = 10. The gap shrinks as the sample grows.