Math & Statistics · Browser · Free
Variance Calculator
Population variance and sample variance calculator
Discrete random variable variance calculator
Enter probability or weight and data number in each row:
Whole population variance calculation
Population mean: μ = (Σ xᵢ) / N
Population variance: σ² = (Σ (xᵢ - μ)²) / N
Sampled data variance calculation
Sample mean: x̄ = (Σ xᵢ) / n
Sample variance: s² = (Σ (xᵢ - x̄)²) / (n - 1)
Discrete random variable variance calculation
Random variable mean: μ = E(X) = (Σ wᵢ · xᵢ) / (Σ wᵢ)
Random variable variance: σ² = Var(X) = (Σ wᵢ · (xᵢ - μ)²) / (Σ wᵢ)
Calculate the variance, standard deviation, and mean for population data, sampled data, or a discrete random variable probability distribution.
About this calculator
This page provides two calculators: a population and sample variance calculator for sets of numbers, and a discrete random variable variance calculator with a row editor for probabilities and data values.
Enter numbers separated by spaces or commas, choose Whole population data or Sampled data, and press Calculate. The variance, standard deviation, and mean appear below with step-by-step calculation formulas.
Discrete random variable variance calculator
The discrete random variable calculator lets you enter paired probability (or weight) and data number values. Use Add row to add more rows, then press Calculate to see the variance, mean, standard deviation, and complete calculation trace.
The calculation box shows the weighted mean formula μ = (Σ wᵢ·xᵢ) / (Σ wᵢ) and the weighted variance formula σ² = (Σ wᵢ·(xᵢ-μ)²) / (Σ wᵢ).
Whole population data or sampled data
Which formula is used depends on the data type you pick. With whole population data, the variance is the sum of the squared differences from the mean divided by the count of values (N). With sampled data, that same sum is divided by one less than the count of values (n - 1).
Variance formula and calculation steps
Both versions start the same way: find the mean, subtract it from each value, square the differences, and add them up. For a whole population (σ²), the sum of squared differences is divided by N. For a sample (s²), it is divided by n - 1.
The worked examples show this directly: the squared differences add to 8 for the values 1 3 5 and to 9.68 for the values 1.2, 3.4, 5.6, giving the expressions σ² = 8 / 3 ≈ 2.66666666666667, s² = 8 / 2 = 4, and s² = 9.68 / 2 = 4.84.
| Input | Result |
|---|---|
| Enter values: 1 3 5, Data type: Whole population data | Variance: 2.66666666666667; Standard deviation: 1.63299316185545; Mean: 3 |
| Enter values: 1 3 5, Data type: Sampled data | Variance: 4; Standard deviation: 2; Mean: 3 |
| Enter values: 1.2, 3.4, 5.6, Data type: Sampled data | Variance: 4.84; Standard deviation: 2.2; Mean: 3.4 |
| Enter values: -1 -3 4.5, Data type: Whole population data | Variance: 10.0555555555556; Standard deviation: 3.17104959840674; Mean: 0.166666666666667 |