Mathematics & Statistics

Standard Deviation & Variance Calculator

Sample and population standard deviation, variance, coefficient of variation and standard error of a data list.

Inputs

Bell curve with the band within one standard deviation of the mean shaded dark and the band within two standard deviations shaded light, labelled 68% and 95%.−2s−1s+1s+2sx̄≈ 68%≈ 95% within ±2s
The standard deviation measures the spread around the mean x̄. For normally distributed data about 68% of values lie within ±1 s and about 95% within ±2 s. Diagram not to scale.

Separate the numbers with commas, spaces or semicolons (up to 5000 values). Use a dot for decimals.

Result

Standard deviation
2.138089935
Variance
4.571428571
Mean x̄
5
Count n
8values
Standard deviation on the other basis
Population σ = 2 (divide by n)
Coefficient of variation (sd ÷ |mean|)
42.7618%
Standard error of the mean (s ÷ √n)
0.755928946
Sum of squared deviations Σ(x − x̄)²
32
Working
Mean x̄ = 40 ÷ 8 = 5 Σ(x − x̄)² = 32 Variance = 32 ÷ (8 − 1) = 4.571428571 Standard deviation = √4.571428571 = 2.138089935

The sample standard deviation is 2.138089935 (variance 4.571428571) around a mean of 5.

Educational estimate — check the assumptions below.

About this calculator

The standard deviation measures how far the values typically lie from their mean; the variance is its square. Use the sample formula (divide by n − 1) when the data are a sample used to estimate a larger population — for example 30 parts measured from a production run. Use the population formula (divide by n) only when the list contains every member of the population.

Formula

x̄ = Σxi ÷ n

Sample: s² = Σ(xi − x̄)² ÷ (n − 1)    Population: σ² = Σ(xi − x̄)² ÷ n

CV = s ÷ |x̄| × 100%    SE = s ÷ √n

The standard deviation is the square root of the variance. The calculation subtracts the mean first (two-pass method), which avoids the loss of precision of the “sum of squares minus square of sum” shortcut.

Worked example

Data: 2, 4, 4, 4, 5, 5, 7, 9 (n = 8).

  • Mean = 40 ÷ 8 = 5
  • Squared deviations: 9, 1, 1, 1, 0, 0, 4, 16 → Σ = 32
  • Population: σ² = 32 ÷ 8 = 4, σ = 2
  • Sample: s² = 32 ÷ 7 = 4.5714, s = 2.138

Assumptions and limitations

  • The standard error of the mean always uses the sample standard deviation s, because it estimates the uncertainty of the mean.
  • Values are separated by commas, spaces or semicolons; use a dot for decimals.
  • Results are shown to 10 significant figures.

References

  • NIST/SEMATECH e-Handbook of Statistical Methods, section 1.3.5.6 (measures of scale).
  • Montgomery, D. C. & Runger, G. C. Applied Statistics and Probability for Engineers.