Variance Calculator
Source: NIST/SEMATECH e-Handbook of Statistical Methods, section 1.3.5.6 (Measures of Scale) · Source verified August 6, 2026
A variance calculator measures how far the numbers in a data set are spread from their mean, expressed in the square of the data's units. It computes the population variance, which divides the sum of squared deviations by the count N, and the sample variance, which applies Bessel's correction by dividing by n - 1. Because variances of independent quantities add while standard deviations do not, variance is the form used inside analysis of variance, portfolio risk, and error propagation.
Enter a list of numbers and choose whether they are a sample or a whole population. This calculator returns the variance in squared units, with the formula, the substituted arithmetic, and the standard deviation that matches it.
Quick Answer
Calculate the sample or population variance for any data set. Choose which one you need, then read the variance in squared units alongside the standard deviation, mean, and count.
Is this a sample or a population?
A subset drawn from a larger group. Divides by n - 1.
Separate with commas, spaces, semicolons or new lines. Decimals and negative numbers are fine. Nothing is calculated until every entry reads as a number.
Sample variance (s²)
4.5714286
s² = 32 / 7 = 4.5714286
Variance is measured in the square of your data units. If these numbers were centimetres, this result is in square centimetres, which is why it cannot be compared directly against the values themselves. Take the square root to return to the original units: s = 2.1380899.
Deviations from the mean
Inspect a value
Choose a value to see its distance from the mean and that distance squared.
Describe this chart in words
Dot plot of 8 values on a horizontal number line, from 2 to 9. The sample mean x̄ is 5, marked with a dashed line. A hatched band spans one standard deviation either side of the mean, from 2.8619101 to 7.1380899, a width of 2.1380899 in each direction. Each value is drawn as a dot; repeated values are stacked so the count is visible. This is a picture of the entered data. It is not a distribution curve and assumes nothing about the shape of the data.
Sum of squared deviations is 32, divided by n − 1 = 7 to give a sample variance of 4.5714286 in squared units.
Show the full calculation, value by value
| Value (x) | x − x̄ | (x − x̄)² |
|---|---|---|
| 2 | -3 | 9 |
| 4 | -1 | 1 |
| 4 | -1 | 1 |
| 4 | -1 | 1 |
| 5 | 0 | 0 |
| 5 | 0 | 0 |
| 7 | 2 | 4 |
| 9 | 4 | 16 |
| Sum of squared deviations | 32 | |
| Divided by n − 1 = 7 | 4.5714286 | |
How this variance was reached
- Formula for the selected mode
- s² = Σ(xᵢ − x̄)² / (n − 1)
- Substitution
- s² = 32 / 7 = 4.5714286
- Variance and standard deviation
- Variance equals the square of the standard deviation, and the standard deviation is the square root of the variance, so the two are one measurement in two forms. For this data: s² = (2.1380899)² = 4.5714286. Neither is more correct. The standard deviation is in the units of your data, and the variance is in those units squared.
- Why variance is worth computing
- Variances of independent quantities add; standard deviations do not. That additivity is why variance is the form used inside analysis of variance, portfolio risk, and error propagation, even though standard deviation is the friendlier number to quote.
Examples
Sample of 8 values: 2, 4, 4, 4, 5, 5, 7, 9
mean 5 · sample s² ≈ 4.5714 · population σ² = 4
Sample of 8 values: 10, 12, 23, 23, 16, 23, 21, 16
mean 18 · sample s² ≈ 27.4286 · population σ² = 24
Sample of 4 values: −5, 0, 5, 10
mean 2.5 · sample s² ≈ 41.6667 · population σ² = 31.25
Every value identical: 2, 2, 2, 2
mean 2 · s² = 0 · σ² = 0
How it works
Formula · s² = Σ(xᵢ − x̄)² / (n − 1) for a sample; σ² = Σ(xᵢ − μ)² / N for a population
Variance measures spread as an average squared distance from the mean. Subtract the mean from each value, square each difference so that positives and negatives both count, add those squares, then divide. The divisor is what the sample and population choice controls.
Sample mean · x̄ = (Σxᵢ) ÷ n
Sample variance · s² = Σ(xᵢ − x̄)² ÷ (n − 1)
Population variance · σ² = Σ(xᵢ − μ)² ÷ N
The two forms use different symbols on purpose. A sample uses x̄ for its own mean and s² for its variance; a population uses μ and σ². Mixing them, for instance writing a sample variance over a population mean, is a common notation slip.
Assumptions and limits
- Every entry is treated as an independent observation of one quantity. This calculator does not weight values, group them into frequency classes, or handle paired data.
- Sample mode requires at least two values, because n − 1 would otherwise be zero. Population mode accepts a single value, whose variance is zero.
- Variance is sensitive to outliers by construction. Squaring gives a point ten units from the mean twenty five times the influence of a point two units away, so one stray value can dominate the result.
- Results are computed in IEEE 754 double precision using a two pass method with compensated summation, which stays accurate when the mean is large relative to the spread. Extremely large datasets can still differ from an exact calculation in the final digits, far below displayed precision.
- A variance is not high or low on its own. It only means something next to the scale of what you measured and a comparison point.
Related statistics calculators
- Standard deviation calculator for the same spread expressed in the original units of your data.
- Average calculator for the mean, median, mode, and range of the same list.
- Standard deviation formula for the derivation and a worked example.
- Standard error calculator for the standard error of the mean.
- Confidence interval calculator for an interval around a sample mean or proportion.
- Correlation coefficient calculator for the Pearson r between two paired variables.
Related Calculators
More tools from Education
Frequently asked questions
Sample variance divides the sum of squared deviations by n − 1, which is Bessel's correction, and is the right choice when your numbers are a subset drawn from a larger group. Population variance divides by N and is correct only when your numbers are the entire group. Most real analysis uses the sample form, so this calculator opens on Sample.
Each deviation from the mean is squared before it is added up, which removes the sign so that values above and below the mean both count as spread. The squaring is never undone, so a variance computed from centimetres is in square centimetres. Taking the square root returns you to the original units, and that square root is the standard deviation.
Nothing is calculated. The entry is named along with its position, and the result stays blank until you fix or remove it. A partial answer from a list you believe is complete is worse than no answer, so this calculator refuses to guess.
Because every value is identical, so no value deviates from the mean at all. That is a real result rather than an error. With a single value, population variance is zero and sample variance is undefined, since n − 1 would be zero.
Report standard deviation when you want a number readers can compare against the data itself, because it shares the data's units. Reach for variance when you need to combine measurements, since variances of independent quantities add and standard deviations do not.
Related calculators
Education
Standard Deviation Calculator – Variance & SD
Use this sd calculator to compute sample and population standard deviation, variance, mean, and count from a list of numbers.
Education
Average Calculator
Calculate the arithmetic mean of any list of numbers, with the median, mode, range and weighted average alongside it.
Education
Z Score Calculator
Calculate a z score from a raw score, mean, and standard deviation using z = (x − μ) / σ, with the formula, step by step work, and a plain English reading.