Variance Calculator
Calculate sample variance (÷n−1) or population variance (÷n), coefficient of variation (CV%), and variance percentage (% change between two numbers) — three distinct calculations, clearly separated, with complete step-by-step working for each.
Use SAMPLE Variance
s² = Σ(x−x̄)² / (n−1)Use this when your data is a sample drawn from a larger population — e.g. 30 patients out of a hospital's full patient base. Dividing by n−1 (Bessel's correction) prevents underestimating the true population variance.
Use POPULATION Variance
σ² = Σ(x−μ)² / nUse this only when your data IS the entire population — e.g. test scores of every student in one specific class (not a sample of students). No correction is needed since you already have every value.
Sample Variance (s²)
Population Variance (σ²)
Use case: CV is most useful for comparing variability between datasets with different units or different means — e.g. comparing the variability of weights measured in kilograms against heights measured in centimeters. Standard deviation alone cannot make that comparison meaningfully; CV can, because it is a unitless percentage.
CV Interpretation Guide (general convention, not an absolute rule):
Coefficient of Variation
Important: this tool calculates percent change / variance between two single numbers (e.g. budget vs actual, last year vs this year) — not the statistical variance of a dataset. For the statistical variance of a full data set (mean, deviations, sample vs population), use Tool 1 above.
Variance Percentage (% Change)
Used when your dataset is a sample drawn from a larger population. Dividing by n−1 (Bessel's correction) prevents systematically underestimating the true population variance.
Used only when your dataset IS the entire population, not a sample of it. No bias correction is needed because every value is already accounted for.
Standard deviation is simply the square root of variance. It is expressed in the same units as the original data, unlike variance which is in squared units — this makes standard deviation more intuitive to interpret.
A unitless, relative measure of variability — ideal for comparing spread across datasets with different scales or units.
This is a business/finance concept — percent change between two single numbers. It is unrelated to the statistical variance of a dataset in Tool 1.
A sample's mean is calculated from the same data used to measure spread, which makes squared deviations systematically smaller than the true population's. Dividing by the smaller n−1 (instead of n) inflates the result just enough to correct this bias.
Standard error builds directly on standard deviation, which comes from variance. Explore this next step with our Standard Error Calculator.
Every t-test and margin of error calculation is ultimately built on variance. See these in action with our T-Test Calculator and Margin of Error Calculator.
| Concept | Formula | Notes |
|---|---|---|
| Sample variance | Σ(x−x̄)²/(n−1) | Click to load example |
| Population variance | Σ(x−μ)²/n | Click to load example |
| Standard deviation | √variance | Same units as data |
| Coefficient of variation | (σ/μ)×100% | Click to load example |
| Variance percentage (% change) | ((new−old)/|old|)×100 | Click to load example |
| Aspect | Sample | Population |
|---|---|---|
| Denominator | n − 1 | n |
| Symbol | s² | σ² |
| Mean symbol | x̄ | μ |
| Use when | Data is a subset of a larger population | Data IS the entire population |
| Bias correction? | Yes — Bessel's correction | No correction needed |
What Is Variance?
This variance calculator computes sample variance, population variance, coefficient of variation, and variance percentage — three genuinely distinct calculations that share the word "variance" but answer very different questions. This page is the foundational statistics tool beneath our entire stats calculator suite, since variance and standard deviation feed directly into standard error, t-tests, and margin of error.
Variance measures how spread out a set of numbers is around its mean. It is calculated by finding the average of the squared differences between each data point and the mean. Variance is denoted σ² for a population or s² for a sample — the small "squared" symbol is a reminder that variance itself is expressed in squared units.
Because variance is in squared units (e.g. cm² if your data is in cm), it is not always intuitive on its own. Its square root — standard deviation — brings the measure back to the original units, which is why standard deviation is usually reported alongside, or instead of, raw variance.
This page is foundational: variance and standard deviation are the building blocks of nearly every other statistics calculator. Standard error builds directly on standard deviation, which comes from variance — explore that next step with our Standard Error Calculator, or see variance in action inside a T-Test Calculator and Margin of Error Calculator.
Sample Variance vs Population Variance — The Key Difference
This is the single most common point of confusion in introductory statistics. Both sample variance and population variance measure the same underlying idea — spread of data around a mean — but they use slightly different formulas, and choosing the wrong one is a frequent source of error.
Population Variance — Divide by n
Population variance is used when your dataset represents the entire population you care about — every single member, with nothing left out. Formula: σ² = Σ(x − μ)² / n. No correction is applied because you already have complete information; there is no estimation involved.
Sample Variance — Divide by n−1 (Bessel's Correction)
Sample variance is used when your dataset is only a sample drawn from a larger population — you don't have every value, just a subset. Formula: s² = Σ(x − x̄)² / (n−1). Notice the denominator is n−1, not n. This adjustment is called Bessel's correction.
Why n−1? The Intuition Behind Bessel's Correction
Here's the key insight: when you calculate a sample mean (x̄), you are using the very same data you'll use to measure spread. The sample mean is, by construction, the value that minimizes the sum of squared deviations for that specific sample — which means the sample's squared deviations are always a bit smaller than the true population's squared deviations would be around the true population mean (μ). In other words, samples systematically underestimate the true population variance if you divide by n.
Dividing by the smaller number n−1 instead of n makes the resulting sample variance slightly larger, which exactly corrects this downward bias on average. This makes sample variance an unbiased estimator of the true population variance — a mathematically important property.
Example — The Same Dataset, Two Different Variances
- Dataset: 4, 8, 6, 5, 3, 7 (n = 6)
- Mean: (4+8+6+5+3+7)/6 = 33/6 = 5.5
- Sum of squared deviations: Σ(x−mean)² = 17.5
- If this is a sample: s² = 17.5/(6−1) = 17.5/5 = 3.5
- If this is the entire population: σ² = 17.5/6 = 2.92
- Notice sample variance (3.5) is always larger than population variance (2.92) for the same data — this is Bessel's correction inflating the estimate to correct for bias.
How to Calculate Variance — Step-by-Step
Whether you're computing sample variance or population variance, the process follows the same four steps — only the final division differs.
- Step 1 — Find the mean. Add all data points and divide by the count: mean = Σx/n.
- Step 2 — Find the deviations. Subtract the mean from each data point: (x − mean) for every value.
- Step 3 — Square each deviation. This removes negative signs and emphasizes larger deviations: (x − mean)².
- Step 4 — Average the squared deviations. Sum them all, then divide by n (population variance) or n−1 (sample variance).
Worked Example 1 — Sample Variance
- Data (sample): 10, 12, 23, 23, 16, 23, 21, 16 (n = 8)
- Mean: (10+12+23+23+16+23+21+16)/8 = 144/8 = 18
- Squared deviations: (10−18)²=64, (12−18)²=36, (23−18)²=25×3=75, (16−18)²=4×2=8, (21−18)²=9
- Sum = 64+36+75+8+9 = 192
- Sample variance: s² = 192/(8−1) = 192/7 ≈ 27.43
- Sample standard deviation: s = √27.43 ≈ 5.24
Worked Example 2 — Population Variance
- Data (entire population): 2, 4, 4, 4, 5, 5, 7, 9 (n = 8)
- Mean: (2+4+4+4+5+5+7+9)/8 = 40/8 = 5
- Squared deviations: (2−5)²=9, (4−5)²=1×3=3, (5−5)²=0×2=0, (7−5)²=4, (9−5)²=16
- Sum = 9+3+0+4+16 = 32
- Population variance: σ² = 32/8 = 4
- Population standard deviation: σ = √4 = 2
Coefficient of Variation Explained
The coefficient of variation (CV) re-expresses standard deviation as a percentage of the mean, producing a unitless number that lets you compare variability across datasets that have completely different units or scales.
| CV Range | Interpretation |
|---|---|
| < 15% | Low variability — data clusters tightly around the mean |
| 15% – 35% | Moderate variability |
| > 35% | High variability — data widely dispersed relative to the mean |
These thresholds are a general convention, not an absolute rule — always interpret CV in the context of what's typical for your specific field or data type.
Worked Example — Comparing Two Datasets with CV
- Dataset A (weights in kg): mean = 70, standard deviation = 3.5 → CV = (3.5/70)×100 = 5% (low variability)
- Dataset B (heights in cm): mean = 170, standard deviation = 25.5 → CV = (25.5/170)×100 = 15% (borderline moderate)
- Raw standard deviations (3.5 vs 25.5) look wildly different because they're in different units — but CV reveals Dataset B is actually proportionally three times more variable relative to its own mean.
How to Calculate Variance Percentage (% Change)
In business and finance contexts, "variance" often means something entirely different from statistical variance: the percent change between two single numbers — such as a budget vs actual figure, or this year's revenue vs last year's. This is not the same as the statistical variance of a dataset covered in Tool 1 above.
Worked Example 1 — Revenue Variance
- Last year's revenue (old value): $50,000
- This year's revenue (new value): $58,000
- % variance = ((58,000 − 50,000)/|50,000|) × 100 = (8,000/50,000)×100 = +16%
- Interpretation: revenue increased by 16% year-over-year.
Worked Example 2 — Budget Variance
- Budgeted amount (old value): $120,000
- Actual spend (new value): $90,000
- % variance = ((90,000 − 120,000)/|120,000|) × 100 = (−30,000/120,000)×100 = −25%
- Interpretation: actual spend came in 25% under budget — a favorable variance in most budgeting contexts.
Variance vs Standard Deviation
Variance and standard deviation measure exactly the same underlying concept — spread of data — but express it differently:
| Aspect | Variance | Standard Deviation |
|---|---|---|
| Formula | average of squared deviations | √variance |
| Units | Squared units (e.g. cm²) | Same units as data (e.g. cm) |
| Symbol | σ² (population), s² (sample) | σ (population), s (sample) |
| Interpretability | Less intuitive (squared scale) | More intuitive — directly comparable to the data |
Because standard deviation is on the same scale as the original data, it's typically the number reported to a general audience, while variance remains essential for the underlying mathematics — including every calculation that flows from it, like standard error and confidence intervals.
Worked Examples
1. Sample Variance — Small Dataset
- Sample: 3, 6, 9, 12, 15 (n=5)
- Mean = 45/5 = 9
- Squared deviations: 36+9+0+9+36 = 90
- s² = 90/(5−1) = 90/4 = 22.5; s = √22.5 ≈ 4.74
2. Population Variance — Small Dataset
- Population: 3, 6, 9, 12, 15 (n=5, same numbers, but now treated as the full population)
- Mean = 9; sum of squared deviations = 90
- σ² = 90/5 = 18; σ = √18 ≈ 4.24
- Compare to sample variance above (22.5) — population variance is always smaller for identical data.
3. Coefficient of Variation — Comparing Test Scores Across Classes
- Class A: mean = 75, SD = 5 → CV = (5/75)×100 ≈ 6.7% (low variability, consistent performance)
- Class B: mean = 75, SD = 20 → CV = (20/75)×100 ≈ 26.7% (moderate variability — much more inconsistent, despite the identical mean)
4. Coefficient of Variation — Zero or Near-Zero Mean Caution
- Mean = 0.5, SD = 0.4 → CV = (0.4/0.5)×100 = 80%
- Note: CV becomes unstable and can be misleading when the mean is close to zero — always sanity-check CV results in this scenario.
5. Variance Percentage — Stock Price Change
- Stock price last month (old value): $45
- Stock price this month (new value): $38
- % variance = ((38−45)/45)×100 ≈ −15.56% — a decline of about 15.6%
6. Variance Percentage — Handling a Negative Old Value
- Old value: −50 (e.g. a loss of $50k)
- New value: −20 (a smaller loss of $20k)
- % variance = ((−20−(−50))/|−50|)×100 = (30/50)×100 = +60%
- Interpretation: the loss improved by 60% — always divide by the absolute value of the old figure to keep the direction of change meaningful.
Frequently Asked Questions
Related Calculators
Share This Tool
Share the Variance Calculator