Skip to content
MasterMath

Variance Calculator

The variance of a list of values, both sample and population, with the intermediate sum of squares so you can follow the working. Values go separated by commas or spaces.

Sample variance

—

Sample variance—
Population variance—
Mean—
Standard deviation—
Sum of squares—
Number of values—
MeasureValue

How this was worked out

    The formula

    s² = Σ(x − x̄)² / (n − 1)

    What it means

    Variance is the average of the squared differences from the mean. Squaring stops the differences above and below cancelling each other out, and the price is that the answer ends up in squared units: the variance of heights in centimetres comes out in square centimetres, which means nothing physically. That is why reports almost always show its square root, the standard deviation, and variance stays as an intermediate step.

    How to work it out by hand

    1. Work out the mean of the values
    2. Subtract the mean from each value and square the difference
    3. Add all the squares: that is the sum of squares
    4. Divide by n − 1 for the sample version or by n for the population one

    What is worth knowing

    Variance has a property that standard deviation does not, and it is why it is still used: the variance of a sum of independent variables is the sum of their variances. That does not hold for standard deviations, which have to be converted to variances and back. Hence its appearance in nearly every error-propagation and portfolio formula, even though the figure finally published is always the deviation.

    Frequently asked questions

    Why is variance in squared units?

    Because the differences are squared. That is what makes it hard to interpret and why its square root is what gets published.

    When do I divide by n and when by n − 1?

    By n − 1 if your data are a sample of something bigger, which is the usual case. By n only if they are the complete population.

    Can it come out negative?

    Never. It is a sum of squares divided by a positive number. A negative result means a mistake in the working.

    What is the sum of squares?

    The intermediate step: the total of all squared differences, before dividing. It shows up in analysis of variance and in regression.

    What if every value is the same?

    Variance is zero, because nothing departs from the mean. It is the only case where it is zero.