Variance Calculator
Calculate the variance and standard deviation of a data set — for a sample or a population — with the mean and the step-by-step working shown.
How to calculate variance
Variance measures how spread out a set of numbers is. You find the mean, subtract it from each value and square the difference, then average those squared differences. For a population you divide by n; for a sample you divide by n − 1. The square root of the variance is the standard deviation. Enter your numbers above and the calculator returns the sample and population variance, both standard deviations and the mean.
σ² = Σ(x − μ)² ÷ n (population), s² = Σ(x − x̄)² ÷ (n − 1) (sample)
For example, for 4, 8, 6, 5, 3, 7 the mean is 5.5; the squared differences sum to 17.5, so the sample variance is 17.5 ÷ 5 = 3.5 and the population variance is 17.5 ÷ 6 ≈ 2.92.
Sample vs. population variance
Use population variance when your numbers are the entire group, and sample variance when they are a sample standing in for a larger population — dividing by n − 1 (Bessel’s correction) corrects the tendency of a sample to understate the true spread. Need just the spread of a set, or the mean, median and mode? See the average calculator.
Frequently asked questions
How do I calculate variance?
Find the mean, subtract it from each value and square the result, then average those squared differences. For a population you divide by n; for a sample you divide by n − 1. The square root of the variance is the standard deviation. The calculator shows both and the mean.
What is the basic formula for variance?
Population variance σ² = Σ(x − μ)² ÷ n, where μ is the mean and n is the count. Sample variance s² = Σ(x − x̄)² ÷ (n − 1) uses n − 1 (Bessel’s correction) because a sample underestimates spread. Enter your data above to get both.
What is the difference between sample and population variance?
Population variance describes a complete set and divides by n. Sample variance estimates a larger population from a subset and divides by n − 1, which makes it slightly larger and unbiased. Use sample variance when your data is a sample, population variance when it is the whole group.