How to use
- Type or paste your numbers, separated by commas, spaces or new lines.
- Choose A sample if your data comes from a bigger group, or The whole population if it covers every member.
- Read the standard deviation, the variance and the step-by-step working. Open the deviation table to see every value.
Formula
Population: σ = √( Σ(x − μ)² ÷ N )
Sample: s = √( Σ(x − x̄)² ÷ (n − 1) )
- Find the mean.
- Subtract the mean from each value and square the result.
- Add the squares to get the sum of squares.
- Divide by N (population) or n − 1 (sample) to get the variance.
- Take the square root.
Example
For 2, 4, 4, 4, 5, 5, 7, 9, the mean is 40 ÷ 8 = 5.
| Value | x − mean | (x − mean)² |
|---|---|---|
| 2 | −3 | 9 |
| 4 | −1 | 1 |
| 4 | −1 | 1 |
| 4 | −1 | 1 |
| 5 | 0 | 0 |
| 5 | 0 | 0 |
| 7 | 2 | 4 |
| 9 | 4 | 16 |
- Sum of squares = 32
- Population: σ = √(32 ÷ 8) = √4 = 2
- Sample: s = √(32 ÷ 7) = 2.138 (2.138089935)
For 4, 8, 15, 16, 23, 42, the mean is 18, σ = 12.3153 and s = 13.4907.
Why n − 1, and how we keep it accurate
A sample’s values sit closer to their own mean than to the true population mean, so dividing by n would underestimate the spread. Dividing by n − 1 (Bessel’s correction) fixes that on average.
We find the mean first and then sum the squared deviations (a two-pass method). This stays accurate on NIST’s hard test data, where the one-step shortcut formula breaks down.
Want the mean, median and mode as well? Use the average calculator.