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
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.
- Enter your dataset as comma-separated numbers in the text box. At least two values are required.
- 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.
- Read the primary result — the variance for your chosen mode — and the matching standard deviation directly beneath it.
- 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.
- 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.
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.
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.
Frequently asked questions.
What is the difference between variance and standard deviation?
Why does sample variance divide by n − 1 instead of n?
Why does this calculator require at least two values?
Why is variance the quantity used in ANOVA and regression, rather than standard deviation?
What units is variance reported in?
How is this different from Quanta's standard deviation calculator?
References& sources.
- [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]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]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]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