How it works

Variance measures how far a data set spreads around its mean. First find the mean μ. Then square the distance of every value from μ, add those squares, and divide. The population variance divides by n, the count of values. The sample variance divides by n − 1, which corrects the underestimate you get when the mean was computed from the same data (Bessel's correction).

The standard deviation is the square root of the variance, back in the original units. Every value here is computed with exact rational arithmetic, and the deviation table is shown line by line so the result can be checked by hand.

Worked example

Try it with these numbers

The result card above already shows this example — change any field and hit Solve.

FAQ

Quick answers

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

Divide by n when your data is the entire population you care about. Divide by n − 1 when the data is a sample used to estimate a bigger population. For the eight values 2, 4, 4, 4, 5, 5, 7, 9 the population variance is 4, while the sample variance is 32/7.

What is the difference between variance and standard deviation?

Standard deviation is the square root of the variance. Variance squares the deviations, so it lives in squared units; the standard deviation returns to the original units, which is why it is quoted more often.

Can variance be a fraction?

Often, yes. Exact arithmetic keeps it that way: the sample variance of the example data is 32/7, and this page shows 32/7 rather than rounding it to 4.57143.

Related solvers

Keep going

Every calculator on one page: all mathplum calculators.