Variance Calculator
Compute the sample or population variance of a data set.
Results update as you type.
About this calculator
Variance is the average of the squared deviations from the mean and is the square of the standard deviation. This calculator gives the sample variance (sum of squared deviations divided by n − 1) or the population variance (divided by n), along with the standard deviation, mean, range and sum of squared deviations. Variance is expressed in squared units, which is why the standard deviation — its square root — is usually easier to interpret.
To find it, take the mean, subtract it from every value, square each of those deviations, add them together and divide by n − 1 for a sample or by n for a whole population. Squaring is what makes variance always non-negative and gives extra weight to values that lie far from the mean.
Worked example: for 12, 15, 17, 20, 22, 25 the mean is 18.5. The squared deviations sum to about 118.5, so the sample variance is 118.5 ÷ 5 = 23.7 and the population variance is 118.5 ÷ 6 = 19.75. Variance is the workhorse behind ANOVA, portfolio risk, quality control and many other techniques; the deviation table below lists each value’s distance from the mean and its square.
Frequently asked questions
How is variance related to standard deviation?
The standard deviation is the square root of the variance. Variance is in squared units (for example, squared dollars), while the standard deviation is back in the original units, so the two always describe the same spread.
When do I use n versus n − 1?
Divide by n − 1 when your data is a sample used to estimate a larger population; divide by n when your data represents the whole population you care about.
Why is variance in squared units?
Because each deviation is squared before averaging, the result carries the square of the original unit — squared dollars, squared centimetres and so on. That makes variance awkward to interpret directly, which is why its square root, the standard deviation, is reported alongside it.
Can variance be negative?
No. It is an average of squared numbers, so it is always zero or positive. A variance of exactly zero means every value in the set is identical.
What is the difference between variance and standard deviation?
They describe the same spread but on different scales: variance is the average squared deviation, and standard deviation is its square root, back in the original units. If the variance is 25, the standard deviation is 5.
How is variance used in real analysis?
Variance underlies risk in finance, signal power in engineering and the F-test in ANOVA, where the variance between groups is compared with the variance within them to decide whether group means really differ.
API — use this calculator from code
Call this calculator as a free JSON endpoint — no key required. Send the field values below as query parameters or JSON. Read the full API docs →
Endpoint
GET https://calculator.free/api/v1/variance/
curl
curl "https://calculator.free/api/v1/variance/?numbers=12, 15, 17, 20, 22, 25&type=sample"
JavaScript fetch()
const r = await fetch(
"https://calculator.free/api/v1/variance/?" + new URLSearchParams({
"numbers": "12, 15, 17, 20, 22, 25",
"type": "sample"
}));
const data = await r.json();
console.log(data.results);
Results are estimates for general guidance only, not financial, medical or tax advice.