Variance Calculator
Enter your data set, choose population or sample variance, and get the variance, standard deviation, mean, median, range, and coefficient of variation, plus a full per-value deviation breakdown and step-by-step working.
Formula
Worked example
For 2, 4, 4, 4, 5, 5, 7, 9: mean = 40/8 = 5. Squared deviations: 9, 1, 1, 1, 0, 0, 4, 16. Sum = 32. Population variance = 32/8 = 4 (SD = 2). Sample variance = 32/7 = 4.5714 (SD = 2.1381). Range = 9 - 2 = 7. CV (population) = 2/5 = 40%.
What variance measures and why it matters
Variance quantifies how far a set of numbers spreads out from their mean. To compute it, you find the mean, subtract it from each value to get a deviation, square every deviation so that positive and negative differences cannot cancel, sum those squared deviations, and divide by the count. Squaring is key: a value twice as far from the mean contributes four times as much to the variance, making variance highly sensitive to outliers. A variance of zero means every value is identical and there is no spread at all. Variance is expressed in squared units, which is why analysts also report the standard deviation, its square root, which is in the same units as the original data and therefore much easier to interpret intuitively. Together, variance and standard deviation are the most widely used measures of statistical dispersion and appear in almost every branch of quantitative analysis.
Population versus sample variance
The difference between population and sample variance is the divisor. Population variance divides the sum of squared deviations by N, the total count, and is correct when your data set is the complete group you are studying. Sample variance divides by N - 1, a step called Bessel's correction, and is used when your numbers are a subset of a larger population from which you want to infer the true spread. The intuition behind N - 1: the sample mean is always closer to the sample points than the unknown population mean is, so using N as the divisor would systematically underestimate the true variance. Subtracting one from the denominator inflates the estimate slightly to correct for that bias, making the sample variance an unbiased estimator of the population variance. As sample size grows, the difference between dividing by N and N - 1 becomes negligible.
Coefficient of variation: comparing spread across data sets
The coefficient of variation (CV) is the standard deviation divided by the absolute value of the mean, usually expressed as a percentage. Unlike variance and standard deviation, which are in the original units, CV is dimensionless, making it possible to compare the relative dispersion of data sets that are measured on different scales or have very different means. For example, a height data set with SD = 10 cm and mean = 170 cm has a CV of about 5.9%, while a weight data set with SD = 15 kg and mean = 70 kg has a CV of about 21.4%. Even though the weight SD is larger in absolute terms, the height data is actually less variable relative to its central value. CV is widely used in biology, finance (where it is called the relative standard deviation), and quality control. It is not meaningful when the mean is zero or can change sign.
Reading the per-value deviation table
The deviation table lists every data point with its deviation from the mean (x - mean) and the squared deviation ((x - mean)^2). Scanning the squared deviation column immediately shows which values are pulling the variance up the most, since larger squared deviations dominate the sum. A value close to the mean has a near-zero squared deviation and barely affects the variance. A single outlier can have a squared deviation many times larger than any other entry, revealing why removing one point would dramatically reduce the overall spread. The sum of all squared deviations divided by the appropriate denominator (N or N - 1) gives the variance, so the table is a complete, transparent accounting of where every unit of variance comes from.
Variance and standard deviation in practice
Variance and standard deviation appear throughout statistics, finance, and the sciences. In finance, variance of returns is the canonical measure of portfolio risk, and the standard deviation is reported as volatility. In quality control, variance quantifies how consistently a manufacturing process stays within tolerance: six-sigma programs aim to shrink variance until essentially all output falls within specification limits. In the natural sciences, variance captures measurement noise and experimental reproducibility. Variance is also the engine behind many higher-level statistical methods: analysis of variance (ANOVA) partitions total variance into explained and unexplained components, the normal distribution is fully characterized by its mean and variance, and linear regression minimizes the variance of residuals. Because the variance of the sum of independent random variables equals the sum of their individual variances, variance is mathematically convenient even when standard deviation is ultimately reported.
Descriptive statistics at a glance
| Statistic | Formula | Best used for |
|---|---|---|
| Population variance (s²) | Σ(xᵢ - μ)² / N | Complete data sets with no sampling |
| Sample variance (s²) | Σ(xᵢ - x̄)² / (N - 1) | Inferring population spread from a sample |
| Standard deviation (σ or s) | √Variance | Spread in the original units of measurement |
| Coefficient of variation | SD / |mean| | Comparing spread across different-scale data sets |
| Range | Max - Min | Quick sense of total data spread |
| Median | Middle value when sorted | Center that is robust to outliers |
Summary of every statistic this calculator produces and when each one is most useful.
Frequently asked questions
What is the difference between variance and standard deviation?
Standard deviation is the square root of variance. Variance is expressed in squared units (for example, squared dollars or squared kilograms), which makes direct interpretation difficult. The standard deviation converts the spread back to the original units of the data, making it much easier to say things like "most values are within two standard deviations of the mean." Both statistics convey the same underlying information about dispersion; variance is preferred in algebra because it is additive for independent quantities, while standard deviation is preferred for communication because it is on the same scale as the data.
Should I use population or sample variance?
Use population variance (divide by N) when your data set is the complete group you are studying. Use sample variance (divide by N - 1) when your data is a sample drawn from a larger population and you want to estimate that population's variance. The N - 1 denominator, known as Bessel's correction, prevents the sample variance from systematically underestimating the true spread. A common example: if you measure the heights of every student in one class, use population variance. If you measure a random sample of 30 students to infer something about all students at the school, use sample variance.
Why is variance always zero or positive?
Variance averages squared deviations from the mean, and any real number squared is zero or positive. Even a negative deviation (when a value is below the mean) becomes positive once squared. The sum of those squared terms is therefore always zero or positive, and dividing by a positive count or N - 1 keeps the result non-negative. Variance equals exactly zero only when every value in the data set is identical, meaning there is no spread at all.
What does the coefficient of variation (CV) tell me?
The coefficient of variation is the standard deviation divided by the absolute value of the mean, expressed as a percentage. It measures relative dispersion: how large the spread is compared to the typical value. A low CV (under about 10%) suggests tight clustering around the mean, while a high CV (above 30%) indicates substantial spread relative to the magnitude of the values. Because CV is dimensionless, you can use it to compare the variability of two data sets that are measured in different units or that have very different means, something that raw standard deviations cannot do directly.
How do I read the per-value deviation table?
The table lists every data point alongside its deviation from the mean (the raw difference x minus mean) and the squared deviation ((x minus mean) squared). The squared deviation column is the most informative: values close to the mean have near-zero squared deviations, while outliers have very large squared deviations. Summing the squared deviation column and dividing by N (or N - 1 for a sample) gives the variance. Looking at which rows have the largest squared deviations shows you exactly which values are responsible for most of the variance in your data set.
Can variance be used to compare data sets?
You can compare variances when data sets are measured in the same units and have similar means. When the units or the means differ substantially, use the coefficient of variation instead, since it normalizes spread by the mean and becomes a dimensionless percentage. For formal statistical comparisons of two variances (for example, to decide whether two processes have equal variability), use the F-test or Levene's test, both of which are based on the ratio of sample variances.