Skip to content
Statistics CalculatorStatistics Calculator

Variance Calculator

Calculate the sample or population variance of your data, with the standard deviation, mean, sum of squares, and a full step-by-step solution.

Tested against reference valuesLast reviewed August 2026
Variance (s²)7.0000
Std. deviation
2.6458
Mean (x̄)
10.0000
Count (n)
7
Sum of squares
42.0000

Using the sample formula (divide by 6).

Distribution

n = 7
0121222 10.006.0014.00
Frequency ±1 SD

How to use this calculator

  1. Enter your numbers, separated by commas, spaces, or new lines.
  2. Choose whether the data is a sample (divide by n − 1) or a whole population (divide by n).
  3. Read the variance and standard deviation, and open the step-by-step solution for the full working.

What is variance?

Variance measures how far a set of numbers is spread out from their mean. It is the average of the squared deviations from the mean. Because the deviations are squared, variance is expressed in squared units — taking its square root gives the standard deviation, which is back in the original units.

Variance formula

The population variance (σ²) divides the sum of squared deviations by N:

σ2=i=1N(xiμ)2N\sigma^2=\dfrac{\sum_{i=1}^{N}(x_i-\mu)^2}{N}

The sample variance (s²) divides by n − 1 (Bessel’s correction):

s2=i=1n(xixˉ)2n1s^2=\dfrac{\sum_{i=1}^{n}(x_i-\bar{x})^2}{n-1}

Sample vs. population variance

Population (σ²)Sample (s²)
Divides byNn − 1
Use whenYou have every valueYou have a subset
Excel functionVAR.PVAR.S

Variance in Excel

Use =VAR.S(range) for the sample variance and =VAR.P(range) for the population variance. For example, =VAR.S(A1:A10) gives the sample variance of the values in cells A1 to A10.

Frequently asked questions

What is the difference between variance and standard deviation?

Variance is the average of the squared deviations from the mean, so it is in squared units. The standard deviation is the square root of the variance, expressed in the same units as the original data.

When do I divide by n − 1 instead of n?

Divide by n − 1 when the data is a sample from a larger population; this correction makes the sample variance an unbiased estimate. Divide by N only when your data includes the entire population.

Can variance be negative?

No. Variance is an average of squared values, so it is always zero or positive. It equals zero only when every value in the data set is identical.

How do I calculate variance in Excel?

Use =VAR.S(range) for the sample variance or =VAR.P(range) for the population variance.

Related calculators

Was this calculator helpful?