Sample Variance Calculator

Published on: November 26, 2026
Final Answer: Free | Full Steps: Plus

This Sample Variance Calculator measures how spread out a sample is and shows the working line by line. It finds the mean, takes it away from each value and squares the differences so values above and below the mean don't cancel out. The squares are added and divided by one less than the number of values, which corrects for a sample usually sitting closer to its own mean than the whole population does. The same pattern works for any list of numbers.

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Find the mean of the values.
  4. Subtract the mean from each value.
  5. Square each difference.
  6. Add the squared differences.
  7. Substitute the total and the count into the formula.
  8. Divide to get the sample variance.

Formula: Sample Variance Formula

This formula averages the squared distances from the mean using n - 1 instead of n. Take the mean from each value, square, add, then divide by n - 1.

\(s^{2} = \frac{\Sigma (x - \bar{x})^{2}}{n - 1}\)

Useful Tips to Remember

The sample variance is \(s^2 = \frac{\Sigma(x - \bar{x})^2}{n - 1}\), dividing by \(n - 1\) to correct for using a sample. Square each deviation from the mean before adding them. The variance is in squared units, so take the square root to get the standard deviation. It can never be negative.

Required knowledge

Where Is the Sample Variance Used?

The sample variance estimates how spread out a population is from a sample, using the squared deviations from the mean with \(n - 1\) in the denominator. Dividing by \(n - 1\) corrects the tendency of a sample to underestimate the true spread. Variance is the basis of many statistical methods, including analysis of variance, which compares several groups at once, and regression analysis. Researchers, engineers and financial analysts use it to measure variability, compare methods and build models from limited data.

  • Comparing groups with analysis of variance
  • Estimating variability from a limited sample
  • Building regression and forecasting models
  • Comparing the precision of measuring methods
  • Measuring the volatility of investment returns

Sample Variance Practice Problems

Example 1 uses 1, 2, 3, 4, 5, and Example 2 uses 3, 7, 7, 19. Try squaring the deviations and dividing by \(n - 1\) yourself before opening each example. For two more free worked examples, check out the Sample Variance Notes.

The worked examples below go through the same pattern from start to finish, so you can compare every step with your own working. For more practice, the notes page goes further with extra worked examples and fuller explanations of the ideas behind each step. Use them together to check your answers and to understand why each step works.

See Example 1 Hide Example 1

Problem

