Variance Calculator - Sample & Population Variance

Calculate sample or population variance from any data set. The Variance Calculator shows the sum of squares, every squared deviation and both formulas.

01 calculator

0 values read

Results update as you type. No submit button.

Result

    Show the working

      The Variance Calculator measures how far values in a data set sit from their mean in squared units, returning either the sample variance or the population variance depending on what the data represents. Paste values separated by commas, spaces or line breaks, and the calculator returns the variance alongside the sum of squares, the mean and a step table of every squared deviation.

      Variance is the quantity under the square root in a standard deviation. Most coursework asks for one or the other, and showing both the squared-unit result and the steps that produced it is what makes a hand check possible.

      Calculate variance from a data set

      Concept diagram: Inputs leads to variance from a data set leads to ResultInputsvariance from a datasetResult
      Calculate variance from a data set.

      Variance answers a single question: how widely do these values scatter around their mean, measured in squared units? A small variance means the points cluster tightly. A large one means they scatter. Two sets can share the same mean and still describe completely different situations once their variances differ.

      Paste values into the data field. Commas, spaces, tabs and line breaks all work, so a column copied from a spreadsheet needs no reformatting. The calculator reports how many values it read beneath the field. Check that count against what you pasted before trusting the result, because a stray character is the usual cause of a wrong answer.

      Choose sample or population before reading the number. That choice changes the denominator and, on small sets, the answer itself.

      Apply the variance formula

      Formula s = √(Σ(x − x̄)² / (n − 1)), with variables: x is value, x̄ is mean, s is deviations = √(Σ(x − x̄)² / (n − 1))xvaluemeansdeviation
      Apply the variance formula.

      Both formulas share the first three steps and diverge only when the sum of squares is divided. Find the mean, subtract it from each value, square those deviations, then divide by N for a population or by n minus 1 for a sample.

      The quotient is the variance in squared units; the Standard Deviation Calculator takes the square root as one further step.

      Population:   σ² = Σ(x − x̄)² / N
      Sample:       s² = Σ(x − x̄)² / (n − 1)

      Working through it:

      1. Find the mean. Add every value and divide by the count. 2. Find each deviation. Subtract the mean from each value. Some are negative. 3. Square each deviation. Negatives disappear. The column total is the sum of squares (SS). 4. Divide. By N for a population, by n − 1 for a sample. That quotient is the variance.

      The Standard Deviation Calculator takes one further step: the square root. Variance stops at step 4, which is why its units are squared. For the sample-versus-population choice and Bessel's correction, see that page; this page owns the sum-of-squares mechanics.

      Read the sum of squares

      Concept diagram: Inputs leads to sum of squares leads to ResultInputssum of squaresResult
      Read the sum of squares.

      The sum of squares is the total of every squared deviation from the mean and the numerator of both variance formulas. Raw deviations before squaring always sum to zero when the mean comes from the same values, which is a quick arithmetic check. Sum of squares itself is never negative and equals zero only when every value equals the mean.

      SS = Σ(x − x̄)²

      Two properties matter in practice. First, the raw deviations (before squaring) always sum to zero when the mean is calculated from the same values. That column total is a quick arithmetic check. Second, SS itself is never negative, because each term is a square. SS equals zero only when every value equals the mean.

      On large-magnitude data, prefer the two-pass method shown here (mean first, then deviations) over the one-pass shortcut Σx² − (Σx)²/n. The shortcut cancels catastrophically when values are large and nearly equal, which is a known numerical failure mode rather than a theoretical curiosity.

      Understand why deviations are squared

      Concept diagram: Inputs leads to why deviations are squared leads to ResultInputswhy deviations aresquaredResult
      Understand why deviations are squared.

      Without squaring, positive and negative deviations cancel. A set that sits three units above the mean on half its points and three below on the other half would report a total deviation of zero, which pretends there is no spread at all.

      Absolute values would also stop the cancellation, and mean absolute deviation is a real alternative measure. Squaring is preferred in classical statistics for two practical reasons. It penalises large deviations more heavily than small ones: a point three units from the mean contributes nine times as much as a point one unit away. And squared functions are differentiable, which makes variance the foundation for least-squares regression and many inferential methods.

      That penalty is also why variance (and standard deviation) react strongly to outliers. One extreme observation can dominate SS. A box plot or a look at the raw values should sit beside any variance you plan to report.

      Calculate variance for 4, 6, 6, 6, 7, 7, 9, 11

      Concept diagram: Inputs leads to variance for 4, 6, 6, 6, 7, 7, 9, 11 leads to ResultInputsvariance for 4, 6, 6,6, 7, 7, 9, 11Result
      Calculate variance for 4, 6, 6, 6, 7, 7, 9, 11.

      This eight-value set gives a population variance of exactly 4 and a sample variance of 4.571. Every step below can be checked by hand. (A different data set from the Standard Deviation Calculator worked example, so the two pages do not duplicate the same walkthrough.)

      1. Find the mean. 4 + 6 + 6 + 6 + 7 + 7 + 9 + 11 = 56 56 ÷ 8 = 7

      2. Find each deviation and square it.

      xx − x̄(x − x̄)²
      4−39
      6−11
      6−11
      6−11
      700
      700
      924
      11416
      Σ = 0Σ = 32

      3. Divide.

      Population: 32 ÷ 8 = 4 Sample: 32 ÷ 7 = 4.571

      The deviations sum to zero, as they must. The value 11 alone contributes 16 of the 32 total, half the sum of squares from one observation out of eight. That is the squaring penalty in a single row.

      Understand the units of variance

      Concept diagram: Inputs leads to units of variance leads to ResultInputsunits of varianceResult
      Understand the units of variance.

      Variance is expressed in squared units of the original data. If the measurements are marks out of 100, variance is in squared marks. If they are centimetres, variance is in square centimetres. Those units cannot be compared directly with a single observation, which is why practitioners usually report the standard deviation instead.

      Taking the square root undoes the unit problem:

      σ = √σ²    and    s = √s²

      For the worked example, √4 = 2 and √4.571 ≈ 2.138. Same spread, different packaging. Use variance when a formula asks for it (ANOVA, many regression outputs, some finance models). Use standard deviation when you need a figure a reader can place next to the raw measurements.

      Variance in later formulas

      Formula s = √(Σ(x − x̄)² / (n − 1)), with variables: x is value, x̄ is mean, s is deviations = √(Σ(x − x̄)² / (n − 1))xvaluemeansdeviation
      Variance in later formulas.

      ANOVA, many regression outputs and some risk models consume variance directly rather than standard deviation. When a formula writes sigma squared, leave the result in squared units. When a report needs a figure a reader can compare with raw measurements, take the square root and state that you are reporting standard deviation.

      Linking the two pages deliberately avoids duplicating Bessel's correction here. Sample versus population still matters for variance; the interpretation section on the Standard Deviation Calculator remains the deeper treatment of why n minus 1 appears.

      Frequently asked questions

      What is variance?

      Variance is the average of the squared deviations from the mean. Population variance divides the sum of squares by N; sample variance divides by n − 1. The result is in squared units of the original data, so a variance of 4 on a set measured in centimetres means 4 square centimetres of spread, not 4 centimetres.

      Should I use sample or population variance?

      Use population variance when the data covers every member of the group you are describing, and divide by N. Use sample variance when the data is a subset representing a larger group, and divide by n − 1. Sample is the usual case in practice. Textbook questions almost always name which form they want.

      How is variance different from standard deviation?

      Variance is the average squared deviation; standard deviation is its square root. Both describe the same spread. Standard deviation returns to the original units and is the figure most people report. Variance stays in squared units and appears inside other formulas.

      Why are the deviations squared?

      Without squaring, positive and negative deviations cancel and a spread-out set can look like it has no spread. Squaring removes the sign, weights large deviations more heavily, and produces a quantity that works cleanly in later formulas such as regression and ANOVA.

      Can variance be negative?

      No. Variance is an average of squares, so it cannot fall below zero. It equals zero only when every value in the set is identical. A negative result means an arithmetic error, usually a sign mistake before squaring.

      What is the sum of squares?

      The sum of squares (SS) is Σ(x − x̄)², the total of every squared deviation from the mean. It is the numerator of both variance formulas. On the worked example above, SS = 32.

      Why does sample variance divide by n − 1?

      Because the sample mean is estimated from the same values, every deviation is systematically a little too small. Dividing by n would understate the population variance. Dividing by n − 1 (Bessel's correction) compensates. The Standard Deviation Calculator covers that correction in more detail.

      How do I calculate variance in Excel?

      Use =VAR.S(range) for a sample and =VAR.P(range) for a population. The older =VAR() behaves like VAR.S. Confirm which form your assignment expects, because the two disagree on small data sets.

      Does a larger variance always mean a worse data set?

      Not by itself. Variance carries squared units and must be read against the scale of the data. A variance of 4 on values near 7 is substantial; the same variance on values near 700 is trivial. Compare against the mean, or switch to the coefficient of variation on the Standard Deviation Calculator, before judging "good" or "bad."

      Summary

      The Variance Calculator returns sample or population variance from any pasted data set, with the sum of squares, the mean and a full deviation table. Both formulas square each deviation from the mean and divide; they differ only in dividing by n − 1 for a sample or N for a population.

      Variance lives in squared units, which is why the square root (standard deviation) is usually reported for interpretation. Use this page for the sum-of-squares working; use the Standard Deviation Calculator when the question asks for spread in the original units or for Bessel's correction in depth.