Variance Calculator

A variance calculator takes a set of numbers and tells you how spread out those values are from the mean. Whether you're working with a full population or just a sample, knowing the variance gives you a concrete, numerical way to describe variability in your data. This page walks you through both population and sample variance, the formulas behind each, and step-by-step examples so you can understand exactly what the calculator is doing under the hood.

Enter Details

Result

Enter at least two numbers for sample and population variance.

Sample variance divides by n−1; population variance divides by n.

How to Calculate Variance

At its simplest, calculating variance is a four-step process: find the mean of your data set, subtract that mean from each value, square each of those differences, then average the squared differences.

The reason you square the differences is to eliminate negative values. Without squaring, positive and negative deviations would cancel each other out, and you'd end up with a sum of zero no matter how spread out your data actually is. Squaring ensures every deviation contributes positively to the final result.

The slight wrinkle is in that last step. When you're working with a full population, you divide by the total number of values. When you're working with a sample drawn from a larger population, you divide by one less than the number of values. That distinction matters, and we'll dig into it more below.

Variance Formula

There are two versions of the variance formula, and which one you use depends on your data. Here's a quick side-by-side comparison:

TypeFormulaDenominator
Population Varianceσ² = Σ(xᵢ - μ)² / NN (total count)
Sample Variances² = Σ(xᵢ - x̄)² / (n - 1)n - 1 (Bessel's correction)

In both formulas, you're summing the squared differences between each data point and the mean. The only difference is what you divide by at the end. The population formula uses N (the full count), while the sample formula uses n - 1 to correct for the bias that comes with estimating a population parameter from a subset of data.

Population Variance Calculator

Use population variance when you have data for every single member of the group you're studying. Think of a teacher who wants to find the variance in test scores for their one class of 30 students. Those 30 students are the entire population, so you use every value and divide by N.

If you're entering values into a calculator, just input all your data points, select "population," and the tool will handle the rest. Understanding the formula, though, means you'll actually know what the output represents.

Population Variance Formula

The population variance formula is written as:

σ² = Σ(xᵢ - μ)² / N

  • σ² is the population variance (sigma squared)
  • xᵢ represents each individual value in the data set
  • μ (mu) is the population mean
  • N is the total number of values in the population
  • Σ means you sum up every term

You calculate the mean first, then find how far each data point sits from that mean, square those distances, add them all up, and divide by N. The result is measured in squared units of your original data.

Population Variance Example

Let's say you have the following five values representing the number of hours five employees worked on a given day: 6, 8, 9, 7, 10.

  1. Find the mean: (6 + 8 + 9 + 7 + 10) / 5 = 40 / 5 = 8
  2. Subtract the mean from each value: (6-8)= -2, (8-8)= 0, (9-8)= 1, (7-8)= -1, (10-8)= 2
  3. Square each difference: 4, 0, 1, 1, 4
  4. Sum the squared differences: 4 + 0 + 1 + 1 + 4 = 10
  5. Divide by N (5): 10 / 5 = 2

The population variance is 2. That means, on average, each value is about 2 squared hours away from the mean. Not huge variability in this case.

Sample Variance Calculator

Sample variance comes into play when your data is a subset of a larger population. You're not measuring everyone or everything; you're working with a representative group and using it to draw conclusions about the whole.

This is the version you'll use far more often in real-world statistics, research, and data analysis. Surveys, experiments, quality control checks, and clinical trials almost always deal in samples rather than full populations.

The key mechanical difference is dividing by n - 1 instead of n. This adjustment, called Bessel's correction, prevents the variance estimate from being systematically too small. Without it, sample variance tends to underestimate the true spread of the population.

Sample Variance Formula

The sample variance formula is:

s² = Σ(xᵢ - x̄)² / (n - 1)

  • is the sample variance
  • xᵢ is each individual data point
  • (x-bar) is the sample mean
  • n is the number of values in the sample
  • n - 1 is the degrees of freedom

Everything else works the same as the population formula. You find the mean, compute squared deviations, sum them up, and divide. The only change is in the denominator. That single-number difference can meaningfully shift your result, especially with small sample sizes.

Sample Variance Example

Using the same five values as before (6, 8, 9, 7, 10) but treating them as a sample this time:

  1. Find the sample mean: (6 + 8 + 9 + 7 + 10) / 5 = 8
  2. Subtract the mean from each value: -2, 0, 1, -1, 2
  3. Square each difference: 4, 0, 1, 1, 4
  4. Sum: 4 + 0 + 1 + 1 + 4 = 10
  5. Divide by n - 1 (which is 4): 10 / 4 = 2.5

The sample variance is 2.5, compared to the population variance of 2 using the same numbers. The difference gets more pronounced with smaller samples, which is exactly why Bessel's correction exists.

Variance and Standard Deviation

Variance and standard deviation are closely related. They're both measures of spread, and they're derived from the same underlying calculation. If you understand one, you're most of the way to understanding the other.

The practical difference is in their units. Variance is expressed in squared units (like squared inches or squared dollars), which can be hard to interpret directly. Standard deviation brings things back to the original unit of measurement, making it much easier to communicate and reason about in plain language.

Relationship Between Variance and Standard Deviation

Standard deviation is simply the square root of variance. That's the whole relationship:

σ = √σ² (for population) and s = √s² (for sample)

So if your population variance is 25, your standard deviation is 5. If your sample variance is 2.5, your standard deviation is approximately 1.58. The square root undoes the squaring step in the variance calculation, which is what pulls the result back into the original units of your data.

This also means variance and standard deviation always move together. A larger variance will always produce a larger standard deviation. They rank data sets identically in terms of spread; they just express it differently.

When to Use Each Measure

Standard deviation tends to be more useful for communicating results to a general audience because it's in the same units as your data. If you're measuring heights in inches, a standard deviation of 3 inches is immediately meaningful. A variance of 9 square inches is technically correct but kind of awkward to explain.

Variance, on the other hand, shows up constantly in formal statistical work. Many statistical tests and models (like ANOVA, linear regression, and most probability distributions) are built around variance, not standard deviation. It's also easier to work with mathematically because squared values behave better in algebra than square roots do.

  • Use standard deviation when presenting results, describing data spread in reports, or making comparisons that non-statisticians need to understand.
  • Use variance when doing statistical modeling, running hypothesis tests, or working through theoretical probability problems.

Mean and Variance Calculation

You can't find variance without the mean, so the two calculations are always linked. The mean is your reference point. Every variance calculation starts by figuring out where the center of your data is, then measuring how far each point strays from that center.

To find the mean, add up all your values and divide by how many there are. Simple enough. The variance calculation then uses that mean over and over, once for each data point in your set.

One thing worth keeping in mind: the mean is sensitive to outliers. A single extreme value can pull the mean significantly in one direction, which in turn inflates the variance. If your data has obvious outliers, it's worth knowing whether they represent real variation or data errors before you put too much stock in the variance figure.

Step-by-Step Variance Calculation

Here's a clean walkthrough you can apply to any data set:

  1. List your values. Write out all the numbers in your data set.
  2. Calculate the mean. Add all values together and divide by the count (n for sample, N for population).
  3. Find each deviation. Subtract the mean from each individual value. Some results will be negative; that's fine.
  4. Square each deviation. Multiply each deviation by itself. All results should now be positive (or zero).
  5. Sum the squared deviations. Add all the squared values together.
  6. Divide. For population variance, divide by N. For sample variance, divide by n - 1.

The number you get is your variance. If you also need standard deviation, take the square root of that result. It's worth running through this process manually at least once, even if you typically rely on a calculator, because it makes the formula feel concrete rather than abstract.

Variance Calculation Examples

Here are a few more worked examples to make the process feel familiar.

Example 1: Small data set
Values: 2, 4, 4, 4, 5, 5, 7, 9
Mean: (2+4+4+4+5+5+7+9) / 8 = 40 / 8 = 5
Squared deviations: 9, 1, 1, 1, 0, 0, 4, 16
Sum: 32
Population variance: 32 / 8 = 4
Sample variance: 32 / 7 ≈ 4.57

Example 2: Larger spread
Values: 10, 20, 30, 40, 50
Mean: 150 / 5 = 30
Squared deviations: 400, 100, 0, 100, 400
Sum: 1000
Population variance: 1000 / 5 = 200
Sample variance: 1000 / 4 = 250

Notice how a wider spread in the raw values produces a much larger variance. That's the whole point of the measure: it captures how stretched out or compressed your data is, and the number scales accordingly.

Variance in Statistics and Probability

Variance is one of the foundational concepts in statistics. It shows up in hypothesis testing, confidence intervals, regression analysis, and probability theory. Basically anywhere you're trying to model or understand uncertainty, variance is part of the conversation.

In probability, the variance of a random variable describes how much the outcomes of that variable tend to differ from the expected value. For a fair six-sided die, for instance, the expected value is 3.5, and the variance works out to about 2.92. That number tells you something about how unpredictable any given roll is.

In statistical inference, variance is central to understanding how reliable your estimates are. A sample mean from a low-variance population will be a much more stable estimate than one from a high-variance population. This directly affects things like sample size requirements and the width of confidence intervals.

Beyond the math, variance is useful as a practical thinking tool. When you see high variance in a data set, it's a signal to look closer. Are there meaningful subgroups in your data? Are there outliers that deserve attention? High variance often means there's more to the story than the mean alone is telling you.

Other Maths Calculators

Explore all