Audited ·Last updated 27 Jul 2026·4 citations·Tier 2·0 uses

Variance Calculator

Calculate sample and population variance from any dataset, plus standard deviation, mean, and count — the exact statistic ANOVA and regression use.

Variance Calculator

Enter at least two numbers, separated by commas.
Variance type
Variance
3.5
The selected (sample or population) variance.
Standard deviation
1.8708
Population variance (σ²)
2.9167
Sample variance (s²)
3.5
Mean
5.5
Count (n)
6

Background.

A variance calculator measures how spread out a dataset is by averaging the squared distance of every value from the mean. Variance is standard deviation's less famous but arguably more fundamental sibling: standard deviation is simply the square root of variance, taken purely for convenience because it returns to the original units of the data. Variance itself stays in squared units — square dollars, square kilograms, square seconds — which sounds awkward for everyday reporting but turns out to be exactly the property that makes variance, not standard deviation, the quantity statisticians actually compute with. This calculator reports both the sample and population variance from any comma-separated list of numbers, along with the corresponding standard deviation, the mean, and the count, so you always see the full picture regardless of which flavor your assignment or analysis calls for.

The single most important fact about variance, and the reason this calculator exists as a distinct tool rather than a duplicate of a standard-deviation calculator, is that variance is additive for independent random variables: Var(X + Y) = Var(X) + Var(Y) whenever X and Y are independent. Standard deviation does not share this property — the standard deviation of a sum is not the sum of the standard deviations, and computing it requires converting back to variance, adding, and then taking a square root. This additivity is not a mathematical curiosity; it is the entire mechanical foundation of analysis of variance (ANOVA) and ordinary least-squares regression, two of the most widely used statistical techniques in science, engineering, and business analytics. ANOVA works by decomposing the total variance in a dataset into a between-group component and a within-group component, then comparing their relative sizes to test whether group means genuinely differ. Regression analysis works by decomposing total variance in the outcome variable into variance explained by the model and residual (unexplained) variance, and the ratio of those two — explained variance divided by total variance — is exactly the R² statistic reported on every regression printout. None of this decomposition arithmetic works cleanly with standard deviation; it requires variance specifically.

As with standard deviation, variance comes in two flavors that differ only in their divisor. Population variance divides the sum of squared deviations by n, the full count of your dataset, and is the right choice when your data already represents every member of the group you care about. Sample variance divides by n − 1 instead — a correction named after the nineteenth-century astronomer Friedrich Bessel — and is the right choice when your data is a sample drawn from some larger population you want to draw conclusions about. The n − 1 divisor exists because the sample mean itself is estimated from the very data being measured, which makes the observed deviations systematically a little smaller, on average, than deviations from the true (unknown) population mean would be; dividing by n − 1 instead of n exactly corrects for that bias, making sample variance an unbiased estimator of the population variance it is trying to estimate.

Because sample variance's divisor is n − 1, it is mathematically undefined for a dataset with only one value — dividing by zero has no meaningful result — so this calculator requires at least two data points before it will compute anything, rather than silently returning an undefined or infinite result. Manufacturing quality control is a natural home for this calculator: measuring five bolts from a production run and finding a small variance in their diameters is reassuring evidence of a tightly controlled process, while a large variance signals the process needs attention even if the average diameter looks fine. Financial analysts, scientists running designed experiments, and students working through an introductory statistics or econometrics course all reach for variance specifically — not just its square root — because their next calculation, whether it is a pooled variance for a t-test, a between-group sum of squares for ANOVA, or a residual sum of squares for regression, needs the squared quantity directly.

What is variance calculator?

Variance is a measure of how spread out a set of numbers is, computed as the average of the squared differences between each value and the dataset's mean. Because the differences are squared before averaging, variance is always zero or positive, and it is reported in squared units of whatever the original data measured. There are two standard versions, distinguished only by their divisor. Population variance, denoted σ² (sigma squared), divides the sum of squared deviations by n, the total number of observations, and applies when the dataset is the entire population of interest. Sample variance, denoted s², divides by n − 1 instead — a correction known as Bessel's correction — and applies when the dataset is a sample drawn from a larger population about which conclusions are being drawn. Both quantities have a square root: the population standard deviation σ and the sample standard deviation s, which return the measure of spread to the original (non-squared) units of the data and are usually easier for a general audience to interpret directly. Variance's defining mathematical property is additivity for independent random variables — the variance of a sum of independent quantities equals the sum of their individual variances — a property standard deviation does not share. That additivity is why variance, rather than standard deviation, is the quantity decomposed and compared directly in analysis of variance (ANOVA) and in the explained/residual variance split that produces the R² statistic in regression analysis.

