Variance Calculator

Quick answer

The variance calculator gives the sample or population variance of a data set (the average squared distance of values from the mean) plus the other variance, both standard deviations, the mean, the sum of squares and a step-by-step table.

Variance (chosen type)
182
Sample variance (s²)
182
Population variance (σ²)
151.666667
Sum of squares
910
Sample standard deviation
13.490738
Population standard deviation
12.315302
Mean
18
Count
6
Sum of squared values Σx²
2,854
Dot plot of the data
Step-by-step calculation
# x x − x̄ (x − x̄)² ──────────────────────────── 1 4 −14 196 2 8 −10 100 3 15 −3 9 4 16 −2 4 5 23 5 25 6 42 24 576 Σ 108 0 910 Mean x̄ = 108 ÷ 6 = 18 Sum of squares SS = 910 Sample variance s² = SS ÷ (n − 1) = 910 ÷ 5 = 182 Population variance σ² = SS ÷ N = 910 ÷ 6 = 151.666667 Sample SD s = √s² = 13.490738 · Population SD σ = √σ² = 12.315302 Standard error SE = s ÷ √n = 13.490738 ÷ 2.44949 = 5.507571

Variance measures how far a set of numbers is spread out from its average. It is the mean of the squared deviations: values far from the mean count a lot, values close to it hardly at all. Variance underlies many statistical methods (analysis of variance (ANOVA), regression, portfolio risk, quality control) because variances of independent quantities simply add, which standard deviations do not.

Two versions exist. For a population, meaning every value you care about, divide the sum of squares by N. For a sample, divide by n − 1 instead; this Bessel’s correction makes the sample variance an unbiased estimate of the population variance. Choose the data set type and the calculator gives that version first, with the other underneath.

Because deviations are squared, variance is in squared units (cm², $²), which makes it hard to picture. Its square root, the standard deviation, brings the spread back to the original units, so both are listed.

How to use the Variance Calculator

  1. Data
  2. Data set type

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

How it works

Find the mean, subtract it from every value, square each difference, add the squares and divide by n − 1 (sample) or N (population). The table shows each step.

Worked example

For 4, 8, 15, 16, 23 and 42 the mean is 18 and the squared deviations 196, 100, 9, 4, 25 and 576 add to 910. The sample variance is 910 ÷ 5 = 182 and the population variance 910 ÷ 6 = 151.67. Their square roots are 13.49 and 12.32.

Variance in common software

Software Sample variance Population variance
Excel / Google Sheets VAR.S VAR.P
R var() var() × (n − 1)/n
Python (NumPy) np.var(x, ddof=1) np.var(x)
TI-84 Sx² σx²

Formula

s² = Σ(x − x̄)² ÷ (n − 1) · σ² = Σ(x − μ)² ÷ N · shortcut: s² = (Σx² − n·x̄²) ÷ (n − 1)

Worked example

Inputs: Data: 4, 8, 15, 16, 23, 42; Data set type: Sample (divide by n − 1).
Results: Variance (chosen type) = 182; Sample variance (s²) = 182; Population variance (σ²) = 151.666667; Sum of squares = 910; Sample standard deviation = 13.490738; Population standard deviation = 12.315302.

Key terms

Variance
The average squared deviation from the mean.
Sample variance (s²)
The sum of squares divided by n − 1, an unbiased estimate of the population variance.
Population variance (σ²)
The sum of squares divided by N for a complete population.

Frequently asked questions

Why is variance in squared units?

Because deviations are squared; standard deviation brings it back to the original units.

Can variance be negative?

No. It is an average of squares, so it is 0 when all values are equal and positive otherwise.

What is the variance of 5, 5, 5, 7, 8, 8, 9, 9?

The mean is 7 and the squared deviations add to 22, so the population variance is 22 ÷ 8 = 2.75 and the sample variance 22 ÷ 7 = 3.14.

What is the variance of 1, 2, 4, 6 as a sample?

The mean is 3.25, the sum of squares 14.75, so s² = 14.75 ÷ 3 = 4.9167.

When do I use sample variance?

Whenever the data are a sample from a larger group and you want to estimate that group's variance, which is the usual case in research.

How is variance related to standard deviation?

Standard deviation is the square root of variance. A variance of 182 means a standard deviation of 13.49.

Why do variances add but standard deviations not?

For independent variables Var(X + Y) = Var(X) + Var(Y). Standard deviations combine as √(σ₁² + σ₂²), never as σ₁ + σ₂.

Sources

  1. NIST/SEMATECH e-Handbook of Statistical Methods
  2. OpenStax: Introductory Statistics 2e
  3. Khan Academy: Statistics and probability

Guides on this topic

Cite this calculator

Speedy Calculator. (2026). Variance Calculator. Speedy Calculator. https://speedycalculator.com/calculators/statistics/variance/