Skip to main content

Variance Calculator

Variance measures how far a set of numbers sits from its own average, once the above-and-below deviations are squared so they cannot cancel out. The result is in squared units, which is why the square root — the standard deviation — is nearly always reported beside it.

One value per entry, or any mix of spaces, commas and new lines.

Use the sample divisor when these values were drawn from a larger population.

Calculated Result
4.57142857

Sample variance

Sample variance

4.57142857

Standard deviation

2.13808994

Mean

5

Count

8

Divisor

n − 1 = 7

Mean absolute deviation

1.5

Smallest

2

Largest

9

Range

7

Median

4.5

Coefficient of variation

42.7618%

moderately spread out around 5 — Standard deviation 2.13809.

Calculation Breakdown

  1. Find the meanThe 8 values add to 40, so the mean is 40 ÷ 8 = 5.xˉ=∑xin\bar{x} = \frac{\sum x_i}{n}
  2. Square each deviation and add them upEvery value is measured against the mean, squared so that above and below cancel out in sign but not in size, and the results are added to give the sum of squares.∑i=1n(xi−xˉ)2\sum_{i=1}^{n} (x_i - \bar{x})^{2}
  3. Divide by the divisorDividing by n − 1 = 7 rather than n compensates for the mean already being fitted to the data, which is what makes the sample variance an unbiased estimate of the population variance.s2=∑(xi−xˉ)2n−1s^{2} = \frac{\sum (x_i - \bar{x})^{2}}{n-1}
  4. Take the square root for a readable scaleThe variance is 4.571429 in squared units. Its square root, 2.13809, is back in the original units, which is why it is the form almost always reported.s=s2s = \sqrt{s^{2}}

Deviation of each value from the mean

Interactive visualization based on your current inputs

Deviation
-3.0-1.30.52.34.0#1: 2#2: 4#3: 4#4: 4#5: 5#6: 5#7: 7#8: 9ValueValue − mean

What Is the Variance Calculator?

The variance of a set of numbers is the average of the squared distances from their mean. Squaring is what makes it work: without it, a value one above the mean and a value one below it would cancel, and every symmetric set would score zero spread no matter how far apart its extremes are.

The price of that trick is the units. Squaring a measurement in metres gives square metres, so the variance cannot be compared with the data or added to it. Its square root, the standard deviation, is back in the original units and is the form usually reported.

How Does the Variance Calculator Work?

Find the mean of the list, then measure every value against it. A value above the mean gives a positive deviation, one below gives a negative one.

Square each deviation, which makes every contribution positive, and add them up. This total, the sum of squares, is what the mean has already been subtracted from.

Divide by n for a population, or by n − 1 for a sample. The mean was calculated from these same values, so it already fitted itself to them; the n − 1 divisor corrects for the one degree of freedom that consumed.

Take the square root to return to the original units. The result is the standard deviation, and roughly 95% of a normal distribution falls within two of them of the mean.

Variance Calculator Formula & Variables

The core mathematical equation utilized by this calculator is expressed as:

s2=∑i=1n(xi−xˉ)2n−1σ2=∑i=1n(xi−xˉ)2ns=s2s^{2} = \frac{\sum_{i=1}^{n} (x_i - \bar{x})^{2}}{n-1} \qquad \sigma^{2} = \frac{\sum_{i=1}^{n} (x_i - \bar{x})^{2}}{n} \qquad s = \sqrt{s^{2}}

Variable Definitions

SymbolVariable Meaning & Units
xᵢthe i-th value in the list
x̄the mean of the values
nthe number of values
s²sample variance, in squared units
σ²population variance, in squared units

Every value is compared with the mean, the differences are squared so that values above and below the average both add to the total, and the sum is divided by n − 1 or n. Squaring removes the units, so the variance is always in squared units; taking the square root brings it back and gives the standard deviation.

How to Use the Variance Calculator

  1. Paste the values in. Spaces, commas and new lines all separate entries, and the order does not matter.
  2. Choose sample or population. If these numbers are everything you care about, use population; if they are a sample of a wider population, use sample.
  3. Read the variance together with the standard deviation. The variance is the precise quantity, the standard deviation is the one you can picture next to the data.
  4. Check the deviation table when a result looks surprising. It lists every value, its deviation and its square, and those squares must add up to the sum the divisor is applied to.

Step-by-Step Example Calculation

Eight measurements around a mean of 5

Input Values:

values:2, 4, 4, 4, 5, 5, 7, 9
type:sample
Worked Steps: The mean is 5 and the squared deviations add to 32, so the population variance is 32 ÷ 8 = 4 and the sample variance is 32 ÷ 7 ≈ 4.5714, giving standard deviations of 2 and 2.1381.

Understanding Your Result

A variance of 4 and a standard deviation of 2 describe exactly the same spread. Report the standard deviation unless someone specifically asks for the variance, because it stays in the original units.

The coefficient of variation puts the spread in percentage terms, so a spread of 2 around a mean of 5 becomes 40%. This is the only fair way to compare spread across quantities measured in different units.

Zero variance means every value is identical. It is the one case where the standard deviation is unambiguously zero rather than a rounding artefact.

A large variance relative to the mean usually means outliers or a mixture of groups rather than natural variation, and the mean is a poor summary of such a list.

Factors That Affect the Result

  • The divisor. Switching from n to n − 1 always lowers the result, and the difference matters most for small lists where n − 1 is much smaller than n.
  • Outliers. Squaring means one value ten standard deviations out contributes a hundred times as much as one at a single standard deviation.
  • Sample size. The estimate of the population variance settles down roughly as 1/√n, so small lists give unstable results.
  • Adding a constant. Shifting every value by the same amount changes the mean and the median but leaves the variance untouched.
  • Scaling. Multiplying every value by c multiplies the variance by c², so a variance is not comparable across different units without converting.

When Should You Use This Calculator?

  • Summarising the spread of a measurement before comparing it with a mean or a tolerance.
  • Checking whether a measurement process is stable, by watching the variance of repeated readings of the same thing.
  • As the first step of a t-test or an analysis of variance, both of which are built on comparing variances.
  • When a standard deviation is needed but only as an intermediate value, such as in a z-score or a confidence interval.
  • Diagnosing data quality: a variance far larger than expected usually points to a unit mix-up, a stray decimal point or two populations mixed together.

Assumptions & Limitations

  • The variance depends entirely on the mean, so one extreme value moves both and can make the spread look smaller than the data really is.
  • It says nothing about symmetry or normality. A symmetric and a heavily skewed list can share a variance exactly.
  • Values from different units or scales cannot be combined; a variance of weights is meaningless alongside a variance of times.
  • The sample divisor assumes the values are independent draws. Repeats of the same measurement are correlated and understate the true spread.
  • The number is in squared units, so it is only directly comparable with another variance measured in the same units.

Frequently Asked Questions

Calculation Accuracy & Reference Note

The mean squared deviations are accumulated in double precision, which carries about 15 significant digits, so results are exact to far more digits than are displayed. Very large values are rejected rather than returned as Infinity.

Standard Reference: Cauchy, A.-L. (1841), Sur les fonctions qui ne s'intègrent qu'entre des limites données, et sur leur théorème général. Comptes Rendus de l'Académie des Sciences 11, 465–470.