How this instrument works
Variance answers the question the range only gestures at: how far, on average, do values sit from the centre? Start with each value's deviation from the mean, x − x̄. Some deviations are positive, some negative, and if you simply averaged them they would cancel to zero — so variance squares every deviation first, which also has the useful side effect of penalising large deviations more than small ones.
This instrument computes the sample variance, s², which divides the sum of squared deviations by n − 1 rather than n. That −1, known as Bessel's correction, exists because a sample's own mean is calculated from the same data being measured, which makes the data hug its own mean slightly closer than it hugs the true population mean. Dividing by n − 1 instead of n corrects that small downward bias, so s² is, on average, an accurate estimate of the population's true variance.
Variance is expressed in squared units — squared dollars, squared test-score points — which makes it awkward to interpret directly. Its square root, the standard deviation, converts the number back into the original units and is usually what gets quoted in a report; variance itself is what most statistical formulas, including confidence intervals and hypothesis tests, actually build on underneath.
- Enter your numbers into Data set — separate them with commas, spaces or new lines in any order.
- Read Sample variance (s²) beneath the data field once you've entered at least two values.
- Use this sample form when your numbers are a subset standing in for a larger group — a batch of test measurements, a survey sample, a handful of trial runs.
- If your data is the entire population you care about, not a sample of it, use this site's Population variance instrument instead — it divides by n rather than n − 1.
- Need the result in the original units rather than squared units? This site's Standard deviation instrument takes the square root of this same calculation for you.
Worked example — the eight quiz scores
Enter 2, 4, 4, 4, 5, 5, 7, 9 into Data set. The mean of these eight scores is 5 (sum 40 ÷ 8). Each value's squared deviation from 5 is: 9, 1, 1, 1, 0, 0, 4, 16 — summing to 32.
Divide that sum of 32 by n − 1, which is 7, and Sample variance (s²) reads 4.571428571... — the exact figure this instrument returns for this data set. Take its square root and you get the sample standard deviation, about 2.138, which is the same eight scores' spread expressed back in the original point units rather than squared ones.
Questions
Why does variance divide by n − 1 instead of n?
Because the mean used inside the formula is calculated from the same sample being measured, which makes the data cluster slightly closer to its own mean than to the true population mean it's estimating. Dividing by n − 1, called Bessel's correction, inflates the result just enough to offset that bias, so the sample variance is, on average, an accurate estimate of the population's actual variance.
What's the difference between sample variance and population variance?
Sample variance (s², divided by n − 1) is what you compute when your data is a subset standing in for a larger group you can't fully measure. Population variance (σ², divided by n) is what you compute when your data already is the entire group of interest — every student in one specific class, for instance, not a sample drawn from a larger population of classes.
Why is variance in squared units instead of the original units?
Because the formula squares every deviation from the mean before averaging them, which is necessary so that positive and negative deviations don't cancel out to zero. The tradeoff is that a variance of, say, 4.57 squared points is hard to picture directly — its square root, the standard deviation, converts the number back into the original units and is usually the one quoted in plain language.
How is variance related to standard deviation?
Standard deviation is simply the square root of variance: s = √s². Variance is what the underlying statistical formulas — confidence intervals, ANOVA, regression — actually use in their calculations, while standard deviation is the more interpretable, same-units figure people tend to report and discuss.
Can variance ever be negative?
No. Every term being summed is a squared deviation, and a square can never be negative, so the sum — and the variance that comes from dividing it by n − 1 — is always zero or positive. A variance of exactly zero means every value in the data set is identical.
How much data do I need to calculate a sample variance?
At least two values. With only one value there is no spread to measure and the n − 1 denominator would become zero, making the calculation undefined — so the instrument asks for a second number before it will compute anything.