# Variance Calculator

Enter a data set for a population or sample to calculate variance using the calculator below.

## Results:

Variance (σ²): | |
---|---|

Standard Deviation (σ): | |

Sum of Squares (SS): | |

Population Size (N): | |

Mean (μ): |

### Steps to Solve

#### Population Variance Formula

#### Step One: Find the Mean

The mean is equal to the sum of each observation x_{i} divided by the population size N.

#### Step Two: Find the Deviation From the Mean

The deviation from the mean for each observation is equal to its value minus the mean μ.

#### Step Three: Square the Deviations

Square each deviation from the mean.

#### Step Four: Find the Sum of Squares

Add each squared deviation to find the sum of squares.

#### Step Five: Find the Variance

The variance is equal to the sum of squares SS divided by the population size N.

Variance (s²): | |
---|---|

Standard Deviation (s): | |

Sum of Squares (SS): | |

Sample Size (n): | |

Mean (x̄): |

### Steps to Solve

#### Sample Variance Formula

#### Step One: Find the Mean

The mean is equal to the sum of each observation x_{i} divided by the sample size n

#### Step Two: Find the Deviation From the Mean

The deviation from the mean for each observation is equal to its value minus the mean x̄.

#### Step Three: Square the Deviations

Square each deviation from the mean.

#### Step Four: Find the Sum of Squares

Add each squared deviation to find the sum of squares.

#### Step Five: Find the Variance

The variance is equal to the sum of squares SS divided by the sample size n minus 1.

## On this page:

- Calculator
- How to Find Variance
- Variance Formula
- Population Variance Formula
- Sample Variance Formula
- Steps to Calculate the Variance
- Step One: Calculate the Mean
- Step Two: Calculate Deviations From the Mean
- Step Three: Square the Deviations
- Step Four: Calculate the Sum of Squares
- Step Five: Calculate the Variance
- How to Find Variance using the Standard Deviation
- References

## How to Find Variance

Variance is a statistical measure of the variability from the mean in a data set. It is essentially a way to measure the spread between numbers and their center in a data set.^{[1]}

The symbol for variance in a population is *σ²* (sigma-squared), and the variance for a sample is *s²* (s-squared).

When interpreting the data, a low variance means that the observations in the set are close to the mean, while a high variance means the data is highly dispersed.

### Variance Formula

The variance is equal to the standard deviation squared, and the formula to calculate it is different for a population versus a sample. There are actually different formulas to calculate the variance for population and sample data sets.

#### Population Variance Formula

You can calculate the population variance using the following formula:^{[2]}

Thus, the variance for a population σ² is equal to the sum of squares ∑(x_{i} – μ)² divided by the population size N.

#### Sample Variance Formula

You can calculate a sample variance using the following formula:^{[3]}

Thus, the variance for a sample s is equal to the sum of squares ∑(x_{i} – x̄)² divided by the sample size n minus 1.

If you look closely, you might notice that in the sample variance formula, the sum of squares is divided by n – 1 rather than just n. This is because when working with a sample, the variance estimation includes some amount of bias.

In the sample variance formula, the n – 1 denominator is called the *degrees of freedom*.^{[4]}

Since the sum of squares for a sample is lower than it is for a population, subtracting one from the sample size artificially increases the variance to offset this bias, which is known as Bessel’s Correction.^{[5]} Bessel’s Correction is more useful when the size of the sample data set is small, but for large sample sizes that are closer to the population size, it’s less necessary.

### Steps to Calculate the Variance

We simplify the formulas above to find the variance in five easy steps.^{[6]}

#### Step One: Calculate the Mean

The first step to finding the variance is to find the sample (or population) mean of the data set.

To calculate the mean, add each observation in the dataset together, then divide the result by the sample size (or population size).

The mean formula is often expressed like this:

So, the mean is equal to the sum of sample observations x_{i} divided by the total number of observations N.

#### Step Two: Calculate Deviations From the Mean

Next, you’ll need to find the deviation from the mean for every observation in the data set by subtracting the mean from each number.

#### Step Three: Square the Deviations

The next step is to calculate the square for each deviation from the mean found in the previous step.

#### Step Four: Calculate the Sum of Squares

Then, calculate the sum of squares using the sum of squares formula:

The sum of squares *SS* is equal to the sum of the squared deviations of each value from the mean.

#### Step Five: Calculate the Variance

Finally, using the sum of squares and sample or population size, it’s time to calculate the variance in the data. The formula to calculate the variance for a population and sample is a bit different:

##### Population Variance

The variance for a population is equal to the sum of squares divided by the size of the population.

##### Sample Variance

The variance for a sample is equal to the sum of squares divided by the number of observations in the sample minus one.

**For example,** let’s calculate the variance for the sample data [1,2,5,6,9,10].

We’ll use the five steps to find the variance shown above.

**Step One:** Find the mean by summing the values, then dividing by the number of values in the data.

**Step Two:** Find the deviations from the mean for each number by subtracting the mean.

Observation | Deviation from x̄ |
---|---|

1 | 1 – 5.5 = -4.5 |

2 | 2 – 5.5 = -3.5 |

5 | 5 – 5.5 = -0.5 |

6 | 6 – 5.5 = 0.5 |

9 | 9 – 5.5 = 3.5 |

10 | 10 – 5.5 = 4.5 |

**Step Three:** Find the square for each of the deviations from the mean by raising them to the power of 2.

Deviation | Squared Deviation |
---|---|

-4.5 | -4.5² = 20.25 |

-3.5 | -3.5² = 12.25 |

-0.5 | -0.5² = 0.25 |

0.5 | 0.5² = 0.25 |

3.5 | 3.5² = 12.25 |

4.5 | 4.5² = 20.25 |

**Step Four:** Find the sum of squares by adding up all of the squared deviations.

**Step Five:** Find the variance by dividing the sum of squares by the number of data points in the sample minus 1.

So, the variance in this sample is equal to **13.1**.

### How to Find Variance using the Standard Deviation

We mentioned earlier that the variance is equal to the standard deviation squared. So, to find the variance using the standard deviation, raise the SD to the power of two.

#### For a Population SD

The variance for a population is equal to the population standard deviation squared.

#### For a Sample SD

The variance for a sample is equal to the sample standard deviation squared.

## References

- Wasserman, L., All of Statistics - A Concise Course in Statistical Inference,
*Springer New York*, 50. https://www.google.com/books/edition/All_of_Statistics/qrcuBAAAQBAJ - Kuter, K., Essential Probability Theory for Data Science - 7.2: Sample Variance,
*LibreTexts Statistics*, https://stats.libretexts.org/Courses/Saint_Mary%27s_College_Notre_Dame/DSCI_500B_Essential_Probability_Theory_for_Data_Science_(Kuter)/07%3A_The_Sample_Variance_and_Other_Distributions/7.2%3A_Sample_Variance - Outlier, How To Calculate Variance In 4 Simple Steps, https://articles.outlier.org/how-to-calculate-variance
- Lane, D., Introductory Statistics - 10.2: Degrees of Freedom,
*LibreTexts Statistics*, https://stats.libretexts.org/Bookshelves/Introductory_Statistics/Book%3A_Introductory_Statistics_(Lane)/10%3A_Estimation/10.02%3A_Degrees_of_Freedom - Oxford College Department of Mathematics and Computer Science, Bessel's Correction, http://math.oxford.emory.edu/site/math117/besselCorrection/
- PennState Eberly College of Science, STAT 200 Elementary Statistics - Measures of Spread, https://online.stat.psu.edu/stat200/lesson/2/2.2/2.2.5