How to use this calculator.

  1. Enter your dataset as comma-separated numbers in the text box. At least two values are required.
  2. Choose sample variance (divide by n−1) if your data is a sample drawn from a larger population, or population variance (divide by n) if your data is the entire population you care about.
  3. Read the primary result — the variance for your chosen mode — and the matching standard deviation directly beneath it.
  4. Check the population variance, sample variance, mean, and count fields, which are always shown regardless of the mode you selected, so you can compare both divisors side by side.
  5. If you need the additive property of variance — for example, combining variances of independent measurement sources, or feeding a value into an ANOVA or regression calculation — use the variance output directly rather than squaring the standard deviation by hand.

The formula.

s² = Σ(xᵢ − x̄)² ⁄ (n − 1)

The calculation runs in two passes for numerical stability, following the NIST/SEMATECH e-Handbook's recommended approach. First, the mean is computed as the sum of all values divided by the count, n. Second, the squared deviation of every value from that mean is computed and summed, producing the sum of squared deviations (often written SS). Population variance is then SS divided by n; sample variance is SS divided by n − 1. The two results differ only in that final division, but the gap between them is largest for small datasets — dividing by 1 instead of 2 when n = 2 doubles the variance — and shrinks toward negligible as n grows into the hundreds.

The n − 1 divisor, Bessel's correction, corrects a subtle but real bias. Because the sample mean x̄ is calculated from the very data whose spread is being measured, the deviations (xᵢ − x̄) are, on average, slightly smaller than the deviations from the true but unknown population mean μ would be. Dividing by n rather than n − 1 would therefore systematically underestimate the population variance; dividing by n − 1 exactly removes that bias, which is why sample variance with Bessel's correction is called an unbiased estimator.

What makes variance special, mathematically, is that it is additive for independent quantities: Var(X + Y) = Var(X) + Var(Y) whenever X and Y are statistically independent. This is the property analysis of variance (ANOVA) relies on directly — total variance in a dataset with several groups is decomposed into a between-group variance component and a within-group variance component, and comparing their relative sizes (via the F-statistic) is how ANOVA tests whether group means genuinely differ. Ordinary least-squares regression uses the identical decomposition: total variance in the outcome variable splits into variance explained by the fitted model and residual variance left unexplained, and the ratio of explained to total variance is precisely the R² goodness-of-fit statistic reported alongside every regression. Standard deviation cannot be decomposed this way — you cannot add two standard deviations together and get the standard deviation of the combined quantity — which is the core reason variance, not merely its square root, deserves its own dedicated calculator.

A worked example.

Example

A quality-control technician measures the diameter, in millimetres, of five bolts pulled from a single production run: 10.2, 10.5, 9.8, 10.1, and 10.4. The sum of these five measurements is 51.0, so the mean diameter is 51.0 divided by 5, which is 10.2 mm. Subtracting the mean from each measurement gives deviations of 0, 0.3, −0.4, −0.1, and 0.2 millimetres. Squaring each deviation gives 0, 0.09, 0.16, 0.01, and 0.04, which sum to a total sum of squared deviations of 0.30. Because these five bolts are a sample from an ongoing production run — not every bolt the line will ever produce — the technician uses sample variance, dividing the sum of squared deviations by n − 1, which is 4: 0.30 ÷ 4 = 0.075 mm². The corresponding sample standard deviation is the square root of 0.075, approximately 0.274 mm. For comparison, the population variance (dividing by n = 5 instead) would be 0.30 ÷ 5 = 0.06 mm², with a population standard deviation of about 0.245 mm — treating this batch of five as if it were the entire population rather than a sample of a larger run. The technician records the sample variance, 0.075 mm², directly in the quality log, because a rising variance over successive batches — even if the average diameter stays at 10.2 mm — is an early warning sign that the machining process is drifting out of tolerance before any individual bolt fails an inspection.

values10.2, 10.5, 9.8, 10.1, 10.4
variance Typesample

Frequently asked questions.

