Sample Variance Calculator

This sample variance calculator finds the sample variance (n − 1) and the population variance (n) side by side. It shows the full squared-deviation table and a confidence interval for the true variance.

Separate numbers with commas, spaces or new lines.

Checks on your data

  • No outliers beyond 1.5 × IQR and no strong skew detected.

Results

Sample variance (s²)
4.571429
divides by n − 1
Population variance (σ²)
4
divides by n
Sample standard deviation (s)
2.13809
Population standard deviation (σ)
2
Mean (x̄)
5
Sum of squares (SS)
32
Count (n)
8
95% CI for the population variance
1.99841 to 18.9364
chi-square interval, assumes normal data
95% CI for the population SD
1.41365 to 4.35159
Data with mean and ±1 standard deviation
2468mean 5
Squared deviation of each value (the building blocks of variance)
0510152: 9294: 1414: 1414: 1415: 0505: 0507: 4749: 16916
Sample variance with confidence interval
σ²: 1.998 to 18.945101520
Squared deviations
Value xx − x̄(x − x̄)²
2-39
4-11
4-11
4-11
500
500
724
9416
Show step-by-step solution
  1. Mean x̄ = 40 ÷ 8 = 5.
  2. Squared deviations are listed in the table; Σ(x − x̄)² = 32.
  3. Sample variance s² = 32 ÷ (8 − 1) = 4.57143.
  4. Population variance σ² = 32 ÷ 8 = 4.
  5. Confidence interval for σ²: (n − 1)s² divided by the chi-square quantiles with 7 df, giving 1.99841 to 18.9364.
Sample varianceΣ(x − x̄)² / (n − 1)
Population varianceΣ(x − μ)² / N
UnitsSquared units of data
SD√variance

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

  1. Enter your data values.
  2. Use the sample variance unless you truly have the whole population.
  3. 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

s2=∑(xi−xˉ)2n−1s^2=\frac{\sum (x_i-\bar{x})^2}{n-1}

Population variance

σ2=∑(xi−μ)2N\sigma^2=\frac{\sum (x_i-\mu)^2}{N}

Shortcut formula

s2=∑xi2−nxˉ2n−1s^2=\frac{\sum x_i^2-n\bar{x}^2}{n-1}

Algebraically equal, but it can lose precision with large numbers. This calculator uses the deviation form.

Confidence interval for variance

(n−1)s2χ1−α/2, n−12≤σ2≤(n−1)s2χα/2, n−12\frac{(n-1)s^2}{\chi^2_{1-\alpha/2,\,n-1}}\le\sigma^2\le\frac{(n-1)s^2}{\chi^2_{\alpha/2,\,n-1}}

Sample Variance Variables Explained

SymbolMeaningNotes
s²Sample varianceΣ(x − x̄)² ÷ (n − 1)
σ²Population varianceΣ(x − μ)² ÷ n
x̄Sample mean
nNumber of values

Sample Variance Worked Example

Using the example values (press “Load example” above to try them):

  1. Mean x̄ = 40 ÷ 8 = 5.
  2. Squared deviations are listed in the table; Σ(x − x̄)² = 32.
  3. Sample variance s² = 32 ÷ (8 − 1) = 4.57143.
  4. Population variance σ² = 32 ÷ 8 = 4.
  5. 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 vs population variance
Sample variance s²Population variance σ²
Divisorn − 1N
Use whenData are a sampleYou have every member
BiasUnbiased estimatorBiased if used on a sample
Spreadsheet functionVAR.S / VARVAR.P / VARP
Calculator keysₓσₓ

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.

Related calculators

Last updated 2026-11-09. See our disclaimer.