Variance measures how spread out a data set is: it is the average of the squared distances of each value from the mean. Find the mean, square each value's deviation from it, and average those squares — dividing by n for the population variance, or by n − 1 for the sample variance (used when your data is a sample of a larger group). The standard deviation is the square root of the variance. For 2, 4, 4, 4, 5, 5, 7, 9 the population variance is 4 and the sample variance is about 4.5714.
Variance Calculator — sample and population variance
Enter numbers separated by commas, spaces, or new lines.
The variance of 2, 4, 4, 4, 5, 5, 7, 9.
- Population variance (σ²)
- 4
- Sample standard deviation (s)
- 2.1381
- Population standard deviation (σ)
- 2
- Mean
- 5
- Count
- 8
Quick examples
How it's calculated
- Sample variance = sum of squared deviations ÷ (n − 1)
- n
- = 8
- 4.57
How it works
Variance quantifies spread as the mean squared deviation from the mean, per Wolfram MathWorld:
- Find the mean x̄.
- For each value, take its squared deviation (x − x̄)².
- Average those squared deviations.
The divisor in step 3 depends on whether the data is a whole population or a sample:
- Population variance (σ²) — divide the sum of squared deviations by n.
- Sample variance (s²) — divide by n − 1 (Bessel's correction), which corrects the bias that arises because the mean is estimated from the sample itself.
Variance is in squared units (dollars², points²), which is why the standard deviation — its square root — is often reported instead, since it is back in the original units. This calculator gives both, along with the mean.
Worked example
For 2, 4, 4, 4, 5, 5, 7, 9: the mean is 5, and the squared deviations 9, 1, 1, 1, 0, 0, 4, 16 sum to 32. Dividing by n = 8 gives a population variance of 4; dividing by n − 1 = 7 gives a sample variance of about 4.5714. Their square roots are the population standard deviation (2) and the sample standard deviation (≈ 2.1381).
Frequently asked questions
How do you calculate variance?
- Find the mean, subtract it from each value and square the result, then average those squared deviations. Divide by n for the population variance or by n − 1 for the sample variance.
What is the difference between sample and population variance?
- The population variance divides by n and describes an entire group; the sample variance divides by n − 1 and estimates a population's variance from a sample without bias. The sample variance is always the larger of the two.
What is the relationship between variance and standard deviation?
- The standard deviation is the square root of the variance. Variance is easier to work with algebraically, but standard deviation is easier to interpret because it shares the data's units.
Why is variance in squared units?
- Because each deviation is squared before averaging. Squaring keeps negative and positive deviations from cancelling, but it also squares the units — which is exactly why the standard deviation is often preferred for reporting.
What does a variance of 0 mean?
- Every value equals the mean, so there is no spread. Larger variance means the values are more scattered.
Which divisor should I use?
- Use n − 1 (sample) when your numbers are a sample of a larger population — the usual case — and n (population) only when the data covers the entire group.
How we know this is right
- Last reviewed
- Aug 8, 2026
- Precision
- Rounded to 4 decimal places.