Variance and Standard Deviation Calculator
Calculate variance and standard deviation from a comma-separated list of numbers. Switch between sample and population formulas.
Inputs
Results
Definition
Variance is the average of the squared deviations of a set of values from their mean. Standard deviation is the square root of the variance, which returns the measure of spread to the same units as the original data. Both quantify how widely a dataset is dispersed around its center: a small value means the data points cluster tightly around the mean, and a large value means they are spread out.
The two measures come in two forms — population and sample — which differ only in their divisor. Population formulas divide by the count n; sample formulas divide by n−1, applying Bessel's correction to compensate for estimating the spread from a subset rather than the whole group.
Components of the Calculation
A full variance computation reports several intermediate quantities:
- Count (n) — the number of values in the dataset
- Mean (x̄) — the arithmetic average
- Sum of squared deviations (SS) — the shared numerator Σ(xᵢ − x̄)²
- Variance — SS ÷ (n−1) for a sample, or SS ÷ n for a population
- Standard deviation — the square root of the variance
The worked example below follows the default dataset 4, 8, 15, 16, 23, 42.
Core Formulas
Mean
Sum of Squared Deviations
SS is the building block of both variance formulas. It measures the total spread of the data around the mean.
Population Variance and Standard Deviation
Sample Variance and Standard Deviation
Worked Example: 4, 8, 15, 16, 23, 42
Step 1 — Compute the mean.
Step 2 — Compute the squared deviations.
| xᵢ | xᵢ − x̄ | (xᵢ − x̄)² |
|---|---|---|
| 4 | −14 | 196 |
| 8 | −10 | 100 |
| 15 | −3 | 9 |
| 16 | −2 | 4 |
| 23 | +5 | 25 |
| 42 | +24 | 576 |
| SS | 910 |
Step 3a — Sample statistics (n = 6).
Step 3b — Population statistics (n = 6).
Bessel's Correction
When variance is calculated from a sample, the sample mean x̄ is computed from the same data being measured. The sample values inevitably cluster closer to x̄ than they do to the true (unknown) population mean μ. As a result, dividing by n underestimates how spread out the population really is.
Replacing n with n−1 inflates the estimate just enough to make it unbiased — on average across all possible samples, s² equals σ². The "missing" degree of freedom reflects the fact that once x̄ and n−1 of the values are known, the last value is determined; it carries no new spread information.
As an illustration, consider drawing thousands of samples of size 2 from a population with σ² = 100. The average of all SS/n estimates hovers around 50, but the average of all SS/(n−1) estimates is close to 100. The correction matters most for small n; as n grows large, n−1 ≈ n and the two formulas converge.
Population and Sample Variance
| Scenario | Use |
|---|---|
| Data covers every member of the group | Population (÷ n) |
| Data is a subset drawn from a larger group | Sample (÷ n−1) |
| n is very large (thousands+) | Either — they converge |
Population examples: All five test scores of a specific student over a semester; the exact lap times of a single race car driver in last Sunday's race.
Sample examples: Heights of 50 randomly selected adults estimating the variance for all adults in a country; quality measurements on 30 items from a production run of 10,000.
When the classification is ambiguous, sample variance is the conservative choice, because it acknowledges uncertainty about the full population.
Interpreting Standard Deviation
Standard deviation (σ or s) is the most intuitive measure of spread because it is expressed in the same units as the original data. If test scores have s = 8, then most scores fall within about 8 points of the mean.
For a normal distribution, these empirical rules hold:
| Range | Contains roughly |
|---|---|
| μ ± 1σ | 68% of values |
| μ ± 2σ | 95% of values |
| μ ± 3σ | 99.7% of values |
These rules are approximate for non-normal data, but they remain a useful check. A value more than 2σ from the mean is a candidate for investigation as a possible outlier.
Units of Variance and Standard Deviation
Variance is measured in squared units of the original data. Heights in centimeters produce variance in cm²; money in dollars produces variance in dollars². Squared units make variance awkward to interpret directly — a variance of 2500 cm² is difficult to relate to the original measurements.
Standard deviation resolves this by taking the square root, returning the measure to the original unit. For this reason standard deviation is the quantity reported in most practical contexts — weather forecasts, investment returns, and quality control — while variance typically remains an intermediate step.
Frequently Asked Questions (FAQ)
Should I use sample or population variance?
Use sample variance (divides by n−1) when your data is a subset drawn from a larger group and you want to estimate the variance of that group. For example, if you measured the heights of 30 students from a school of 500, use sample variance. Use population variance (divides by n) only when your dataset contains every member of the group — for example, the scores of all five players on a basketball team.
Why does sample variance divide by n−1 instead of n?
Dividing by n systematically underestimates the true population variance because a sample's values tend to cluster closer to the sample mean than to the true population mean. Dividing by n−1 (Bessel's correction) inflates the estimate just enough to make it unbiased on average. The extra subtracted degree of freedom accounts for the fact that one piece of information — the sample mean — was estimated from the same data.
What units does variance have?
Variance is measured in the square of your original units. If your data is in meters, variance is in m². If your data is in dollars, variance is in dollars². This squared unit is why standard deviation (the square root of variance) is often easier to interpret — it has the same unit as the original data. For example, if test scores have a standard deviation of 8 points, most scores lie within 8 points of the mean.
How does standard deviation relate to z-scores?
A z-score measures how many standard deviations a value is above or below the mean: z = (x − μ) / σ. Standard deviation is the ruler you use to express that distance. A z-score of 1 means the value is exactly one standard deviation above the mean; a z-score of −2 means it is two standard deviations below. In a normal distribution, about 68% of values fall within one standard deviation of the mean, and about 95% within two.
Recommended Next
Descriptive Statistics Calculator
Calculate mean, standard deviation, variance, range, min, and max for 8 data values. Shows both population and sample statistics.