What This Variance Calculator Does
Variance measures how spread out a set of numbers is around their average (mean). A small variance means the values cluster tightly near the mean; a large variance means they are scattered widely. This calculator takes a single list of comma-separated numbers and returns the mean, the variance, and the standard deviation in one step — so you can instantly judge the consistency or volatility of your data.
How to Use It
There is just one input field: Enter numbers (comma-separated). Type or paste your data points separated by commas, semicolons, spaces, or even full-width commas — for example 4, 8, 15, 16, 23, 42. The tool splits the text, converts each entry to a number, and computes:
- Mean — the arithmetic average of all values.
- Variance — the average squared deviation from the mean.
- Standard deviation — the square root of the variance, in the same units as your data.
The Formula Behind It
This calculator uses the Apache Commons Math StatUtils.variance method, which computes the sample variance (dividing by n − 1, not n). The formula is:
where \(x_i\) is each value, \(\bar{x}\) is the mean, and \(n\) is the number of values. The standard deviation is simply \(s = \sqrt{s^2}\). Using \(n - 1\) (Bessel's correction) gives an unbiased estimate of the variance for a sample drawn from a larger population.
Worked Example
Suppose you enter 2, 4, 6, 8:
- Mean = \((2 + 4 + 6 + 8) / 4 = \mathbf{5}\)
- Squared deviations: \((2-5)^2=9\), \((4-5)^2=1\), \((6-5)^2=1\), \((8-5)^2=9\) → sum = 20
- Sample variance = \(20 / (4 - 1) = \mathbf{6.667}\)
- Standard deviation = \(\sqrt{6.667} \approx \mathbf{2.582}\)
The calculator returns all three figures automatically.
Interpreting Your Variance Result
Variance measures how far the values in a data set spread out from their mean. Because every deviation is squared before averaging, the result carries squared units: if your data are lengths in centimetres, the variance is in cm²; if they are test scores, it is in "points squared". This is why the standard deviation (SD) — the square root of the variance — is usually quoted alongside it, since the SD returns to the original units of the data and can be compared directly against the mean.
The formula used here is the sample variance, which divides the sum of squared deviations by the degrees of freedom \(n-1\):
$$s^2 = \frac{1}{n-1}\sum_{i=1}^{n}\left(x_i - \bar{x}\right)^2$$What the number tells you
- Variance is never negative. Squared deviations cannot be less than zero, so \(s^2 \ge 0\) always. A variance of exactly 0 has only one meaning: every value in the set is identical, and the SD is 0 as well.
- Bigger means more spread — but only within the same units. A variance of 400 cm² is not "larger" than a variance of 9 m²; convert to a common unit first (9 m² = 90 000 cm²).
- Variance is not scale-free. Data with a large mean naturally produce larger absolute deviations. To compare the spread of data sets with different means or different units, use the coefficient of variation:
For example, the set {2, 4, 6, 8} has \(\bar{x} = 5\), \(s^2 = 6.667\) and \(s = \sqrt{6.667} \approx 2.582\), giving \(\text{CV} = 2.582 / 5 \times 100\% \approx 51.6\%\). The CV is only meaningful for ratio-scale data with a positive mean — it is not appropriate for temperatures in °C or for data centred near zero.
Variance and the shape of the data
If the data are approximately normally distributed (roughly symmetric and bell-shaped), the empirical rule — often called the 68–95–99.7 rule — gives a quick sense of scale: about 68% of values fall within \(\bar{x} \pm 1s\), about 95% within \(\bar{x} \pm 2s\), and about 99.7% within \(\bar{x} \pm 3s\). These percentages are approximations that hold only for near-normal data; for skewed or multi-modal data they can be badly misleading, and the variance alone will not reveal that — always look at the raw values or a plot as well.
Cautions
- Outliers dominate. Because deviations are squared, a single extreme value has an outsized effect. Adding one point of 100 to {2, 4, 6} pushes the sample variance from 4 to over 2300. If your result looks implausibly large, check for a typo, a unit mix-up, or a genuine extreme observation before interpreting it. Robust alternatives such as the interquartile range or the median absolute deviation are less affected.
- Small samples give unstable estimates. With \(n = 4\) or \(n = 5\), the sample variance can swing widely from one sample to the next even when the underlying process is unchanged. Treat it as a rough indication, not a precise value.
- \(n = 1\) is undefined. With a single value the denominator \(n - 1\) is zero, so the sample variance cannot be computed — a lone observation carries no information about spread.
- Sample vs population. This calculator applies the \(n-1\) divisor, which is the right choice when your numbers are a sample drawn from a larger group. If your numbers are the entire population, the population variance uses \(n\) instead and will always be somewhat smaller.
Key Terms and Symbols
| Term | Symbol | Meaning |
|---|---|---|
| Mean (sample) | \(\bar{x}\) | The arithmetic average of the sample values, \(\bar{x} = \frac{1}{n}\sum x_i\). Read as "x-bar". |
| Mean (population) | \(\mu\) | The average of every member of the population, \(\mu = \frac{1}{N}\sum x_i\). Read as "mu". |
| Sample size / population size | \(n\) / \(N\) | Count of values used. Lower-case \(n\) conventionally denotes a sample, capital \(N\) the whole population. |
| Deviation | \(x_i - \bar{x}\) | How far one value sits from the mean. Positive above the mean, negative below. Deviations always sum to zero, which is why they are squared before averaging. |
| Squared deviation | \((x_i - \bar{x})^2\) | The deviation multiplied by itself — removes the sign and amplifies large gaps. |
| Sum of squares | SS | The total of all squared deviations, \(SS = \sum_{i=1}^{n}(x_i - \bar{x})^2\). The numerator of every variance formula. |
| Sample variance | \(s^2\) | \(s^2 = \dfrac{SS}{n-1}\) — the unbiased estimate of the population variance from a sample. This is what this calculator returns. |
| Population variance | \(\sigma^2\) | \(\sigma^2 = \dfrac{1}{N}\sum (x_i - \mu)^2\) — used when the data cover the entire population. Read as "sigma squared". |
| Degrees of freedom | \(df = n-1\) | The number of deviations free to vary once the mean is fixed; knowing the mean and \(n-1\) deviations determines the last one. |
| Bessel's correction | dividing by \(n-1\) | The adjustment that replaces \(n\) with \(n-1\). Without it, sample variance systematically underestimates the population variance, because deviations are measured from the sample's own mean. |
| Standard deviation | \(s\) / \(\sigma\) | The square root of the variance, expressed in the same units as the data: \(s = \sqrt{s^2}\). |
| Coefficient of variation | CV | Relative spread, \(CV = s / \bar{x}\), usually shown as a percentage. Dimensionless, so it compares data sets with different units or magnitudes. |
| Range | — | Maximum minus minimum. A crude spread measure that uses only two values and ignores everything in between. |
| Outlier | — | A value far removed from the rest of the data. Because deviations are squared, outliers inflate the variance disproportionately. |
Units note: variance is always expressed in the square of the data's units — seconds of data give s², kilograms give kg², currency amounts give "currency squared", which has no everyday meaning. That is the practical reason most reports quote the standard deviation rather than the variance itself.
Conventions and edge cases
Each case below was run through this calculator; the result column is what it actually returns.
| Case | Input | Result |
|---|---|---|
| Decimals 0.1, 0.2, 0.3 | 0.1, 0.2, 0.3 | 0.01 |
| Even number of values (1, 2, 3, 4) | 1, 2, 3, 4 | 1.6667 |
| Negative values (−3, −1, 4) | -3, -1, 4 | 13 |
| A zero in the list (0, 4, 9) | 0, 4, 9 | 20.3333 |
| Sample or population (2, 4, 4, 4, 5, 5, 7, 9) | 2, 4, 4, 4, 5, 5, 7, 9 | 4.5714 |
| A single value | 7 | A sample variance needs at least 2 values. |
Checked on 2026-11-08
Frequently Asked Questions
Does this use sample or population variance? It computes sample variance, dividing by n − 1. This is the standard choice when your numbers represent a sample rather than an entire population.
What separators can I use? Commas, semicolons, spaces, and full-width Asian-style commas all work, so messy pasted data is usually parsed correctly.
Why is standard deviation also shown? Standard deviation is easier to interpret because it shares the same units as your original data, while variance is in squared units.