Variance Calculator
Variance is the average of the squared deviations of the values from their mean, and it measures how widely a distribution is spread out. The larger the variance, the further the values sit from the mean; a variance of zero means every value is identical. The standard deviation is the square root of the variance and is interpreted in the unit of the data itself.
This calculator returns both the sample variance (with the n−1 denominator, used for research data) and the population variance (with the n denominator), together with the mean and the standard deviation. A step table showing each value's deviation and squared deviation lets you check a hand calculation line by line.
Formula
Sample variance: s² = Σ(xᵢ − x̄)² / (n − 1) Population variance: σ² = Σ(xᵢ − μ)² / n Standard deviation = √variance
The most common mistake is picking the wrong denominator: if your data is a sample (a survey, an experiment, a set of measurements), divide by n−1 (Bessel's correction); divide by n only when you have measured the entire population without exception.
How to Calculate
- Paste your data values into the box — separate them with commas, spaces, or line breaks.
- Choose whether your data is a sample (n−1 denominator) or the entire population (n denominator).
- Read the variance, the standard deviation, and the mean in the results section.
- Use the step-by-step table to check the deviation and the squared deviation of every value.
Worked Examples
Sample variance of exam scores
The mean of the scores 70, 75, 80, 85, 90 is 80. The sum of squared deviations is 100 + 25 + 0 + 25 + 100 = 250; divided by n − 1 = 4 this gives a sample variance of 62.5 and a standard deviation of √62.5 ≈ 7.91.
Sample variance (s²): 62.5000 · Sample standard deviation (s): 7.9057 · Mean (x̄): 80.0000
Population variance of the same data
If these five scores make up the whole class (the population), the same sum of squares, 250, is divided by n = 5 instead: the population variance is 50 and the population standard deviation is √50 ≈ 7.07. The choice of denominator visibly changes the result.
Population variance (σ²): 50.0000 · Population standard deviation (σ): 7.0711 · Mean (x̄): 80.0000
A classic textbook example
For the data 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5; the sum of squared deviations is 32, and dividing by n = 8 gives a population variance of exactly 4 and a standard deviation of 2. Had the sample option been selected, the same sum of 32 would be divided by n − 1 = 7 and the variance would come out somewhat larger.
Population variance (σ²): 4.0000 · Population standard deviation (σ): 2.0000 · Mean (x̄): 5.0000