Variance Calculator
Measure how far three numbers spread from their mean by averaging the squared deviations.
What variance measures
Variance is the average of the squared distances between each value and the mean. It answers one question: how far, on average in squared units, do the numbers sit from their center? A variance of 0 means every value equals the mean; larger variances mean wider scatter. This calculator takes three numbers and returns their population variance along with the mean used to compute it. At the defaults of 4, 8 and 6 the mean is 6 and the variance is about 2.67.
The statistic is deliberately lopsided: because gaps are squared, one value 10 units from the mean adds 100 to the squared total while ten values 1 unit away add only 10 combined. Variance therefore behaves like a smoke detector for outliers — it reacts far more to a single extreme reading than to many mild ones, which is exactly the property that makes it useful in quality control and finance.
How the calculation runs step by step
The computation has three moves: find the mean, subtract it from every value and square each difference, then average the squares by dividing through n. Subtracting centers the data; squaring strips the signs so negative and positive gaps both count, and it stretches large gaps disproportionately. Every dataset’s raw deviations sum to exactly zero — for 4, 8 and 6 they are −2, 2 and 0 — which is precisely why the squaring step is required before anything can be averaged.
Worked example at the defaults
Values 4, 8 and 6. Step 1: mean = (4 + 8 + 6) ÷ 3 = 6. Step 2: deviations are −2, 2 and 0. Step 3: squares are 4, 4 and 0. Step 4: variance = (4 + 4 + 0) ÷ 3 = 8 ÷ 3 ≈ 2.67. The units are squared: if the values were dollars, the variance is 2.67 dollars², which is why raw variance is rarely quoted to non-statisticians and its square root, the standard deviation of about 1.63, is used for interpretation instead.
The outlier penalty
One extreme value moves variance dramatically. Swap the 8 for 20: the mean becomes 10, the deviations −6, 10 and −4, the squares 36, 100 and 16, and the variance climbs to 152 ÷ 3 ≈ 50.67 — roughly 19 times the default 2.67 from changing one of three numbers. Squared distances grow with the square of the gap, so tails dominate the statistic while the mean barely shifts, from 6 to 10.
Population versus sample variance
Dividing by n gives population variance, which this calculator uses and which is correct when your three numbers are the whole group. Sample variance divides by n − 1 instead, correcting the bias that appears when deviations are measured from the sample mean rather than the true mean. For 4, 8 and 6 the population variance is 8 ÷ 3 ≈ 2.67 while the sample variance is 8 ÷ 2 = 4, a 50% difference that shrinks as samples grow: at 300 values the two formulas differ by about 0.3%.
Which divider does your problem want
Course problems flag the choice with wording. A complete roster, the word all, or the population calls for n; a random sample, estimate, or unbiased calls for n − 1. Spreadsheet functions encode it too: VAR.P versus VAR.S. On a three-value problem the wrong divider is the most common lost mark, and the sample version is always the larger number.
Variance across datasets with the same mean
| Dataset | Mean | Population variance |
|---|---|---|
| 4, 4, 4 | 4 | 0 |
| 4, 8, 6 (defaults) | 6 | 2.67 |
| 3, 9, 6 | 6 | 6.00 |
| 0, 6, 12 | 6 | 24.00 |
The last three rows share the same mean of 6, yet their variances span from 2.67 to 24.00 — a ninefold spread difference invisible to any measure of center. That is the whole point of variance: it detects what averages cannot. Two delivery routes with the same 30-minute average trip, one steady and one wildly inconsistent, differ exactly the way rows two and four do.
Why square instead of using absolute value
Squaring is not the only way to make deviations positive — the mean absolute deviation takes the plain |x − mean| — but squared deviations have three algebraic advantages that keep variance at the center of statistics.
- Squaring is algebra-friendly: variances add for independent variables, which underpins portfolio theory and ANOVA.
- It is smooth near zero, so calculus-based statistics can differentiate it; the absolute value has a corner at the mean.
- The square root then recovers the original units as the standard deviation.
- The cost is sensitivity: one outlier at distance 10 adds 100 to the variance, ten times what ten outliers at distance 1 add.
Common mistakes
Three-value variance problems are short, so almost every wrong answer traces to one of four procedural slips rather than a conceptual gap.
- Averaging raw deviations: −2 + 2 + 0 = 0, so skipping the squares always yields a variance of 0.
- Dividing by n − 1 for a full population, or by n for a sample.
- Mixing units in one set, such as averaging values written in dollars and cents together.
- Reporting variance when the question asked for standard deviation — check whether a square root is missing.
Where variance shows up in practice
Variance is the raw material of most statistics that follow. Hypothesis tests compare variances between groups; regression reports how much of the variance in y it explains; finance builds portfolios by trading off expected return against variance of returns, the classic 2026 coursework example being a 60/40 stock-bond mix whose combined variance sits far below the weighted average of its parts. Quality engineers track process variance because halving it means tolerances hold twice as tightly. All of these reduce to the same arithmetic this calculator performs: subtract the mean, square, average.
Frequently asked questions
How do I calculate variance?
Find the mean, subtract it from each value, square each difference, and average the squares. For 4, 8 and 6 the deviations are −2, 2 and 0, the squares are 4, 4 and 0, and the variance is (4 + 4 + 0) ÷ 3 ≈ 2.67.
What is the difference between variance and standard deviation?
Standard deviation is the square root of variance, so it returns to the original units. Variance 2.67 becomes a standard deviation of about 1.63, which is the number people quote when describing spread.
Why divide by n here instead of n minus 1?
This calculator computes population variance, correct when the three values are the entire group. For a sample, divide by n − 1: the same numbers give a sample variance of 4 instead of 2.67.
Why are the deviations squared?
Raw deviations always sum to zero — −2 + 2 + 0 = 0 for the defaults — so they cannot measure spread. Squaring makes every gap positive and weights big gaps heavily, which is what the formula needs.
What does a variance of zero mean?
Every value equals the mean, as in the set 4, 4, 4. There is no spread at all, and the standard deviation is 0 too.
Can variance be negative?
No. It averages squared quantities, and squares are never negative. A negative result means a subtraction or data-entry error somewhere in the work.
Why is variance in squared units?
Because the deviations were squared. Values measured in dollars produce variance in dollars², which is hard to interpret directly and one reason reports convert to standard deviation by taking the square root.
How much does one outlier change variance?
A great deal, because gaps are squared. Changing 8 to 20 in the default set raises the variance from 2.67 to about 50.67, nearly 19 times larger, while the mean moves only from 6 to 10.
Method and sources
- Population variance = sum of squared deviations / n.