Variance Calculator
Compute the population variance from raw data. See the mean, sum of squares, and variance in one place for clear verification.
Enter the Details
Data (You may enter up to 30 numbers)
X1:
X2:
Result will appear here...
What the variance calculator does
Variance measures how spread out a set of numbers is, by looking at how far each one sits from the average and squaring those distances. This calculator works it out from your data, and shows the mean and the standard deviation alongside it, so you can see the whole picture in one place.
It gives the population variance, the version that treats your numbers as the entire group. Below is how it gets there, and how to tell whether the population version is the one you want.
How to use it
- Enter your numbers, one per box, starting with the first two.
- Add or remove boxes with the buttons, up to thirty numbers in all.
- Press Calculate for the count, mean, variance, and standard deviation, or Reset to clear it.
How the variance is worked out
Variance is built in three steps. First, find the mean of your numbers. Second, for each number, measure how far it is from the mean and square that distance, which keeps everything positive and gives the bigger gaps more weight. Third, average those squared distances.
Variance = the sum of the squared distances from the mean ÷ N
Here N is how many numbers you have. Dividing by N is what makes this the population variance, the reading you use when your data is the whole group you care about. Take the square root of the variance and you get the standard deviation, which this calculator also shows.
Population or sample variance
There are two versions of variance, and they differ by one small thing at the end. This calculator gives the population variance, dividing by N. There is also a sample variance, which divides by one less, N minus 1.
Which is right depends on your data. Use the population version when your numbers are the entire group, with nothing outside them, so the mean you have is the true mean. Use the sample version when your numbers are a smaller set standing in for a larger group you cannot measure in full. In that case the data sits a little closer to its own average than to the true one, so dividing by one less nudges the variance up to correct for it. This is called Bessel's correction.
If it is the sample variance you need, our sample standard deviation calculator uses the N minus 1 version, and squaring its result gives you the sample variance.
Variance and standard deviation
Variance and standard deviation are two views of the same spread. The catch with variance is that it is in squared units, because the distances were squared along the way. If your data is in centimetres, the variance is in square centimetres, which is hard to picture.
The standard deviation fixes that by taking the square root, which brings the number back to the original units. That is why the standard deviation is usually the one people quote, while the variance does its most useful work under the hood, feeding into other calculations. This calculator gives you both so you can use whichever suits.
A worked example: eight numbers
Take the eight numbers 2, 4, 4, 4, 5, 5, 7, 9. Their mean is 40 ÷ 8 = 5. The squared distances from 5 are 9, 1, 1, 1, 0, 0, 4, 16, which add up to 32.
Dividing by N gives the population variance: 32 ÷ 8 = 4, and the standard deviation is the square root, 2. For comparison, the sample variance would divide by 7 instead, giving about 4.57, a touch larger, which is Bessel's correction at work.
Entering your data, and the rounding
Fill in a box for each number, adding boxes as you go, up to thirty. Every box needs a value before the calculator will run. The order does not matter, since variance depends only on the values and their distance from the mean. The mean, variance, and standard deviation are shown to three decimal places with trailing zeros trimmed.
Questions people ask
What is variance?
A measure of how spread out data is, worked out as the average of the squared distances of each value from the mean. A larger variance means the values are more scattered.
Does this give population or sample variance?
Population variance, dividing by N. For the sample variance, which divides by N minus 1, use the sample standard deviation calculator and square its result.
What is the difference between variance and standard deviation?
Variance is the average squared distance from the mean, so it is in squared units. The standard deviation is its square root, back in the original units, which makes it easier to interpret.
Why are the distances squared?
Squaring makes every distance positive, so they do not cancel out, and it gives larger gaps more influence. It is what turns a set of distances into a single measure of spread.
References
A quick note on where the methods here come from. The definitions of variance and standard deviation, and the reason a sample divides by N minus 1, are set out in the NIST/SEMATECH e-Handbook of Statistical Methods, the US government's public statistics reference. OpenStax Introductory Statistics is a free, widely used textbook covering the same ground.
- NIST/SEMATECH e-Handbook of Statistical Methods (measures of spread, sample versus population). https://www.itl.nist.gov/div898/handbook/
- OpenStax, Introductory Statistics (measures of the spread of the data). https://openstax.org/details/books/introductory-statistics-2e
Ankit Khatiwada is a researcher and graduate student in Computer Science at Saarland University, with strengths in statistics, data analysis, data engineering, and full stack development. His work sits at the intersection of quantitative reasoning and applied technology, making him a strong fit for tools that depend on clear numerical logic. At Eon Tools, he reviews number and statistical tools.