Variance Calculator
Variance measures how spread out a set of numbers is: the average of the squared distances from the mean. A variance of 0 means every value is identical; a large variance means the values are widely scattered. It is the foundation of the standard deviation and of most of statistics — but it comes in two versions, sample and population, and using the wrong one is the most common mistake with this calculation.
Variance is the average squared distance from the mean, and it is the number standard deviation is built from. Paste your data to see both kinds — sample variance, dividing by n − 1, and population variance, dividing by n — with both standard deviations, the mean, the sum and the sum of squared deviations. Comparing the variance between groups with the variance within them is the idea behind ANOVA — analysis of variance.
Sample variance (divided by N − 1)
How It Works
Both versions start the same way. First find the mean — add all the values and divide by how many there are. Then, for each value, work out its distance from the mean, square that distance (so that below-average and above-average values both contribute positively), and add all the squared distances up. That total is the sum of squared deviations, Σ(x − x̄)².
The two versions differ only in the final division:
- Population variance (σ²) divides by N, the number of values: σ² = Σ(x − x̄)² / N. Use it when your numbers are the entire group.
- Sample variance (s²) divides by N − 1: s² = Σ(x − x̄)² / (N − 1). Use it when your numbers are a sample from a larger group.
Dividing by N − 1 instead of N corrects for a subtle bias: a sample's values cluster a little closer to their own mean than to the true population mean, so dividing by N would systematically understate the spread. The correction is called Bessel's correction, and it matters most for small samples — with 5 values it inflates the variance by 25%, but with 1,000 values the difference is a tenth of a percent. The standard deviation is simply the square root of the variance, which brings the units back to the original scale: if the values are in centimetres, the variance is in square centimetres and the standard deviation is in centimetres.
Worked Example
Take 10, 20, 30, 40, 50. The mean is (10 + 20 + 30 + 40 + 50) / 5 = 30. The squared distances from the mean are (10−30)² = 400, (20−30)² = 100, (30−30)² = 0, (40−30)² = 100 and (50−30)² = 400, which add up to a sum of squared deviations of 1,000.
The population variance is 1,000 / 5 = 200, and the population standard deviation is √200 = 14.1421. The sample variance is 1,000 / 4 = 250, and the sample standard deviation is √250 = 15.8114. Same data, two answers — which is why the page labels both.
Assumptions
- Both versions are shown, clearly labelled. Sample variance divides by N − 1; population variance divides by N. Neither is "the" variance — the right one depends on whether your numbers are a sample or the whole group.
- With a single value, the sample variance is undefined. It would divide by N − 1 = 0, so the calculator says so plainly. The population variance is 0 — a single value has no spread.
- Variance is never negative. It is an average of squared distances, and squares are never negative. A variance of 0 means every value is identical.
- Variance is in squared units. If your values are heights in centimetres, the variance is in square centimetres — which is why the standard deviation (the square root) is usually the easier number to interpret.
- Up to 10,000 values, each within ±1,000,000,000,000, keeping the page fast.
Sources: No external data is used on this page — every figure is calculated from the values you enter, using the standard sample (dividing by N − 1) and population (dividing by N) variance formulas. Last reviewed: 15 November 2026.
Built and tested by SumKitTool — see how we check our numbers.
How to Use This Calculator
Paste your numbers into the box, separated by commas, spaces or new lines. The result updates as you type: the headline is the sample variance, and the table shows the population variance, both standard deviations, the mean, the sum, the sum of squared deviations and the count. Reset restores the worked example.
Try the worked example: the defaults give a sample variance of 250 and a population variance of 200. Then try a single value — the sample variance is shown as undefined with the reason, and the population variance is 0. Try a list where every value is the same, like "5, 5, 5, 5" — both variances are 0.
Tips and Practical Advice
If you are not sure which version to use, ask whether your numbers are the whole story or a sample of it. Every exam score in your class: population. A survey of 200 customers out of 20,000: sample. In research and most statistics courses, the sample version is the default — and with large data sets the two barely differ anyway.
Variance squares the units, which makes it hard to feel. When you want a number in the original units — "scores typically differ from the mean by about 16 points" — read the standard deviation row instead. Variance is the working number; standard deviation is the talking number.
Outliers inflate variance fast, because distances are squared. One value 100 away from the mean contributes 10,000 to the sum of squares. If your variance looks surprisingly large, check for a typo or an extreme value before trusting it.
Frequently Asked Questions
What is the difference between sample and population variance?
Population variance divides the sum of squared deviations by N, the number of values — use it when your numbers are the whole group. Sample variance divides by N − 1 instead, which corrects for the fact that a sample tends to understate the spread of the larger group it came from. For 10, 20, 30, 40, 50, the population variance is 200 and the sample variance is 250.
Why do you divide by n − 1 for a sample?
Because a sample's values cluster slightly closer to their own mean than to the true population mean, so dividing by N would systematically understate the spread. Dividing by N − 1 — Bessel's correction — fixes that bias. It matters most for small samples: with 5 values it raises the variance by 25%, but with 1,000 values the difference is a tenth of a percent.
What is the difference between variance and standard deviation?
The standard deviation is the square root of the variance. Variance is measured in squared units — square centimetres, if the values are heights — which makes it hard to interpret directly. The standard deviation is in the original units, so it is the number people usually quote. For 10, 20, 30, 40, 50, the sample variance is 250 and the sample standard deviation is 15.8114.
Can variance be negative?
No. Variance is an average of squared distances from the mean, and a square is never negative. A variance of 0 means every value is identical — there is no spread at all. If a calculation ever gives you a negative variance, something has gone wrong.
Last updated: