ToolNimba

๐Ÿ“ Variance Calculator: Sample and Population Variance

By ToolNimba Editorial Team ยท Updated 2026-06-22

Count (n)
-
Sum
-
Mean
-
Sum of squares (SS)
-
Sample variance
-
Sample standard deviation
-
Divisor used
-
Sorted values
-

Variance measures the average squared distance of each value from the mean. Sample variance divides SS by n - 1; population variance divides by n.

Variance measures how spread out a set of numbers is by averaging the squared distance of each value from the mean. Paste a list of numbers, choose sample or population variance, and this calculator returns the count, sum, mean, the sum of squared deviations, the variance, and the standard deviation. It also shows your sorted values so you can sanity-check the data you entered.

What is the Variance Calculator?

Variance is the workhorse measure of spread in statistics. You compute it in three steps: find the mean of your data, subtract the mean from each value and square the result, then average those squared deviations. Squaring matters for two reasons. First, it removes the sign, so values above and below the mean both add to the spread instead of cancelling out. Second, it weights large departures from the mean more heavily than small ones, which is exactly what you want when measuring volatility or risk.

The one subtlety is what you divide by. The sum of squared deviations, often written SS, is the same no matter what. But population variance divides SS by n (the count), while sample variance divides SS by n minus 1. The smaller divisor in the sample formula makes the sample variance slightly larger. This adjustment, known as Bessel's correction, exists because a sample tends to underestimate the true spread of the population it was drawn from. Dividing by n minus 1 instead of n corrects that bias, which is why sample variance is the default for most real-world data where your numbers are a subset of something larger.

Variance is expressed in squared units, which can feel abstract. If your data is in dollars, the variance is in dollars squared; if it is in centimetres, the variance is in centimetres squared. To get back to the original units you take the square root of the variance, which gives the standard deviation. The standard deviation is usually the number people actually report and interpret, because it lives on the same scale as the data. Variance and standard deviation always rise and fall together, so a larger variance always means a larger standard deviation.

Use population variance only when your data set is the entire group you care about, with no inference beyond it: every student in one classroom, every transaction in a closed ledger, every pixel in one image. Use sample variance when your numbers are a sample meant to represent a wider population, which covers the great majority of statistics, surveys, experiments, and quality testing. When you are unsure, sample variance is the safer default, and it is what this calculator selects out of the box.

When to use it

  • Computing the spread of test scores, measurements, or survey responses for a statistics assignment or report.
  • Quantifying volatility or risk in finance, where higher variance in returns means a less predictable investment.
  • Checking process consistency in manufacturing and labs, where low variance signals a stable, repeatable process.
  • Feeding variance into further analysis such as standard deviation, z-scores, ANOVA, or confidence intervals.

How to use the Variance Calculator

  1. Paste or type your numbers into the box, separated by commas, spaces, or new lines.
  2. Choose Sample variance (divide by n - 1) or Population variance (divide by n). Sample is the default.
  3. Read off the count, sum, mean, sum of squares, variance, and standard deviation.
  4. Use the Copy results button to grab all the figures, or switch the type to compare both at once.

Formula & method

Mean = (sum of all values) / n. Sum of squared deviations SS = sum of (x - mean)2. Population variance = SS / n. Sample variance = SS / (n - 1). Standard deviation = the square root of the chosen variance. Sample variance requires at least 2 values because it divides by n - 1.

Worked examples

Find the sample variance and standard deviation of the data set 4, 8, 15, 16, 23, 42.

  1. Count n = 6 and sum = 108, so mean = 108 / 6 = 18
  2. Deviations from the mean: -14, -10, -3, -2, 5, 24
  3. Squared deviations: 196, 100, 9, 4, 25, 576, which sum to SS = 910
  4. Sample variance = SS / (n - 1) = 910 / 5 = 182
  5. Sample standard deviation = sqrt(182) = 13.49 (approx)

Result: Mean 18 - SS 910 - sample variance 182 - sample SD 13.49 (approx)

