What Is Sample Variance?
Variance is the average squared distance of the values from the mean. For a sample, you divide the sum of squared deviations by n − 1 instead of n, which corrects the tendency of a sample to understate the population's spread.
Enter your data to get the sample variance s², the population variance σ², both standard deviations, the mean and a confidence interval for the population variance. The squared-deviation table shows every step and the shortcut formula gives a check.
Below you will find the formulas, a variables table, a worked example and answers to common questions such as why n − 1 is used and how variance relates to standard deviation.
How to Use the Sample Variance Calculator
- Enter your data values.
- Use the sample variance unless you truly have the whole population.
- Review the squared-deviation table to follow the calculation, and the interval to judge how precisely the variance is estimated.
Sample Variance Formula
Sample variance
Population variance
Shortcut formula
Algebraically equal, but it can lose precision with large numbers. This calculator uses the deviation form.
Confidence interval for variance
Sample Variance Variables Explained
| Symbol | Meaning | Notes |
|---|---|---|
| s² | Sample variance | Σ(x − x̄)² ÷ (n − 1) |
| σ² | Population variance | Σ(x − μ)² ÷ n |
| x̄ | Sample mean | |
| n | Number of values |
Sample Variance Worked Example
With the example values loaded in the calculator above, the steps are:
- Mean x̄ = 40 ÷ 8 = 5.
- Squared deviations are listed in the table; Σ(x − x̄)² = 32.
- Sample variance s² = 32 ÷ (8 − 1) = 4.57143.
- Population variance σ² = 32 ÷ 8 = 4.
- Confidence interval for σ²: (n − 1)s² divided by the chi-square quantiles with 7 df, giving 1.99841 to 18.9364.
Result: Sample variance (s²) = 4.571429; Population variance (σ²) = 4.
Worked Example: Dividing by n − 1
For 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5 and the sum of squared distances is 32. Dividing by n gives the population variance, 4. Dividing by n − 1 = 7 gives the sample variance, 4.571, and a standard deviation of 2.138. The smaller divisor corrects for the fact that a sample's own mean sits closer to its values than the true mean does.
The 95% confidence interval for the population variance is 1.998 to 18.94, nearly ten times wider at the top than at the bottom. With only eight values the variance is estimated very loosely. The interval is built from the chi-square distribution and assumes the data are roughly normal.
Why divide by n − 1?
The sample mean is computed from the same data, so the deviations from it are slightly smaller than deviations from the true mean. Dividing by n would systematically underestimate the population variance. Using n − 1 corrects that bias. The correction matters a lot for small samples and very little once n is large, because n − 1 and n become nearly equal.
| Sample variance s² | Population variance σ² | |
|---|---|---|
| Divisor | n − 1 | N |
| Use when | Data are a sample | You have every member |
| Bias | Unbiased estimator | Biased if used on a sample |
| Spreadsheet function | VAR.S / VAR | VAR.P / VARP |
| Calculator key | sₓ | σₓ |
How to interpret a variance
Variance is in squared units (dollars², cm²), so it is hard to picture directly. That is why people usually take its square root, the standard deviation, to get back to the original units. Use variance when you need to add or compare spread across independent sources, because variances of independent variables add, while standard deviations do not.
Compare variance only between data on the same scale. For different scales, use the coefficient of variation.
The confidence interval for variance
The interval uses the chi-square distribution and assumes the underlying data are normal. It is typically very wide for small samples and is not symmetric around the estimate. The interval is sensitive to non-normality, so treat it as indicative if your data are skewed.
Where Sample Variance Is Used
Variance of a sample
Compute s² and σ² from a list of values.
Confidence interval
Read an interval for the population variance and SD.
Squared deviations
Follow each squared deviation in the table.
Checking homework
Confirm the sum of squares and the divisor.
Common Sample Variance Mistakes to Avoid
- Check whether your teacher or software expects sample or population variance. They differ by the factor n/(n − 1).
- Variance is sensitive to outliers because deviations are squared.
- Report the standard deviation alongside variance for readability.
- The sum of squares (SS) is shown in the results; it is the numerator in both formulas and the key quantity in ANOVA.
Sample Variance Terms and Definitions
- Bessel’s correction
- Using n − 1 instead of n to get an unbiased sample variance.
- Sum of squares (SS)
- Σ(x − x̄)², the total squared distance from the mean.
Sample Variance FAQs
How do you calculate sample variance?
Find the mean, subtract it from each value, square each difference, add them up, and divide by n − 1.
What is the difference between sample and population variance?
Sample variance divides by n − 1 and estimates the population variance; population variance divides by N and applies when you have all the data.
Can variance be negative?
No. It is an average of squared values, so it is zero or positive. Zero means every value is identical.
What does a high variance mean?
The values are spread widely around the mean. Whether it is “high” depends on the scale of your data.
How is variance related to standard deviation?
Standard deviation is the square root of variance, which returns the spread to the original units.
Why is my answer different from my textbook?
Check whether the book used the population formula (divide by n) or the sample formula (divide by n − 1). Both are shown here.
What data do I need for a variance confidence interval?
The sample variance, the sample size and an assumption that the data are approximately normal.
Why divide by n − 1 for sample variance?
Deviations are measured from the sample mean, which sits closer to the data than the true mean, so dividing by n would understate the spread. Dividing by n − 1 corrects that bias. For 2, 4, 4, 4, 5, 5, 7, 9 the sum of squares is 32, giving 32 ÷ 7 = 4.571 for the sample and 32 ÷ 8 = 4 for the population.
When do I use population variance instead?
Use it only when your data is the entire population, not a sample from it.
How do I get the standard deviation from the variance?
Take the square root. The sample variance 4.571 gives a standard deviation of 2.138.