Variance Calculator

Paste a data set and get the sample and population variance, along with the mean, standard deviation and count.

Quick answer: Variance is the average squared distance from the mean. Sample s² = Σ(x−x̄)² ÷ (n−1); population σ² = Σ(x−x̄)² ÷ n. For 2, 4, 4, 4, 5, 5, 7, 9 (mean 5), population variance = 4 and sample variance ≈ 4.571.

Variance quantifies how spread out a data set is by averaging the squared distances of each value from the mean. Squaring keeps negative and positive deviations from cancelling and weights larger departures more heavily. It's the foundation of the standard deviation and of many tests in statistics.

The formulas

Mean x̄ = Σx ÷ n
Sample variance s² = Σ(x − x̄)² ÷ (n − 1)
Population variance σ² = Σ(x − x̄)² ÷ n

Worked example

For 2, 4, 4, 4, 5, 5, 7, 9: mean = 5 and the squared deviations sum to 32. Population variance = 32 ÷ 8 = 4. Sample variance = 32 ÷ 7 ≈ 4.571.

Frequently asked questions

How do I calculate variance?
Find the mean, sum the squared differences from the mean, then divide by n − 1 (sample) or n (population).
What are the units of variance?
The square of the data's units. Standard deviation (its square root) returns to the original units.
Sample vs population variance?
Divide by n − 1 for a sample of a larger group; divide by n only when you have the entire population.
Can variance be negative?
No. It averages squared values, so it's always zero or positive; zero means all values are identical.

Related calculators

For general and educational use.
Written by the CalcPine team · Reviewed for accuracy · Last updated 01 Aug 2026 · Method: s² = Σ(x−x̄)²/(n−1); σ² = Σ(x−x̄)²/n.