Variance Calculator

A variance calculator identifies how far a set of values are spread out from their mean.

How to calculate the variance:

The variance measures the average squared deviation of each value from the mean. A higher variance means values are more spread out; a lower variance means they are clustered closer together.

Step-by-step method:

  1. List all values in the dataset
  2. Calculate the mean (average) of the values
  3. Subtract the mean from each value
  4. Square each of those differences
  5. Sum all the squared differences
  6. Divide by n for population variance, or by n−1 for sample variance

Formula:

For a dataset X = {x₁, x₂, …, xₙ} with mean μ:

Population variance:

σ² = Σ(xᵢ − μ)² / n

Sample variance:

s² = Σ(xᵢ − x̄)² / (n − 1)

Where n is the number of values, μ is the population mean, and x̄ is the sample mean.

Examples

Example 1: Dataset {2, 4, 4, 4, 5, 5, 7, 9}

  • Mean = 40 / 8 = 5
  • Squared differences: 9, 1, 1, 1, 0, 0, 4, 16 → Sum = 32
  • Population variance σ² = 32 / 8 = 4.0000
  • Sample variance s² = 32 / 7 ≈ 4.5714

Example 2: Dataset {10, 20, 30}

  • Mean = 60 / 3 = 20
  • Squared differences: 100, 0, 100 → Sum = 200
  • Population variance σ² = 200 / 3 ≈ 66.6667
  • Sample variance s² = 200 / 2 = 100.0000

Key features include:

  • Input for up to 50 values
  • Automatic calculation
  • Toggle between population and sample variance
  • Displays mean and variance together
  • Flexible list management — add or remove values freely
  • Support for decimals and negative numbers
  • Dynamic recalculation on every change