Variance Calculator
Paste a list of numbers to get the sample or population variance and standard deviation, worked out step by step. A table shows each value's deviation from the mean and its square, so you can follow (or check) the calculation by hand.
Separate numbers with commas, spaces or new lines. You can paste a column from a spreadsheet.
How to use the Variance Calculator
- Enter your numbers, separated by commas, spaces or new lines.
- Choose sample or population. Use sample if the data is a subset of a bigger group.
- Read the variance and standard deviation; the other kind is shown underneath for comparison.
- Follow the steps and the deviations table to see how the result was built.
- Copy the results or download the table as CSV.
Variance formulas
| Measure | Formula | Use when |
|---|---|---|
| Population variance | σ² = Σ(x − μ)² ÷ N | You have data for the entire group |
| Sample variance | s² = Σ(x − x̄)² ÷ (n − 1) | Your data is a sample from a larger group |
| Standard deviation | σ = √σ², s = √s² | You want the spread in the original units |
| Shortcut (computational) form | SS = Σx² − (Σx)² ÷ n | Hand calculation with sums only |
| Coefficient of variation | CV = SD ÷ |mean| × 100% | Comparing spread across different scales |
Worked example
Data: 4, 8, 6, 5, 3, 7, 9, 5 (n = 8). The mean is 47 ÷ 8 = 5.875.
| x | x − x̄ | (x − x̄)² |
|---|---|---|
| 4 | −1.875 | 3.515625 |
| 8 | 2.125 | 4.515625 |
| 6 | 0.125 | 0.015625 |
| 5 | −0.875 | 0.765625 |
| 3 | −2.875 | 8.265625 |
| 7 | 1.125 | 1.265625 |
| 9 | 3.125 | 9.765625 |
| 5 | −0.875 | 0.765625 |
| Σ = 47 | 0 | 28.875 |
Sample variance s² = 28.875 ÷ 7 = 4.125 (s ≈ 2.0310). Population variance σ² = 28.875 ÷ 8 ≈ 3.6094 (σ ≈ 1.8998).
Frequently asked questions
What is variance?
Variance measures how spread out numbers are around their mean. It is the average of the squared deviations from the mean, so it is always zero or positive and is expressed in squared units of the data. A variance of 0 means all values are identical.
What is the difference between sample and population variance?
Population variance σ² divides the sum of squared deviations by n and is used when you have every member of the group. Sample variance s² divides by n − 1 (Bessel's correction), which makes it an unbiased estimate of the population variance when you only have a sample.
How do I calculate variance by hand?
1) Find the mean. 2) Subtract the mean from each value. 3) Square each difference. 4) Add the squares to get the sum of squares. 5) Divide by n − 1 for a sample or by n for a population. For 4, 8, 6, 5, 3, 7, 9, 5 the mean is 5.875, the sum of squares is 28.875, and the sample variance is 28.875 ÷ 7 = 4.125.
How are variance and standard deviation related?
The standard deviation is the square root of the variance. It is often easier to interpret because it is in the same units as the data, while the variance is in squared units.
Why do we square the deviations?
Deviations from the mean always add up to zero, so they cannot be averaged directly. Squaring makes them all positive and gives larger deviations more weight. It also gives variance useful mathematical properties, such as adding up for independent variables.
Can variance be negative?
No. It is an average of squared numbers, so the smallest possible variance is 0. If you get a negative value, there is a calculation error, often from a shortcut formula with rounding.