Skip to content
(1 found this helpful)

Variance Calculator

This calculator calculates the sample variance (s2) or population variance (σ2) for your data and shows you how to calculate each of these statistics manually, step-by-step. In addition to the variance, it also shows other related statistics, such as the mean, the standard deviation, the sum of all values, the sum of squared deviations, and the sample size.

Simply enter your data either as comma, space, or tab-separated values, and click the “Calculate” button to get instant results, along with a clear, step-by-step solution.

Enter your data separated by commas, spaces, tabs or copy-paste from Excel.

How to Use the Variance Calculator

To find the sample variance (s2) or the population variance (σ2) using this tool, follow these steps:

  1. Enter the dataset as comma, space, or tab-separated values. You can also copy-paste values from Excel
  2. Select the type of dataset you’re working with. Is it sample data or population data?
  3. Click the “Calculate” button

The calculator will instantly return the correct variance based on your selection and show you how to compute variance by hand, step-by-step.

In addition to variance, the calculator also presents you with related statistics such as the mean, the standard deviation, the sum of all values, the sample size, and the sum of squared deviations.

What is Variance?

Variance is a statistical measure of dispersion that shows how much a set of data values is spread out from their mean. A small value indicates that the data values are close to each other, whereas a large value suggests that the values are widely spread.

There are two main types of variance:

  • Population Variance (σ²). This measures variability for an entire population of data. Thus, you should use this if you have all the data points from the target population.
  • Sample Variance (s²). It estimates variability from a subset/sample drawn from the target population.

Variance Formula

The variance formula differs based on whether you’re working with population or sample data.

For instance, if you’re working with data from a population, you should use the population variance formula. The formula is:

σ2=∑(xi​−μ)2​/N

Where:

  • σ2 is the population variance
  • N is the number of observations in the population data
  • μ is the population mean
  • ∑(xi​−μ)2 represents the sum of squared deviations from the population mean

However, if you’re working with sample data, you should use the sample variance formula. The formula is:

s2=∑(xi​−x̄)2​/n−1

Where:

  • s2 is the sample variance
  • x̄ is the sample mean
  • n is the number of observations in the sample, also known as the sample size.
  • ∑(xi​−x̄ )2 represents the sum of squared deviations from the sample mean

Note. Variance is closely related to standard deviation. In particular, the standard deviation is simply the square root of its variance.

How to Calculate Variance by Hand

Calculating the variance of a sample or population is very simple if you follow a clear, step-by-step process. The steps differ slightly in how you divide the sum of squared deviations.

1. Finding the Population Variance

To find the population variance manually, follow these simple steps:

  1. Find the population mean (μ)
  2. Compute the deviations from the population mean and square them
  3. Sum all squared deviations
  4. Divide the sum of squared deviations by N

Example 1. Calculate the population variance of the following dataset.

Data: 9, 18, 30, 36, 42

Solution

Step 1. Find the population mean

The population mean formula is: μ = ∑xi/N

​Thus, μ = (9 + 18 + 30 + 36 + 42)/5

=135/5

= 27

Step 2. Calculate deviations from the population mean and square them

The table below shows how to compute deviations from the population mean and their squares.

xᵢxᵢ − 27(xᵢ − 27)²
99-27 = -18(-18)2 = 324
1818-27 = -9(-9)2 = 81
3030-27 = 3(3)2 = 9
3636-27 = 9(9)2 = 81
4242-27 = 15(15)2 = 225

Step 3. Calculate the Sum of Squared deviations

The sum of squared deviations gives the numerator part of the formula. To find this value, we need to sum all values in the (xᵢ − 27)² column.

Thus, ∑(xi​−μ)2​ = 324 + 81 + 9 + 81 + 225

= 720

Step 4. Divide the sum of squared deviations by N

Dividing the sum of squared deviations by the total number of observations in the population data (N) gives the population variance.

Thus, population variance, σ2 = 720/5

= 144

Alternatively, you can copy-paste the data into the calculator, select population variance, and click the “Calculate” button. The calculator yields similar results as shown below.

Population variance example using the calculator

2. Finding the Sample Variance

To find the sample variance by hand, follow these simple steps:

  1. Find the sample mean (x̄)
  2. Compute the deviations from the sample mean and square them
  3. Sum all squared deviations
  4. Divide the sum of squared deviations by n-1

Example 2. Calculate the sample variance for 5, 10, 15, and 20

Solution

Step 1. Find the sample mean

By definition, the sample mean, x̄ = ∑xi/n

= (5 + 10 + 15 + 20)/4

=50/4

=12.5

Step 2. Compute the deviations from the sample mean and square them

The table below shows how to calculate deviations from the sample mean and their squares

xᵢxᵢ − 12.5(xᵢ − 12.5)²
55-12.5 = -7.5(-7.5)2 = 56.25
1010-12.5 = -2.5(-2.5)2 = 6.25
1515-12.5 = 2.5(2.5)2 = 6.25
2020-12.5 = 7.5(7.5)2 = 56.25

Step 3. Sum all the squared deviations

The squared deviations are in column (xᵢ − 12.5)²

Thus, to find the sum of all the squared deviations, we need to sum all the values in that column.

Thus, the sum of all squared deviations, ∑(xi​−x̄)2​ = 56.25 + 6.25 + 6.25 + 56.25

=125

Step 4. Divide the sum of squared deviations by n-1

Dividing the sum of squared deviations from the sample mean by n-1 gives the sample variance.

Thus, sample variance, s2 = 125/4-1

=125/3

=41.6667

Alternatively, entering the data into the calculator, selecting sample variance, and clicking the “calculate” button will yield similar results, as shown below.

Sample variance example using the calculator

Population Variance vs. Sample Variance

Still unable to differentiate between sample and population variance? Here’s a quick overview of the main differences:

  • Use population variance (σ²) when you have data for the entire group you’re studying.
    For example, if you calculate the variance of test scores for all 50 students in a class, that’s population variance.
  • Use sample variance (s²) when you only have a subset of data from a larger population.
    For example, if you randomly select 10 students from a school to estimate overall performance, you’re working with a sample. Hence, you should calculate the sample variance
  • For a population variance, divide the sum of squared deviations by population size (N). However, for a sample variance, divide the sum of squared deviations by n-1

Wondering why we divide the sum of squared deviations by n-1 when calculating sample variance? Here’s why. The sample data tend to underestimate variability. Thus, by dividing by n-1, we adjust for that bias. This adjustment is known as Bessel’s correction.

Frequently Asked Questions

What is variance in statistics?

Variance is a statistical measure that shows how far data values spread out from the mean. A low variance means the numbers are close to the average, while a high variance means the data points are more spread out.

What is the difference between population variance and sample variance?

The main difference between population variance and sample variance is the denominator used in the formula. Population variance divides the sum of squared deviations by N (total number of observations), while sample variance divides it by n − 1 to adjust for sampling bias.

How do you calculate variance?

To calculate variance step by step:
– Find the mean.
– Subtract the mean from each data value.
– Square each deviation.
– Add all squared deviations.
– Divide the sum of squared deviations by N (population) or n − 1 (sample).
Our free variance calculator automates this process and shows a full step-by-step solution with a click of a button.

Why do we divide by n − 1 in sample variance?

We divide by n − 1 in the sample variance to correct for bias when estimating population variability. This adjustment ensures that the sample variance provides an unbiased estimate of the population variance.

Is variance the same as standard deviation?

No. While variance is the average of squared deviations from the mean, the standard deviation is simply the square root of variance.

Cite this Calculator
Cite:
Embed: