How to use the Variance Calculator
- 1. Paste your valuesEnter numbers separated by commas, spaces or new lines.
- 2. Pick sample or populationUse sample unless your list is the whole group.
- 3. Read the workingSee the mean, each deviation, the squares and the result.
Formula and worked example
Variance is the average squared distance from the mean. For a population: σ² = Σ(x − μ)² ÷ n. For a sample: s² = Σ(x − x̄)² ÷ (n − 1). The standard deviation is the square root of the variance and is in the same units as your data.
Worked example: 2, 4, 4, 4, 5, 5, 7, 9 has a mean of 5. The squared deviations are 9, 1, 1, 1, 0, 0, 4 and 16, which add up to 32. Population variance is 32 ÷ 8 = 4 (SD 2). Sample variance is 32 ÷ 7 = 4.5714 (SD 2.1381).
Sample or population?
Use the population formula only when your list includes every member of the group you care about, such as the marks of every student in one class when you only care about that class. In almost all data work you have a sample and want to describe a bigger group, so use n − 1. This is called Bessel's correction: the sample mean sits closer to its own data than the true mean does, so dividing by n would underestimate the spread.
- Excel: VAR.S and STDEV.S for samples; VAR.P and STDEV.P for populations.
- NumPy:
np.var(x)divides by n by default; useddof=1for samples. - pandas:
df.var()uses n − 1 by default.
Squaring makes big deviations count more, so variance is sensitive to outliers. Check for them with the outlier detector, or get the SD alone from the standard deviation calculator.
Frequently asked questions
Why is variance in squared units?
Because deviations are squared. That is why the standard deviation, its square root, is easier to interpret.
Can variance be negative?
No. It is a sum of squares, so the smallest possible value is 0, when every value is the same.
Is the Variance Calculator free?
Yes, the Variance Calculator is free. The first time you see your first result, you are asked for your name and WhatsApp number once. After that, this and every other Uncodemy tool opens straight away without the form.