Find the population variance and standard deviation of the data set 2, 4, 4, 4, 5, 5, 7, 9.

  1. Count n = 8 and sum = 40, so mean = 40 / 8 = 5
  2. Squared deviations from the mean: 9, 1, 1, 1, 0, 0, 4, 16
  3. Sum of squared deviations SS = 32
  4. Population variance = SS / n = 32 / 8 = 4
  5. Population standard deviation = sqrt(4) = 2

Result: Mean 5 - SS 32 - population variance 4 - population SD 2

Sample variance versus population variance at a glance

PropertySample variancePopulation variance
Symbols squaredsigma squared
Divisorn - 1n
Use whenData is a sample of a larger groupData is the entire group
BiasUnbiased estimate of population varianceExact for the population only
Minimum values2 (divides by n - 1)1

Steps to calculate variance by hand

StepWhat to doExample (4, 8, 6)
1Add the values and divide by n to get the mean(4 + 8 + 6) / 3 = 6
2Subtract the mean from each value-2, 2, 0
3Square each deviation4, 4, 0
4Add the squared deviations to get SS4 + 4 + 0 = 8
5Divide by n - 1 (sample) or n (population)Sample: 8 / 2 = 4

Common mistakes to avoid

  • Dividing by n when you should divide by n - 1. If your data is a sample drawn from a larger population, you must divide the sum of squares by n - 1, not n. Using n understates the spread and gives a biased estimate. Only divide by n when your data is the complete population.
  • Forgetting to square the deviations. A common slip is to average the raw deviations from the mean, but those always sum to zero. You must square each deviation first so positive and negative gaps both add to the total spread instead of cancelling.
  • Confusing variance with standard deviation. Variance is in squared units; standard deviation is its square root, in the original units. Reporting variance where a standard deviation is expected makes the number look far larger than the actual spread of the data.
  • Rounding the mean too early. Rounding the mean before computing the squared deviations injects error that grows when you square it. Keep full precision for the mean and the deviations, and round only the final variance or standard deviation.

Glossary

Variance
The average of the squared deviations from the mean. It measures how spread out a data set is, in squared units.
Standard deviation
The square root of the variance. It expresses the spread in the same units as the original data.
Mean
The arithmetic average: the sum of all values divided by how many there are.
Sum of squares (SS)
The sum of the squared deviations of each value from the mean. The numerator in every variance formula.
Sample vs population
A sample is a subset drawn from a larger group; the population is the entire group. Sample variance divides SS by n - 1, population variance by n.
Bessel's correction
Dividing the sum of squares by n - 1 instead of n so that the sample variance is an unbiased estimate of the population variance.

Frequently asked questions

How do I calculate variance?

Find the mean of your data, subtract the mean from each value and square the result, then add up those squared deviations to get the sum of squares (SS). Divide SS by n for population variance or by n - 1 for sample variance. This calculator does all of that automatically and shows the intermediate numbers.

What is the difference between sample and population variance?

Both start from the same sum of squared deviations. Population variance divides it by n and is used when your data is the entire group. Sample variance divides by n - 1 and is used when your data is a sample of a larger population. The n - 1 divisor corrects the bias that makes samples underestimate the true spread.

Why does sample variance divide by n - 1 instead of n?

Because a sample tends to cluster a little more tightly than the full population, so dividing by n would underestimate the real variance. Dividing by n - 1, known as Bessel's correction, inflates the result just enough to make it an unbiased estimate of the population variance.

Is variance the same as standard deviation?

No. Variance is the average squared deviation from the mean, so it is in squared units. The standard deviation is the square root of the variance, which brings it back to the original units. They always move together, but the standard deviation is usually the one people report and interpret.

Can variance be negative?

No. Variance is an average of squared numbers, and squares are never negative, so variance is always zero or positive. A variance of exactly zero means every value in the data set is identical, with no spread at all.

How many numbers do I need to calculate variance?

Population variance can be computed from a single value (it would just be zero). Sample variance needs at least 2 values because it divides by n - 1, and dividing by zero is undefined. For a meaningful measure of spread you generally want several data points.