What is the difference between variance and standard deviation?
Standard deviation is the square root of variance — the two describe the same underlying spread in the data, expressed in different units. Variance is reported in squared units of the original data (square dollars, square kilograms), which makes it awkward to interpret directly but gives it the mathematically useful property of being additive for independent quantities: Var(X + Y) = Var(X) + Var(Y). Standard deviation returns to the original, non-squared units, which makes it far easier for a general audience to interpret ("a typical value is about 2 units from the mean"), but it loses the additivity property in the process. The practical rule: use variance inside formulas and statistical procedures where quantities need to be added together (ANOVA, regression, propagation of measurement uncertainty), and report standard deviation in summaries, dashboards, and plain-language explanations.
Why does sample variance divide by n − 1 instead of n?
The sample mean used to compute deviations is itself calculated from the same data whose spread is being measured, which makes those deviations systematically a little smaller, on average, than deviations from the true (but unknown) population mean would be. Dividing the sum of squared deviations by n would therefore underestimate the population variance on average. Dividing by n − 1 instead — a correction known as Bessel's correction, after the nineteenth-century astronomer who formalised it — exactly removes that bias, making sample variance s² what statisticians call an unbiased estimator of the true population variance.
Why does this calculator require at least two values?
Sample variance divides the sum of squared deviations by n − 1. With only one data point, n − 1 equals zero, and dividing by zero has no defined mathematical result. Rather than returning an error placeholder like NaN or infinity, this calculator declines to compute anything at all when fewer than two values are entered, and asks for at least one more data point. Population variance, by contrast, is technically defined even for a single value (it would simply be zero, since there is no deviation to measure), but this calculator applies the two-value minimum uniformly so both variance types are always available side by side.
Why is variance the quantity used in ANOVA and regression, rather than standard deviation?
Because variance, unlike standard deviation, is additive for independent quantities: the variance of a sum of independent components equals the sum of their individual variances. Analysis of variance (ANOVA) exploits this directly by splitting the total variance in a dataset into a between-group component and a within-group component, then comparing their relative sizes to test whether group means genuinely differ. Ordinary least-squares regression performs an identical decomposition, splitting total variance in the outcome variable into variance explained by the fitted model and residual variance left over — and the ratio of explained to total variance is exactly the R² statistic printed on every regression summary. Neither decomposition works with standard deviation directly, because standard deviations do not add; they would first need to be squared back into variances, added, and then the square root taken again.
What units is variance reported in?
Variance is always reported in the square of whatever units the original data used. If your dataset measures diameters in millimetres, variance is reported in square millimetres (mm²); if it measures investment returns as a percentage, variance is reported in percentage-points-squared. This squared-unit reporting is often the main reason people prefer standard deviation for everyday communication — a standard deviation of 0.27 millimetres is intuitive, while a variance of 0.075 square millimetres requires an extra mental step to interpret. Squared units are exactly why variance, not standard deviation, behaves additively, which is the trade-off this calculator's dual output (both quantities, side by side) is designed to make visible rather than hide.
How is this different from Quanta's standard deviation calculator?
The two calculators compute the same underlying statistics from the same kind of comma-separated dataset, but they lead with different primary results and serve different purposes. Quanta's standard-deviation calculator leads with the standard deviation (population and sample), which is the more intuitive, same-units figure most people want for everyday reporting and interpretation. This variance calculator leads with variance itself and adds an explicit sample/population mode selector, because variance — not its square root — is the quantity you need directly when combining independent sources of variability, running an ANOVA, or decomposing variance in a regression model. If you are unsure which you need, the standard-deviation calculator is the better starting point for general description of spread; come here specifically when your next calculation step requires the squared, additive quantity.

References& sources.

  1. [1]NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.6 "Measures of Scale" — defines the sample variance formula s² = Σ(Yᵢ − Ȳ)² / (N − 1) and the corresponding standard deviation.
  2. [2]NIST/SEMATECH e-Handbook of Statistical Methods, §7.4.2 — explains why ANOVA techniques for comparing means require testing and assuming a common variance across groups, the basis for variance's role in ANOVA.
  3. [3]Casella, George and Berger, Roger L. Statistical Inference, 2nd edition. Duxbury / Cengage, 2002. Theorem 5.2.4 proves that s² with the n−1 divisor is the unbiased estimator of σ².
  4. [4]Bessel, Friedrich Wilhelm. "Untersuchungen über die Wahrscheinlichkeit der Beobachtungsfehler." Astronomische Nachrichten 15, 1838, pp. 369–404 — the original derivation of the n−1 correction, now universally known as Bessel's correction.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 313 calculators remain free
  • No billing is enabled
Coming soon