Variance Calculator

Measure how far your data spreads around its mean. Choose between the population and sample formulas, then follow the built-in breakdown — mean, deviations, squared deviations, and the final division — to see exactly how the variance was produced.

Population or Sample? Decide First

Population variance (divide by N): your numbers are the entire group you care about — every student in one class, every unit produced today.

Sample variance (divide by n − 1): your numbers are a subset standing in for a larger group — 30 survey responses out of thousands of customers.

The choice only changes the divisor, but on small data sets that difference is substantial, so make the call before quoting a result.

Entering Your Data

  • Separate values with commas, spaces, or new lines; a column pasted from a spreadsheet works as-is.
  • Keep every value in the same unit — variance is reported in squared units, so mixed units become meaningless.
  • Sample variance needs at least two values; with one value there is no spread to estimate.

Enter numbers separated by commas or spaces

The Variance Formula, Unpacked

Variance is the average of the squared distances between each value and the mean. Squaring does two jobs at once: it removes the minus signs (so deviations below the mean cannot cancel deviations above it) and it weights large deviations more heavily than small ones, making variance especially sensitive to values far from center.

Population: σ² = Σ(x − μ)² / N

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

Where:

  • x = each value, μ or x̄ = the mean
  • N = population size, n = sample size
  • Σ(x − mean)² = the sum of squared deviations

Because every deviation is squared, variance carries squared units — a variance of 6.5 cm² for plant heights measured in centimeters. Taking the square root converts back to the original units, which is exactly what the standard deviation calculator reports as its headline number.

Why the Sample Formula Divides by n − 1

A sample almost never captures the full spread of the population it came from, because the extreme values of a population are exactly the ones least likely to be drawn. On top of that, the sample mean is computed from the same data, so it sits closer to the sample values than the true population mean would. Both effects make the raw average of squared deviations an underestimate.

Dividing by n − 1 instead of n — a correction named after Friedrich Bessel — enlarges the result just enough to cancel that bias on average. The quantity n − 1 is the number of degrees of freedom: once the sample mean is fixed, only n − 1 deviations can vary freely, because they must sum to zero. With large samples the two divisors barely differ (dividing by 999 versus 1000), but with five values the sample variance is 25% larger than the population version, which is far from a rounding detail.

Variance at Work

Although the standard deviation is easier to quote, variance itself is the quantity that statistical theory is built on.

  • Finance: portfolio risk models add and decompose variances, because variances of independent returns combine by simple addition while standard deviations do not.
  • Experiment design: ANOVA — literally the analysis of variance — splits total variance into between-group and within-group parts to test whether treatments differ.
  • Machine learning: the bias-variance trade-off describes how a model that fits training data too flexibly produces predictions with high variance on new data.
  • Manufacturing: process engineers track the variance of critical dimensions, since a shift in spread often signals tool wear before the mean moves at all.

If you only need a quick sense of center before studying spread, the mean, median, mode calculator handles that side of the analysis, and the descriptive statistics calculator combines both perspectives in a single report.

Worked Example: Five Seedling Heights

A biology student measures five seedlings, in centimeters: 10, 12, 9, 15, 14. Treating them as a sample from a larger tray, the calculator works through:

  1. Mean: 10 + 12 + 9 + 15 + 14 = 60, so the mean is 60 ÷ 5 = 12.
  2. Deviations from the mean: −2, 0, −3, 3, 2.
  3. Squared deviations: 4, 0, 9, 9, 4.
  4. Sum of squares: 4 + 0 + 9 + 9 + 4 = 26.
  5. Divide by n − 1 = 4: sample variance s² = 26 ÷ 4 = 6.5, giving a sample standard deviation of √6.5 ≈ 2.5495.

Had those five seedlings been the entire population of interest — say, the only plants in the experiment — the divisor would be N = 5 instead, giving a population variance of 26 ÷ 5 = 5.2 and a standard deviation of √5.2 ≈ 2.2804. Same data, different question, different divisor: that is the entire population-versus-sample distinction in one example.

Frequently Asked Questions

How do I know whether to choose population or sample variance?

Ask whether your data is the whole group you want to describe or a subset standing in for something larger. Grades of every student in one class, analyzed for that class only, are a population. Thirty customers surveyed out of ten thousand are a sample, so divide by n - 1 to correct for the spread your subset inevitably misses.

What does n − 1 actually correct?

Sample deviations are measured from the sample mean, which is always positioned to make those deviations as small as possible. Dividing by n - 1 (the degrees of freedom) instead of n inflates the result just enough to remove that systematic underestimate, making the sample variance an unbiased estimator of the population variance.

Why is my variance so much larger than my data values?

Variance is expressed in squared units, so its scale is not comparable to the data. Heights spread around 2.5 cm from the mean produce a variance near 6.5 square centimeters. Take the square root - the standard deviation - whenever you need a spread figure in the original units.

Can variance be zero or negative?

Variance can be zero only when every value is identical, since all deviations are then zero. It can never be negative: each squared deviation is non-negative, and a sum of non-negative terms divided by a positive divisor stays non-negative.

How is this different from the standard deviation calculator?

Both tools start from the same sum of squared deviations. This page focuses on the variance itself, lets you switch between the population and sample divisors, and shows each intermediate quantity. The standard deviation calculator reports the population square root alongside other summary statistics of the data set.

Embed This Calculator

Add this free calculator to your course page or LMS.

Adjust the height value to fit your page.