🇺🇸 USC
Math & Conversion
📊

Variance Calculator

Sample & population variance with full step-by-step working

Last updated September 6, 2026

Method: Exact textbook definitions. The mean is the sum divided by the count, the sum of squares is Σ(x − x̄)², population variance divides that by N and sample variance divides it by n − 1 (Bessel's correction). No rounding is applied before the final display.

Included: Sample and population variance, both standard deviations, mean, median, count, sum, Σx², minimum, maximum, range, mean absolute deviation, coefficient of variation, a per-value deviations table and a raw-score shortcut check.

Not included: Frequency-weighted (grouped) entry, weighted variance, covariance between two variables, confidence intervals and hypothesis tests. Non-numeric entries are ignored automatically.

📊 Enter your data set

Try:

Pick Sample when your numbers are a subset drawn from a bigger group, and Population when they cover every member of the group.

📊 Sample variance

7.5
Standard deviation (s) = 2.7386
Mean (x̄)
14
Count (N)
5
Σ(x − x̄)²
30
Divisor used
4

⚖️ Sample vs population

MeasureSamplePopulation
Divisorn − 1 = 4N = 5
Variance7.56
Standard deviation2.73862.4495
Symbols² and sσ² and σ

Bessel's correction makes the sample variance exactly N ÷ (N − 1) = 1.25 times the population variance, so it is 25% larger for this data set.

🧮 All statistics

Count (N)
5
Sum (Σx)
70
Mean (x̄)
14
Median
14
Sample variance (s²)
7.5
Population variance (σ²)
6
Sample SD (s)
2.7386
Population SD (σ)
2.4495
Σ(x − x̄)²
30
Σx²
1,010
Minimum
11
Maximum
18
Range
7
Mean absolute deviation
2
Coeff. of variation
19.56%
Variance units
squared

📋 Step-by-step

  1. 1. Find the mean. Add all 5 values to get Σx = 70, then divide by 5: x̄ = 70 ÷ 5 = 14.
  2. 2. Subtract the mean from every value. These differences are the deviations (x − x̄). They always add up to zero, which is exactly why they have to be squared before you average them.
  3. 3. Square each deviation and add. Σ(x − x̄)² = 30. This total is called the sum of squares.
  4. 4. Divide by the right number. Sample variance divides by n − 1 = 4: s² = 30 ÷ 4 = 7.5.
  5. 5. Square-root it for the standard deviation. s = √7.5 = 2.7386. The variance stays in squared units; the standard deviation is back in the units of your data.

🔢 Deviations table

Value (x)x − x̄(x − x̄)²
12-24144
1511225
11-39121
18416324
1400196
Σ0301,010

Shortcut (raw-score) check

The sum of squares can also be found without listing deviations at all, using only Σx and Σx²:

Σ(x − x̄)² = Σx² − (Σx)² ÷ N

1,010 − (70)² ÷ 5 = 1,010 980 = 30

Same sum of squares as the deviations table above, which is a quick way to check your hand calculation.

Everything is computed in your browser, nothing is uploaded. Sample variance divides the sum of squares by n − 1 (Bessel's correction); population variance divides by N. Non-numeric entries are ignored automatically.

Variance calculator: the complete guide

A variance calculator measures how far a set of numbers spreads out around its own average, by averaging the squared distance of each value from the mean. For the data set 12, 15, 11, 18, 14 the mean is 14, the sum of squared deviations is 30, the population variance is 6 and the sample variance is 7.5. This page returns both instantly, with every intermediate step shown.

Three neighboring tools answer closely related questions. The Standard Deviation Calculator gives the square root of the same figure when you want the spread back in the original units, the Average Calculator handles the mean, median and mode on their own, and the Z-Score Calculator converts one individual value into standard deviations above or below the mean. Use this page when the variance itself is what your homework, lab report or quality check asks for.

What variance actually measures

Every data set has a center and a spread. The mean describes the center. Variance describes the spread, and it does so in a very specific way: it asks how far each value sits from the mean, squares that distance so that values below the mean count just as much as values above it, and then averages those squares.

Squaring is not an arbitrary choice. If you simply averaged the raw deviations they would always cancel to exactly zero, because the mean is by definition the balance point of the data. Squaring removes the sign, and it also gives extra weight to values that sit far out, which matches the intuition that one wildly different observation makes a data set more variable than several slightly different ones.

The result is a single non-negative number. Zero means every value is identical. A small variance means the values huddle near the mean. A large variance means they are scattered. Because the deviations were squared, the variance is expressed in squared units, which is the one awkward feature of the measure and the reason the standard deviation exists.

The variance formula

Both versions share the same numerator, the sum of squared deviations from the mean. Only the divisor changes:

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

Here x is each individual value, μ is the population mean, is the sample mean, N is the population size and n is the sample size. There is also an algebraically identical shortcut that avoids listing the deviations one by one:

Σ(x − x̄)² = Σx² − (Σx)² ÷ N

The shortcut needs only two running totals, the sum of the values and the sum of their squares, which is why it is the version built into hand calculators and spreadsheets. The calculator above shows it as an independent check on the deviation table.

Worked example: 12, 15, 11, 18, 14

Five measurements, worked all the way through. Step 1, the mean. The values add to 12 + 15 + 11 + 18 + 14 = 70, and 70 ÷ 5 = 14. Step 2, the deviations. Subtract 14 from each value. Step 3, square and add. The squared deviations total 30:

Value (x) x − x̄ (x − x̄)²
12−24144
1511225
11−39121
18416324
1400196
Σ0301,010

Step 4, divide. As a population, 30 ÷ 5 = 6. As a sample, 30 ÷ 4 = 7.5. Step 5, square root for the standard deviation. √6 ≈ 2.4495 and √7.5 ≈ 2.7386. Notice two details in the table: the deviations column sums to exactly zero, which is a good arithmetic check, and the shortcut formula reproduces the same numerator, since 1,010 − 70² ÷ 5 = 1,010 − 980 = 30.

Second worked example: six test scores

Take six exam scores: 46, 69, 32, 60, 52, 41. They add to 300, so the mean is 300 ÷ 6 = 50. The deviations are −4, 19, −18, 10, 2 and −9, and their squares are 16, 361, 324, 100, 4 and 81, which add to 886. Treating the six students as the whole class (a population), the variance is 886 ÷ 6 ≈ 147.6667 and the standard deviation is about 12.1518 points. Treating them as a sample of a much larger cohort, the variance is 886 ÷ 5 = 177.2 and the standard deviation is about 13.3116 points.

The shortcut confirms the numerator: the squares of the scores add to 15,886, and (300)² ÷ 6 = 90,000 ÷ 6 = 15,000, so the sum of squares is 15,886 − 15,000 = 886. Note how large the variance looks next to the standard deviation. A spread of roughly 12 points on a 100-point exam is perfectly ordinary, but stated as a variance of 147.67 squared points it sounds dramatic. That mismatch is presentation, not mathematics.

Sample and population variance side by side

The table below runs five data sets through both formulas, computed with the definitions above. The two figures always move together, and the sample value is always the larger of the two unless the spread is exactly zero.

Data set Mean Σ(x−x̄)² σ² s
12, 15, 11, 18, 1414306.00007.50002.7386
2, 4, 4, 4, 5, 5, 7, 95324.00004.57142.1381
10, 12, 23, 23, 16, 23, 21, 161819224.000027.42865.2372
46, 69, 32, 60, 52, 4150886147.6667177.200013.3116
7, 7, 7, 7, 7700.00000.00000.0000

Bessel's correction and why the gap shrinks

Dividing by n − 1 rather than n multiplies the answer by exactly N ÷ (N − 1). That factor is large for tiny data sets and almost invisible for big ones, which is why the sample-versus-population choice matters enormously in a classroom exercise and hardly at all in a data set of a few hundred rows.

Count N Factor N ÷ (N−1) Variance is larger by SD is larger by
22.0000100.00%41.42%
31.500050.00%22.47%
51.250025.00%11.80%
101.111111.11%5.41%
201.05265.26%2.60%
301.03453.45%1.71%
501.02042.04%1.02%
1001.01011.01%0.50%

With two observations the sample variance is double the population variance. With a hundred it is one percent larger, a difference that rarely changes any decision. The correction still belongs in the formula, because being unbiased on average is what makes the estimate trustworthy when many small samples are combined.

How to use this variance calculator

  1. Paste your numbers. Commas, spaces, semicolons and line breaks all work, so a column copied straight out of a spreadsheet is accepted as it is. Decimals and negative values are fine.
  2. Pick sample or population. Choose Sample when your figures are a subset of a larger group, and Population when they cover the entire group. If you are unsure, read the section below on which one to use.
  3. Set the decimal places. Two decimals suit a report, six help when you are checking a hand calculation digit by digit. Rounding happens only on display, never inside the arithmetic.
  4. Read the headline figure. The gradient card shows the variance for the mode you selected, with the matching standard deviation, the mean, the count, the sum of squares and the divisor actually used.
  5. Check the working. The step-by-step block, the deviations table and the raw-score shortcut all recompute the same result along different routes, so you can compare each line with your own paperwork.

Anything that is not a number is skipped and reported in an amber notice, so a stray header row or a unit label pasted along with the data will not silently corrupt the result.

Which one do you need, s² or σ²?

The question is not about the size of the data set, it is about what the data represents. Ask yourself whether the numbers in front of you are everything you care about, or a slice of something larger.

  • Population (σ²) when the data is complete: the final grades of every student in one class when the class itself is the subject, the weights of all twelve parts in a single batch, the monthly totals for all twelve months of a finished year.
  • Sample (s²) when the data is a subset used to say something about a bigger group: forty survey responses standing in for a city, ten measured parts standing in for a production run, one week of readings standing in for a whole season.
  • When in doubt, use the sample formula. Most real data is a sample, most software defaults to s², and the sample figure is the more conservative of the two because it is slightly larger.

Who this calculator is for

  • Students working through a statistics assignment who need the answer and the intermediate steps that earn the marks.
  • Teachers building worksheets and answer keys, who want a fast second opinion on a set of hand-computed values.
  • Lab and quality staff checking whether a run of measurements is tighter or looser than the previous run.
  • Analysts and researchers who have a short column of numbers and do not want to open a spreadsheet or a statistics package for it.
  • Anyone comparing two data sets that share the same units and want a single number for which one is steadier.

Key terms explained

  • Mean (x̄ or μ): the arithmetic average, the sum divided by the count. Every deviation is measured from it.
  • Deviation (x − x̄): how far one value sits from the mean, positive above and negative below. The deviations always sum to zero.
  • Sum of squares: the total of the squared deviations, written Σ(x − x̄)². It is the numerator both formulas share.
  • Degrees of freedom: the n − 1 in the sample denominator. Once the mean is fixed, only n − 1 of the deviations can vary freely, because the last one is forced by the requirement that they sum to zero.
  • Bessel's correction: the name for using n − 1 instead of n so that the sample variance is an unbiased estimate of the population variance.
  • Coefficient of variation: the standard deviation divided by the mean, shown as a percentage. It compares the relative spread of data sets with different units or very different averages.
  • Mean absolute deviation: the average of the unsigned deviations. It is easier to explain than variance but has worse mathematical behavior, which is why variance dominates statistics.

What changes the result the most

Two rules make variance predictable. Shifting does nothing: add the same constant to every value and the spread is untouched, so 12, 15, 11, 18, 14 and 112, 115, 111, 118, 114 both have a sample variance of 7.5. Scaling squares: multiply every value by k and the variance is multiplied by k². Doubling the data set raises the sample variance from 7.5 to 30, tripling it raises it to 67.5, and multiplying by ten raises it to 750, while the standard deviation only doubles, triples and multiplies by ten.

The third and largest influence is a single distant value. Because deviations are squared before they are averaged, one outlier can dominate the entire sum of squares:

Data set (last value changed) Mean Sample variance Sample SD
12, 15, 11, 18, 1414.007.50002.7386
12, 15, 11, 18, 2416.0027.50005.2440
12, 15, 11, 18, 4019.20142.700011.9457
12, 15, 11, 18, 7025.20634.700025.1933

Moving one value from 14 to 70 leaves four numbers untouched yet multiplies the variance by more than eighty. Before you report a variance, look at the deviations table and check that the biggest contributor is a real observation rather than a typing slip or a misplaced decimal point.

Variance or standard deviation: which to report

They carry identical information, since each is a simple function of the other, but they are used in different places. Report the standard deviation when a human has to interpret the number, because it shares the units of the data: a class average of 50 points with a standard deviation of 13 points is immediately meaningful. Work with the variance when the mathematics demands it, because variances of independent quantities add together while standard deviations do not. That additivity is what makes variance the building block of analysis of variance, regression, portfolio mathematics and error propagation.

A practical rule: compute the variance, then quote the standard deviation. This calculator gives you both at once, along with the coefficient of variation for cases where you need to compare spreads measured on different scales.

Tips for getting a trustworthy number

  • Check that the deviations sum to zero. If they do not, the mean was computed or copied incorrectly, and everything downstream is wrong.
  • Do not round the mean before squaring. Rounding 14.333 to 14.3 in a five-value data set can move the variance by a full percent. Keep full precision until the final display.
  • Verify with the shortcut formula. Computing the sum of squares twice, once through the deviations and once through Σx² − (Σx)² ÷ N, catches most arithmetic slips.
  • Repeat values must be entered every time. A value that occurs four times counts four times, so 4, 4, 4, 4 is not the same input as a single 4.
  • Watch for mixed units. Three lengths in inches and two in feet produce a variance that means nothing. Convert first with the Unit Converter.
  • Say which formula you used. A variance reported without stating sample or population is ambiguous, and on small data sets the two answers differ noticeably.

Limitations and assumptions

  • It expects a raw list of values. Grouped or frequency tables must be expanded first, repeating each value as many times as its frequency.
  • Every value is weighted equally. There is no weighted variance, so unequal sample weights are not supported.
  • It describes one variable at a time. Covariance and correlation between two variables are a different calculation.
  • Variance is a descriptive figure. It does not tell you whether a difference between two data sets is statistically significant, which needs a formal test.
  • It is sensitive to outliers by design. For data with extreme values, robust measures such as the interquartile range often describe the spread better.
  • Ordinary floating-point arithmetic is used, so extremely large values combined with extremely small differences can lose a little precision in the last digits.

How it compares to related calculators

This page answers the question "how spread out is this data, in squared units?" If your question is slightly different, a sister tool fits better:

Sources

Variance is a mathematical definition rather than a regulated figure, so no agency publishes a value to look up. Every number on this page follows directly from the definitions above, and each table entry was computed from those formulas.

⚠️ Common mistakes & edge cases

Dividing by N when the data is a sample

The most frequent error, and the most costly on small data sets. With five values, dividing by 5 instead of 4 makes the variance 20% too small. Decide first whether the numbers cover the whole group or only part of it, then pick the matching mode.

Forgetting to square the deviations

Averaging the raw deviations gives exactly zero for every data set, because positives and negatives cancel. If your working produces a variance of zero on data that is clearly spread out, a squaring step was skipped.

Reporting variance as if it shared the data's units

A variance of 147.67 on exam scores is not "147.67 points". It is 147.67 points squared, and the number people can interpret is its square root, about 12.15 points. Quote the standard deviation whenever a reader has to make sense of the figure.

Rounding the mean before squaring

Deviations are squared, so a small rounding error in the mean is amplified. Carry the mean at full precision through the whole calculation and round only the final answer.

Entering a frequency table as a plain list

If a value appears seven times in your data, it has to appear seven times in the input. Typing the distinct values once and the counts in a second column gives a variance for the wrong data set entirely.

Comparing variances measured in different units

A variance of 4 in inches and a variance of 4 in centimeters describe very different spreads. Convert everything to one unit before comparing, or compare the coefficient of variation, which is unitless.

Note: Variance describes the data you entered. It is not by itself evidence that two data sets differ, which requires a statistical test and a stated significance level.

❓ Frequently asked questions

What is variance?

Variance is the average of the squared distances between each value in a data set and the mean of that data set. It is a single number that says how spread out the data is: a variance of zero means every value is identical, and the larger the variance, the more scattered the values are around their average. Because the distances are squared, variance is always zero or positive and is expressed in squared units.

What is the difference between sample variance and population variance?

Population variance (sigma squared) divides the sum of squared deviations by N and is correct when your numbers cover every member of the group you care about. Sample variance (s squared) divides by n − 1 and is correct when your numbers are only a subset drawn from a larger group. Dividing by n − 1 makes the sample figure slightly larger, which corrects a systematic downward bias. For the data set 12, 15, 11, 18, 14 the population variance is 6 and the sample variance is 7.5.

Why does the sample variance divide by n minus 1?

Deviations are measured from the sample mean, and the sample mean sits closer to the sample values than the unknown true population mean does. That makes the sum of squared deviations a little too small, so dividing by n would systematically underestimate the real spread. Dividing by n − 1 instead, known as Bessel's correction, cancels that bias exactly and produces an unbiased estimate of the population variance.

How do I calculate variance step by step?

Add the values and divide by the count to get the mean. Subtract the mean from each value to get its deviation. Square every deviation and add the squares together, which gives the sum of squares. Divide the sum of squares by N for a population or by n − 1 for a sample. That quotient is the variance. Taking its square root gives the standard deviation.

What is the variance formula?

Population variance is sigma squared = sum of (x − mu) squared, divided by N. Sample variance is s squared = sum of (x − x-bar) squared, divided by (n − 1). Both use the same numerator, the sum of squared deviations from the mean; only the divisor differs. An algebraically identical shortcut writes the numerator as the sum of x squared minus the square of the sum of x, divided by N.

Can variance be negative?

No. Every term in the numerator is a squared number, so the sum of squares is never negative, and the divisor (N or n − 1) is always positive. Variance is therefore zero or positive. If a calculation gives you a negative variance, there is an arithmetic error, most often a squared term that was entered without its square or a sum of squares computed with the shortcut formula in the wrong order.

What does a variance of zero mean?

A variance of zero means there is no spread at all: every value in the data set equals the mean, so every deviation is zero. For example the set 7, 7, 7, 7, 7 has a mean of 7, a sum of squares of 0, and both a population and a sample variance of 0. As soon as one value differs from the rest, the variance becomes positive.

What units is variance measured in?

Variance is measured in the square of the original units. If your data is in inches, the variance is in square inches; if the data is in dollars, the variance is in dollars squared. Squared units have no natural interpretation, which is why the standard deviation, the square root of the variance, is usually the number people quote when they describe spread in plain language.

Is variance the same as standard deviation?

They describe the same spread but on different scales. Standard deviation is the square root of variance, and variance is the square of the standard deviation. Variance is the natural quantity for the mathematics because variances of independent quantities add together, while the standard deviation is the natural quantity for reporting because it shares the units of the data. For 12, 15, 11, 18, 14 the sample variance is 7.5 and the sample standard deviation is about 2.7386.

How many numbers do I need to calculate variance?

Population variance can be computed from a single value, in which case it is zero. Sample variance needs at least two values, because it divides by n − 1 and a single observation would mean dividing by zero. In practice, a sample variance from two or three values is very unstable, and most statistical work uses considerably more observations before treating the figure as a reliable estimate of the population spread.

Does adding the same number to every value change the variance?

No. Shifting a whole data set up or down leaves the spread untouched, so the variance is unchanged. Adding 100 to each of 12, 15, 11, 18, 14 moves the mean from 14 to 114 while the sample variance stays at 7.5. Multiplying is different: scaling every value by k multiplies the variance by k squared, so doubling the data set raises the sample variance from 7.5 to 30.

How does an outlier affect variance?

Strongly, because the deviations are squared before they are averaged. In the set 12, 15, 11, 18, 14 the sample variance is 7.5. Replace the 14 with 40 and it jumps to 142.7, and replace it with 70 and it reaches 634.7. A single distant value can dominate the whole sum of squares, which is why it is worth checking a data set for typing errors and genuine outliers before trusting a variance figure.

What is the shortcut formula for variance?

The sum of squared deviations equals the sum of x squared minus the square of the sum of x divided by N. For 12, 15, 11, 18, 14 the sum of x squared is 1,010 and the square of the sum divided by N is 4,900 / 5 = 980, so the sum of squares is 30, exactly matching the deviation-by-deviation total. The shortcut is handy for hand calculation because it needs only two running totals.

Is this variance calculator free?

Yes. There is no sign-up, no fee, and no limit on how many data sets you can run. Everything is computed in your browser, so the numbers you paste in never leave your device. You can switch between sample and population, change the number of decimal places, and read the full step-by-step working for each data set.

💡 Good to know

Spreadsheets have two different functions

VAR.S and VAR.P (and their older names VAR and VARP) are not interchangeable. VAR.S divides by n − 1 and VAR.P divides by N. Picking the wrong one is the single most common source of a variance that does not match the answer key.

Variances add, standard deviations do not

If two independent quantities are added together, the variance of the total is the sum of the two variances. The standard deviation of the total is the square root of that sum, not the sum of the two standard deviations. This is why the mathematics of statistics is written in variances.

The deviations column is a free error check

Whatever the data, the deviations from the mean must add to exactly zero. If your column does not, stop and recheck the mean before you square anything. It takes seconds and catches most hand-calculation errors.

Related Calculators