How to Calculate the Standard Deviation

Calculates the mean, the variance and the standard deviation of a data set. The variance is Σ(x − mean)² ÷ count and the standard deviation is its square root (population standard deviation).

The standard deviation measures how far the values of a data set typically lie from their mean. Square each deviation from the mean, average those squares, then take the square root.

σ2=1ni=1n(xixˉ)2σ=σ2\sigma^2 = \dfrac{1}{n}\sum_{i=1}^{n} (x_i - \bar{x})^2 \qquad \sigma = \sqrt{\sigma^2}

Here σ2\sigma^2 is the variance and σ\sigma the standard deviation. The squaring stops positive and negative deviations from cancelling out; the square root brings the result back to the original units.

Example

For the data 10, 20, 30, 40, 50 the mean is 30. The deviations are 20,10,0,10,20-20, -10, 0, 10, 20, and their squares are 400,100,0,100,400400, 100, 0, 100, 400.

σ2=400+100+0+100+4005=10005=200\sigma^2 = \dfrac{400 + 100 + 0 + 100 + 400}{5} = \dfrac{1000}{5} = 200
σ=200=14.1421\sigma = \sqrt{200} = 14.1421

Watch out

This calculator returns the population standard deviation, the one that divides by nn. It describes the spread of the data you actually have.

If your data is a sample drawn from a larger population and you want to estimate that population's spread, divide by n1n - 1 instead. That is the unbiased sample variance, and it is the default in statistical inference.

Because the standard deviation carries the same units as the mean, results are often written as "mean ±\pm standard deviation". For data close to a normal distribution, about 68% of values fall within one standard deviation of the mean.