guide

How to Calculate Variance and Standard Deviation (2026)

By Rui Barreira · Last updated: 18 June 2026

Variance and standard deviation both measure how spread out a set of numbers is around its mean. Variance gives you the average squared deviation; standard deviation is simply its square root, expressed in the original unit. Understanding both — and knowing how to calculate them — is foundational to statistics, data analysis, finance, and quality control. Use the Variance Calculator to compute both values instantly from any dataset.

The Formulas

For a dataset of n values, first find the mean (μ or x̄). Then subtract the mean from each value, square each result, and sum them all up. That sum divided by n is the population variance (σ²); divided by n − 1 it is the sample variance (s²). Standard deviation is √variance. The n − 1 denominator — known as Bessel's correction — compensates for the fact that a sample tends to underestimate the true spread of the full population. Use population formulas when you have the complete dataset; use sample formulas when your data is a subset drawn from a larger group.

Worked Example

Take the dataset {3, 7, 7, 19}. The mean is (3 + 7 + 7 + 19) ÷ 4 = 9. The squared differences are (3 − 9)² = 36, (7 − 9)² = 4, (7 − 9)² = 4, (19 − 9)² = 100. Their sum is 144.

MetricPopulation (÷ n)Sample (÷ n − 1)
Variance144 ÷ 4 = 36144 ÷ 3 = 48
Standard deviation√36 = 6√48 ≈ 6.93

The sample standard deviation is always slightly larger than the population version for the same data — by design, it provides a less biased estimate when you cannot measure the entire population.

Variance vs. Standard Deviation: Which to Report

Variance is expressed in squared units — if your original data is in kilograms, variance is in kg². That makes it hard to interpret on its own, but it is useful in formulas that combine multiple sources of uncertainty (such as portfolio risk in finance, where variances add directly). Standard deviation restores the original unit, so it is more intuitive when communicating spread to a non-technical audience. In practice: report variance when you are feeding the result into further calculations; report standard deviation when you want to describe how typical values differ from the mean.

Use the Variance Calculator to do this instantly — paste any list of numbers and get population variance, sample variance, population standard deviation, and sample standard deviation in one step.

Frequently Asked Questions

Is this tool free?
Yes — completely free, no signup required. All processing happens in your browser.
Does the tool work offline?
Once loaded, most features work without an internet connection since everything runs client-side.
More free toolsSee all 469
Merge PDFsCompress ImageJSON FormatterPassword GeneratorVAT CalculatorQR Code Generator
How to Calculate Variance and Standard Deviation (2026) | brevio