Skip to main content

Variance Calculator

Compute sample variance s² (divisor n−1) or population variance σ² (divisor n) with one click.

Written by Golam Rabbani, Founder & Lead Engineer

Formula

How to use this variance calculator

  1. Paste or type your numbers, separated by commas, spaces, or newlines.
  2. Choose Sample (divisor n − 1) or Population (divisor n) using the radio buttons.
  3. Press Calculate to get the variance, standard deviation, mean, and sum of squares.
  4. Copy the result, or switch the formula and recalculate without re-entering the data.

About this variance calculator

Variance measures how far values spread from the mean. Compute it by squaring each deviation from the mean, summing the squares (the "sum of squares", SS), then dividing — by n for the population formula σ², or by n − 1 for the sample formula s². Sample variance uses n − 1 (Bessel's correction) because the sample mean is closer to your data than the unknown population mean; dividing by n − 1 makes the estimate unbiased on average. Standard deviation is just the square root of variance.

Worked example. Enter 10, 12, 23, 23, 16, 23, 21, 16 with n = 8. Mean = 144 / 8 = 18. Squared deviations: 64, 36, 25, 25, 4, 25, 9, 4 — SS = 192. Sample variance s² = 192 / (8 − 1) = 192 / 7 ≈ 27.4286, so sample SD s ≈ 5.2372. Population variance σ² = 192 / 8 = 24, population SD σ ≈ 4.8990. Toggle the radio to see both. All computation runs locally — your data never leaves the browser.

FAQ

When do I use sample variance vs population variance?
Use sample variance (s², divisor n − 1) when your data is a sample from a larger population — almost every real-world case. Use population variance (σ², divisor n) only when the data is the entire population.
Why divide by n − 1 in the sample formula?
The sample mean is the value that minimises Σ(x − mean)². Using that mean instead of the true population mean systematically underestimates spread, and dividing by n − 1 (Bessel's correction) compensates so the expected value of s² equals the true variance.
Why is variance reported in squared units?
Squaring keeps positive and negative deviations from cancelling. To return to the original units, take the square root — that is the standard deviation.
Can variance be negative?
No. Variance is a sum of squares divided by a positive number, so it is always ≥ 0. It is exactly 0 only when every value equals the mean.
How are non-numeric tokens handled?
They are skipped, and the tool shows a warning with the count and a sample of skipped tokens.