Variance Calculator s² & σ²
Find the sample and population variance of any data set, with the standard deviation too.
Separate with commas, spaces or new lines.
Show working (LaTeX)
This free variance calculator finds the sample (s²) and population (σ²) variance of any data set, and shows the standard deviation and the working too.
How to use the variance calculator
Paste your numbers into the variance calculator above and press Calculate. It returns both the sample variance and the population variance, plus the mean and standard deviation, with the formula shown step by step. This variance and standard deviation calculator handles decimals and negatives and accepts a pasted spreadsheet column.

What is variance?
Variance is the average of the squared distances between each value and the mean; a larger variance means more spread. See the variance reference for more.
Variance formula
Population variance divides by N; sample variance divides by n−1 (Bessel’s correction):
$$\sigma^2=\frac{\sum (x_i-\mu)^2}{N}\qquad s^2=\frac{\sum (x_i-\bar{x})^2}{n-1}$$How to calculate variance step by step
- Find the mean of the data.
- Subtract the mean from each value and square it.
- Average the squared deviations (divide by N or n−1).
Worked example
For 4, 8, 6, 5, 12, 9 the mean is 7.3333; the sample variance is about 8.2667 and the population variance about 6.8889.
Variance vs standard deviation
The standard deviation is the square root of the variance, expressed in the original units. Variance is in squared units, which is why we often report the standard deviation instead.
Why variance matters in machine learning
In machine learning for beginners, variance drives feature scaling, PCA (which keeps the directions of highest variance) and the bias–variance tradeoff. It also underpins the z-score.
🤖 ML insight
PCA keeps the directions of maximum variance and discards low-variance directions to reduce dimensionality while losing as little information as possible.
Frequently asked questions
Does this variance calculator give sample or population variance?
What is the difference between variance and standard deviation?
Why divide by n−1 for a sample?
Can variance be negative?
Is the variance calculator free?
When to use variance
Variance shines whenever you need one number for how spread out data is, and it adds up nicely: for independent variables, the variance of a sum equals the sum of the variances. That property makes it the natural measure behind risk in finance and noise in measurements.
Two cautions. Because deviations are squared, it is heavily influenced by outliers — one extreme value can dominate it. And its units are squared (dollars squared, centimetres squared), which is why people usually quote the square root instead. For a quick, intuitive read of spread, report the standard deviation alongside it.
Variance calculator: summary
This variance calculator gives the sample and population variance with the working shown. Pair it with the standard deviation calculator and the mean calculator.