CCalclabhub

Math · 64 calculators

Variance Calculator

Variance measures the average squared deviation from the mean, giving a single number that describes how widely a set of values is scattered. Whether you divide by N or by N minus one decides whether you are describing the data you have or estimating the spread of a larger population.

Last updated

Population variance

8

Mean
6
Sample variance
10
Population standard deviation
2.8284

Values update as you type. This calculator covers the single scenario its formula assumes — see Common Mistakes for what it leaves out.

The formula this calculator uses

Population: sigma^2 = Sum(xi - mu)^2 / N | Sample: s^2 = Sum(xi - x-bar)^2 / (n - 1)

xi
Each individual observation in the data set
mu or x-bar
The mean (average) of the observations
N or n
The number of observations
sigma^2 or s^2
The variance: population or sample version

How to check the result by hand

  1. 1

    Compute the mean

    Add every observation and divide by the count: (2 + 4 + 6 + 8 + 10) / 5 = 30 / 5 = 6.0. Everything downstream rests on this number, and a quick check is that the mean must lie between the smallest and largest values.

  2. 2

    Find each deviation from the mean

    Subtract the mean from every value: 2 - 6 = -4, 4 - 6 = -2, 6 - 6 = 0, 8 - 6 = 2 and 10 - 6 = 4. These signed distances should sum to zero, which is a convenient way to confirm the subtraction was done correctly before moving on.

  3. 3

    Square the deviations and add them

    Squaring gives 16, 4, 0, 4 and 16, which sum to 40. This total of squared deviations is the numerator for both variance formulas. Squaring removes the negative signs and makes large departures from the mean weigh much more heavily than small ones.

  4. 4

    Choose the divisor and divide

    For the whole population divide 40 by N = 5 to get 8.0; for a sample divide by n - 1 = 4 to get 10.0. This is the only difference between the two versions, but on five observations the sample answer is a quarter larger, so the choice must be made deliberately.

  5. 5

    Take the square root if you want the original units

    The variance is in squared units, so take the square root to recover the scale of the data. The population standard deviation is sqrt(8.0) = 2.8284271247461903; treating the values as a sample gives sqrt(10.0), about 3.1622776601683795. Each sits roughly three units from the mean of 6.0.

Common Questions

How does the Variance Calculator work?

Find the mean, subtract it from each value, square those deviations, add them up, then divide. For the values 2, 4, 6, 8 and 10 the mean is 6.0 and the squared deviations total 40, giving a population variance of 8.0 when divided by five and a sample variance of 10.0 when divided by four. The square root of the variance returns the result to the original units: the population standard deviation here is 2.8284271247461903.

What do I need to enter in the Variance Calculator?

It takes 5 inputs: Value 1, Value 2, Value 3, Value 4, Value 5. Fields that expect a unit say so next to the label.

Where does Population variance come from?

It comes from sigma^2 = Sum(xi - mu)^2 / N — use when the observations are the entire population of interest. Subtract the population mean from each value, square the deviations, sum them and divide by the total count N.

What is the most common mistake with the Variance Calculator?

Dividing by n when the data is only a sample. This systematically understates the population variance, because the deviations were measured around a mean fitted to those same points. Use n - 1 unless the observations genuinely are the entire population of interest.

For worked examples, common mistakes and the limits of this formula, read the full How To Calculate Variance page.