acalculator

What is the variance of my data?

Calculate variance and standard deviation, for a sample and for a whole population, as you type.

Your numbers

Read as: 1; 2; 3; 4; 5; 6; 7; 8; 9; 10
Sample variance (s²)
9.166667

For 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, the sample variance is 9.166667 (s = 3.02765) and the population variance is 8.25 (σ = 2.872281).

Sample standard deviation (s)
3.02765
Population variance (σ²)
8.25
Population standard deviation (σ)
2.872281
Mean
5.5
Sum of squares
82.5
Count
10
Sum
55

Sample variance (s²): 9.166667. For 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, the sample variance is 9.166667 (s = 3.02765) and the population variance is 8.25 (σ = 2.872281).

How are your numbers spread?

How to calculate

Computes the sample and population variance and standard deviation of a list of numbers, with the mean and the sum of squares.

Example with the default inputs (Your numbers [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]): For 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, the sample variance is 9.166667 (s = 3.02765) and the population variance is 8.25 (σ = 2.872281).

Method: s² = Σ(x − mean)² ÷ (n − 1); σ² = Σ(x − mean)² ÷ n; each standard deviation is the square root of its variance.

  • Sample variance uses Bessel’s correction (divides by n − 1). Use it when the numbers are a sample from a larger group.
  • Population variance divides by n. Use it when the numbers are the whole group.
  • The list needs at least 2 numbers, because the sample variance of one number is not defined.

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. Your numbers 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 gives Sample variance (s²) 9.166667, Sample standard deviation (s) 3.02765, Population variance (σ²) 8.25, Population standard deviation (σ) 2.872281, Mean 5.5, Sum of squares 82.5.Source: NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.6 Measures of Scale (variance, standard deviation, average absolute deviation). https://www.itl.nist.gov/div898/handbook/eda/section3/eda356.htm
  2. Your numbers 2, 4, 4, 4, 5, 5, 7, 9 gives Population variance (σ²) 4, Population standard deviation (σ) 2, Sample variance (s²) 4.571429, Sample standard deviation (s) 2.13809, Sum of squares 32.Source: NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.6 Measures of Scale (variance, standard deviation, average absolute deviation). https://www.itl.nist.gov/div898/handbook/eda/section3/eda356.htm
  3. Your numbers 5, 5, 5, 5 gives Sample variance (s²) 0, Population variance (σ²) 0, Sample standard deviation (s) 0, Population standard deviation (σ) 0.Source: NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.6 Measures of Scale (variance, standard deviation, average absolute deviation). https://www.itl.nist.gov/div898/handbook/eda/section3/eda356.htm

How it works

For a list of n numbers x₁, …, xₙ with mean x̄ = (x₁ + … + xₙ) ÷ n:

  • Sum of squares: SS = Σ(xᵢ − x̄)², the squared difference of each number from the mean, added up.
  • Sample variance: s² = SS ÷ (n − 1).
  • Sample standard deviation: s = √s².
  • Population variance: σ² = SS ÷ n.
  • Population standard deviation: σ = √σ².

The calculator also shows the mean, the count n, and the sum.

Assumptions

  • The sample figures use Bessel's correction (divide by n − 1). Use them when your numbers are a sample from a larger group. The population figures divide by n. Use them when your numbers are the whole group.
  • The list needs at least 2 numbers, because the sample variance of one number is not defined (it would divide by 0).
  • The mean is found first and the squared differences from it are added up (the two-pass method), so a large common offset in the data does not lose precision.

Worked examples by hand

1, 2, 3, 4, 5, 6, 7, 8, 9, 10 (the default list). The mean is 55 ÷ 10 = 5.5. The squared differences are 20.25, 12.25, 6.25, 2.25, 0.25, 0.25, 2.25, 6.25, 12.25, 20.25, so SS = 82.5. Sample variance = 82.5 ÷ 9 = 9.1667 (9.1666…), s = √9.1666… = 3.0277. Population variance = 82.5 ÷ 10 = 8.25, σ = √8.25 = 2.8723.

2, 4, 4, 4, 5, 5, 7, 9. The mean is 40 ÷ 8 = 5. The squared differences are 9, 1, 1, 1, 0, 0, 4, 16, so SS = 32. Population variance = 32 ÷ 8 = 4 and σ = 2. Sample variance = 32 ÷ 7 = 4.5714, s = 2.1381.

5, 5, 5, 5. Every value equals the mean, so SS = 0 and every variance and standard deviation is 0.

Other questions people ask

What is variance and why is it important?

Variance is a measure of how spread out the data points are from the mean (average). It measures the average squared distance from the mean. Low variance means data points are close to the mean, while high variance means they're more spread out. Variance is crucial for understanding data distribution and variability.

What's the difference between population variance and sample variance?

Population variance (σ²) divides by n (total count) and is used when you have data for an entire population. Sample variance (s²) divides by n-1 (count minus 1) and is used when you have a sample from a larger population. The n-1 correction (Bessel's correction) provides an unbiased estimate of the population variance.

How is variance calculated?

Variance is calculated by: 1) Finding the mean of all values, 2) Subtracting the mean from each value and squaring the differences, 3) Adding up the squared differences and dividing by n for a population or by n - 1 for a sample. For population: σ² = Σ(x - μ)²/n. For sample: s² = Σ(x - x̄)²/(n-1).

What is standard deviation and how does it relate to variance?

Standard deviation is the square root of variance. It measures the same spread as variance but in the same units as the original data. Population standard deviation = √σ², sample standard deviation = √s². Standard deviation is often preferred because it's easier to interpret.

When should I use population vs sample variance?

Use population variance when you have data for an entire population (e.g., all students in a school). Use sample variance when you have a subset of data from a larger population (e.g., 100 students from a school of 1000). In practice, sample variance is more common since we rarely have complete population data.

What does a high variance tell me about my data?

High variance indicates that data points are widely spread out from the mean, suggesting high variability or dispersion. This could mean the data is diverse, has outliers, or comes from a population with high variability. Low variance suggests data points are clustered close to the mean.

Can variance be negative?

No, variance cannot be negative. Since variance involves squaring differences from the mean, all terms in the calculation are non-negative, making the final result always positive or zero. Zero variance means all values are identical.

What is the sum of squares and why is it important?

The sum of squares (SS) is the sum of all squared differences from the mean: SS = Σ(x - x̄)². It's a key intermediate step in calculating variance and is used in many statistical tests. It measures the total squared deviation from the mean.

What's the relationship between variance and the range of data?

Both variance and range measure spread, but differently. Range is simply max - min, while variance considers all data points and their distances from the mean. Variance is more robust because it's not affected by just two extreme values like range is.

How many decimal places should I use when reporting variance?

Use 2-4 decimal places for variance, depending on your data precision and context. For most practical purposes, 2-3 decimal places are sufficient. The calculator shows up to 6 decimal places but you can round as needed for your specific use case.

What are some common applications of variance in real life?

Variance is used in quality control (measuring product consistency), finance (risk assessment), research (comparing groups), weather forecasting (temperature variability), and many other fields where understanding data spread is important.