\(1,\; 2,\; 3,\; 4,\; 5\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Find the mean of the values.
  4. Subtract the mean from each value.
  5. Square each difference.
  6. Add the squared differences.
  7. Substitute the total and the count into the formula.
  8. Divide to get the sample variance.

Formula

Formula: Sample Variance Formula

This formula averages the squared distances from the mean using n - 1 instead of n. Take the mean from each value, square, add, then divide by n - 1.

\(s^{2} = \frac{\Sigma (x - \bar{x})^{2}}{n - 1}\)

Step 1

Step 1 - Set up the problem.

In this problem: We are finding how spread out the sample \(1,\; 2,\; 3,\; 4,\; 5\) is.

\(1,\; 2,\; 3,\; 4,\; 5\)

Step 2

Step 2 - Write the formula.

In this problem: For a sample, the squared differences from the mean are added and divided by one less than the number of values.

\(s^{2} = \frac{\Sigma (x - \bar{x})^{2}}{n - 1}\)

Step 3

Step 3 - Find the mean of the values.

In this problem: The mean of the values is \(\bar{x} = 3\).

\(\bar{x} = 3\)

Step 4

Step 4 - Subtract the mean from each value.

In this problem: Taking the mean away from each value in turn gives \(1 - 3 = -2\), \(2 - 3 = -1\), \(3 - 3 = 0\), \(4 - 3 = 1\), \(5 - 3 = 2\).

\(\begin{array}{c|c} x & x - \bar{x} \\ \hline 1 & -2 \\ 2 & -1 \\ 3 & 0 \\ 4 & 1 \\ 5 & 2 \end{array}\)

Step 5

Step 5 - Square each difference.

In this problem: Squaring each difference removes the minus signs, giving \(\left(-2\right)^{2} = 4\), \(\left(-1\right)^{2} = 1\), \(0^{2} = 0\), \(1^{2} = 1\), \(2^{2} = 4\).

\(\begin{array}{c|c} x - \bar{x} & (x - \bar{x})^{2} \\ \hline -2 & 4 \\ -1 & 1 \\ 0 & 0 \\ 1 & 1 \\ 2 & 4 \end{array}\)

Step 6

Step 6 - Add the squared differences.

In this problem: Adding the squared differences gives \(4 + 1 + 0 + 1 + 4 = 10\).

\(\Sigma (x - \bar{x})^{2} = 4 + 1 + 0 + 1 + 4 = 10\)

Step 7

Step 7 - Substitute the total and the count into the formula.

In this problem: Replacing the total with \(10\) and \(n\) with \(5\), the number of values, gives \(s^{2} = \frac{10}{5 - 1}\).

\(s^{2} = \frac{10}{5 - 1}\)

Step 8

Step 8 - Divide to get the sample variance.

In this problem: Dividing by \(5 - 1 = 4\) gives \(10 \div 4 = 2.5\).

\(s^{2} = \frac{10}{5 - 1} = 2.5\)

Final Answer

\(s^{2} = 2.5\)
See Example 2 Hide Example 2

Problem

\(3,\; 7,\; 7,\; 19\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Find the mean of the values.
  4. Subtract the mean from each value.
  5. Square each difference.
  6. Add the squared differences.
  7. Substitute the total and the count into the formula.
  8. Divide to get the sample variance.

Formula

Formula: Sample Variance Formula

This formula averages the squared distances from the mean using n - 1 instead of n. Take the mean from each value, square, add, then divide by n - 1.

\(s^{2} = \frac{\Sigma (x - \bar{x})^{2}}{n - 1}\)

Step 1

Step 1 - Set up the problem.

In this problem: We are finding how spread out the sample \(3,\; 7,\; 7,\; 19\) is.

\(3,\; 7,\; 7,\; 19\)

Step 2

Step 2 - Write the formula.

In this problem: For a sample, the squared differences from the mean are added and divided by one less than the number of values.

\(s^{2} = \frac{\Sigma (x - \bar{x})^{2}}{n - 1}\)

Step 3

Step 3 - Find the mean of the values.

In this problem: The mean of the values is \(\bar{x} = 9\).

\(\bar{x} = 9\)

Step 4

Step 4 - Subtract the mean from each value.

In this problem: Taking the mean away from each value in turn gives \(3 - 9 = -6\), \(7 - 9 = -2\), \(7 - 9 = -2\), \(19 - 9 = 10\).

\(\begin{array}{c|c} x & x - \bar{x} \\ \hline 3 & -6 \\ 7 & -2 \\ 7 & -2 \\ 19 & 10 \end{array}\)

Step 5

Step 5 - Square each difference.

In this problem: Squaring each difference removes the minus signs, giving \(\left(-6\right)^{2} = 36\), \(\left(-2\right)^{2} = 4\), \(\left(-2\right)^{2} = 4\), \(10^{2} = 100\).

\(\begin{array}{c|c} x - \bar{x} & (x - \bar{x})^{2} \\ \hline -6 & 36 \\ -2 & 4 \\ -2 & 4 \\ 10 & 100 \end{array}\)

Step 6

Step 6 - Add the squared differences.

In this problem: Adding the squared differences gives \(36 + 4 + 4 + 100 = 144\).

\(\Sigma (x - \bar{x})^{2} = 36 + 4 + 4 + 100 = 144\)

Step 7

Step 7 - Substitute the total and the count into the formula.

In this problem: Replacing the total with \(144\) and \(n\) with \(4\), the number of values, gives \(s^{2} = \frac{144}{4 - 1}\).

\(s^{2} = \frac{144}{4 - 1}\)

Step 8

Step 8 - Divide to get the sample variance.

In this problem: Dividing by \(4 - 1 = 3\) gives \(144 \div 3 = 48\).

\(s^{2} = \frac{144}{4 - 1} = 48\)

Final Answer

\(s^{2} = 48\)

Notes and Practice Mode

Example Problems

Click one to load it into the box and solve it.