How This Variance Calculator Works
Variance measures spread: how far, on average (in squared units), the values in a data set sit from their mean. Two classes can share the same average mark and still be completely different groups — one bunched tightly, one stretched from fail to perfect — and variance is the number that says so. This variance calculator computes both versions side by side (population, dividing by n; sample, dividing by n − 1) and prints the full deviation table, because the table is the method: mean first, then every distance from it, squared and summed.
The Variance Formula
Population variance is σ² = Σ(x − x̄)² ÷ n; sample variance is s² = Σ(x − x̄)² ÷ (n − 1). The only difference is the denominator, but it decides which number your course expects. Take the square root of either and you have the matching standard deviation — the standard deviation calculator covers that measure on its own, and the statistics calculator reports variance inside a full summary.
Worked Example: Ten Quiz Scores
For the scores 4, 8, 6, 5, 3, 8, 9, 2, 7, 8 the mean is 60 ÷ 10 = 6. The squared differences from 6, computed value by value, are (4−6)² = 4, (8−6)² = 4, (6−6)² = 0, (5−6)² = 1, (3−6)² = 9, (8−6)² = 4, (9−6)² = 9, (2−6)² = 16, (7−6)² = 1, (8−6)² = 4, adding to 52. The population variance is 52 ÷ 10 = 5.2; the sample variance is 52 ÷ 9 ≈ 5.78. Their square roots, ≈ 2.28 and ≈ 2.40, are the two standard deviations — the typical distance of a score from 6, back in marks.
Population or Sample: Which Variance Do You Need?
The two numbers answer two different questions, and choosing wrongly is the most common variance error of all. Use the population variance (÷ n) when your data is the whole group you care about: every score in the class, every day of last month, every machine on the line. Use the sample variance (÷ n − 1) when your data is a sample drawn to say something about a bigger group you cannot measure in full: 50 voters polled about an electorate, 30 parts tested from a production run, a week of trading days standing in for the year. Because a sample is computed against its own mean rather than the population's true mean, its squared differences run slightly small; dividing by n − 1 instead of n inflates the result just enough to correct that bias (Bessel's correction). This calculator always prints both, labelled — if a course, exam board or report expects one specific version, it will say “sample” or “population” in so many words.
Worked Example 2: A Five-Number Data Set, Entirely by Hand
For the values 2, 3, 4, 5, 6 the mean is 20 ÷ 5 = 4. The differences from the mean are −2, −1, 0, 1, 2, and squaring them gives 4, 1, 0, 1, 4, which sum to 10. The population variance is 10 ÷ 5 = 2, and the sample variance is 10 ÷ 4 = 2.5. Their square roots — the standard deviations — are ≈ 1.41 and ≈ 1.58: a typical value in this set sits about one and a half units from 4. Small sets like this one are the right way to learn the method, because every step can be checked mentally; paste the same five numbers into the calculator above and its deviation table reproduces each row.
Why Square the Differences?
Plain differences from the mean always add to zero — the positives cancel the negatives — so they cannot measure spread directly. Squaring fixes the cancellation and punishes large deviations more than small ones, which is usually what you want: one wild value should move the spread more than one mild value. The price is the squared units, which is why variance and standard deviation are almost always reported together. The NIST/SEMATECH e-Handbook of Statistical Methods is the standard reference for the definitions and for Bessel's correction.
Common Mistakes
- Dividing by n for a sample: if the data was sampled from a larger group, the n − 1 row is the honest one.
- Quoting variance in the original units: variance of heights in centimetres is in cm², not cm — convert to standard deviation before describing a “typical distance”.
- Comparing variances across different scales: a variance of 5.2 in marks and 5.2 in milliseconds say nothing about each other. Standardise first, for example with the z-score calculator.