Variance Calculator
Separate numbers with commas, spaces, or line breaks.
Calculation process
Step 1: Calculate the mean
Step 2: Subtract the mean from each value and square the result
Step 3: Divide the sum of squared deviations by the divisor
What is the variance?
The variance measures how spread out a set of values is around its mean. It is the average of the squared deviations from the mean: each value’s distance from the mean is squared (so positive and negative distances do not cancel out), and those squares are averaged. A variance of zero means every value is identical; the larger the variance, the more dispersed the data.
Because the deviations are squared, the variance is expressed in squared units (hours², dollars², points²). That makes it hard to read directly, which is why the standard deviation, its square root, is usually reported alongside it. Variance is nonetheless the quantity that most statistical methods actually work with: ANOVA, regression, and the t-test all partition or compare variances.
Two versions exist, and the calculator above lets you switch between them:
- Sample variance (s²) — use when your data are a sample from a larger population. The sum of squared deviations is divided by n − 1.
- Population variance (σ²) — use when your data are the entire population of interest. The sum of squared deviations is divided by N.
Dividing by n − 1 (Bessel’s correction) corrects for the fact that a sample’s values sit closer to their own mean than to the true population mean, which would otherwise make the variance estimate too small. Most software defaults to the sample formula: R’s var(), Excel’s VAR.S, and SPSS all divide by n − 1.
Variance formula
Sample variance
- s² — sample variance
- xi — each individual value
- x̄ — sample mean
- n — number of values in the sample
Population variance
- σ² — population variance
- μ — population mean
- N — number of values in the population
How to calculate variance by hand
Both versions follow the same three steps; only the divisor in step 3 changes.
Example 1: sample variance
Six students report the number of hours they studied for an exam: 12, 15, 9, 20, 14, 18. Treat this as a sample.
| xi | xi − x̄ | (xi − x̄)² |
|---|---|---|
| 12 | 12 − 14.6667 = −2.6667 | 7.1111 |
| 15 | 15 − 14.6667 = 0.3333 | 0.1111 |
| 9 | 9 − 14.6667 = −5.6667 | 32.1111 |
| 20 | 20 − 14.6667 = 5.3333 | 28.4444 |
| 14 | 14 − 14.6667 = −0.6667 | 0.4444 |
| 18 | 18 − 14.6667 = 3.3333 | 11.1111 |
| Sum | 0 | 79.3333 |
The deviations always sum to zero, which is a quick check on the mean. Σ(xi − x̄)² = 79.3333 is called the sum of squares.
Paste the same six numbers into the calculator above with “Sample” selected to confirm.
Example 2: population variance
Now suppose those six students are the entire class (the whole population of interest), so we use the population formula on the same data.
The population variance is smaller than the sample variance (13.2222 vs 15.8667) because the divisor is larger. The gap shrinks as the number of observations grows; with hundreds of values the two are nearly identical.
Which one should I report?
- Survey responses, experimental measurements, or any data meant to generalize beyond the cases you collected → sample (s²).
- Every unit you care about is in the data set — all employees in a department, all exam scores in one class you are only describing → population (σ²).
Related Tutorials
Calculate Population Variance in Excel
Population Variance Formula and Calculation by Hand
Calculate Sample Variance in Excel
Sample Variance Formula and Calculation by Hand
Discussion