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
Using the example values (press “Load example” above to try them):
- 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.
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
Statistics homework
Computing variance with every squared deviation shown.
Choosing n or n − 1
Comparing sample and population variance on the same data.
Variance confidence interval
Estimating a range for the true variance.
Preparing for tests
Getting variances for ANOVA or F-tests.
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 numbers, so it is zero or positive. It is zero only when all values are equal.
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.