CompoundPage

Variance calculator

For 6, 2, 3 and 1, the variance calculator gives a sample variance of 4.6667 and a population variance of 3.5, from squared deviations that sum to 14.

Separate with commas, spaces or new lines. Pasting a spreadsheet column works.

A sample divides by n-1. If these numbers ARE everything you care about, untick it.

How many standard deviations from the mean a particular value sits.

Sample variance4.6667

Sample standard deviation
2.1602
Working SS is the sum of squared deviations from the mean of 3.
s = sqrt(SS / (n - 1)) = sqrt(14 / 3) = sqrt(4.6667) = 2.1602
Sample variance
4.6667
Count
4
Mean Sum of 12 over 4 values.
3
Median The average of the two middle values.
2.5
Mode
none (no value repeats)
Range
5 (1 to 6)
If this were the whole population Dividing by n instead of n-1 gives 1.8708, which is 13.4% smaller. Use it only when these numbers are every case you care about, not a sample from something larger.
1.8708
Quartiles Interquartile range 3: the middle half of the data. Unlike the standard deviation, it is barely affected by an extreme value.
Q1 1.5, median 2.5, Q3 4.5
Outliers By the 1.5 x IQR rule: anything below -3 or above 9.
none
Z-score of 6 1.39 standard deviations above the mean. If the data were normally distributed, about 91.8% of values would fall below it.
1.389
Standard error of the mean The standard deviation divided by the square root of n: how much the sample mean itself would wobble between samples. Quartering it takes sixteen times the data.
1.0801
Coefficient of variation Standard deviation as a share of the mean. The only one of these figures that compares the spread of two things measured in different units.
72.01%
If the data were normal 95% within -1.3205 to 7.3205, and 99.7% within -3.4807 to 9.4807. That is the empirical rule, and it only holds for roughly bell-shaped data.
68% within 0.8398 to 5.1602
Deviation from the mean
ValueDeviationSquared
1-24
2-11
300
639
Total014
  • The deviations always sum to zero; that is what the mean is. Squaring them before averaging is what stops them canceling, and it is also why the standard deviation is in the same units as the data while the variance is in units squared.
  • Non-numeric entries in the list are ignored rather than read as zero, so a header row pasted in with a column will not drag the mean down.

How the Standard Deviation Calculator works

Variance is the average squared distance from the mean. The formula for variance of a sample is s² = Σ(x - x̄)² ÷ (n - 1), and for a whole population it is σ² = Σ(x - μ)² ÷ N. The two differ only in the divisor.

Worked example, for 6, 2, 3 and 1. The mean is 12 ÷ 4 = 3. The deviations from it are 3, -1, 0 and -2, and their squares are 9, 1, 0 and 4, which add up to 14. As a sample, the variance is 14 ÷ 3 = 4.6667. As a population, it is 14 ÷ 4 = 3.5.

The squaring is needed because the deviations always add up to zero (3 - 1 + 0 - 2 = 0), so their plain average says nothing. Squaring makes every deviation count, and weights the large ones most.

The n - 1 is Bessel's correction. A sample's own mean sits closer to its values than the population's mean does, so the squared deviations come out too small, and dividing by one fewer corrects the bias. It matters most on small samples: on these four values it raises the variance by a third.

Variance is in squared units, dollars squared for data in dollars. The standard deviation is its square root and returns to the original units: √4.6667 = 2.16.

A shortcut gives the same sum of squares without the deviations: Σx² - (Σx)² ÷ n. Here Σx² = 36 + 4 + 9 + 1 = 50 and (Σx)² ÷ n = 144 ÷ 4 = 36, so the sum of squares is 50 - 36 = 14.

Standard Deviation Calculator FAQ

What is the variance of 1, 2, 3, 4, 5?

2.5 as a sample and 2 as a population. The mean is 3, the squared deviations are 4, 1, 0, 1 and 4, which sum to 10, and 10 ÷ 4 = 2.5 while 10 ÷ 5 = 2.

Can variance be negative?

No. It is built from squares, so the smallest it can be is 0, which happens only when every value is the same.

Which Excel function gives the variance?

VAR.S for a sample and VAR.P for a population. The older VAR is the sample version.

More from the Standard Deviation Calculator

Related calculators

Embed this calculator
<div id="compoundpage-standard-deviation-calculator"></div>
<script src="https://compoundpage.com/embed/standard-deviation-calculator.js" async></script>

The same calculation as JSON