Introduction

In this article, we'll learn how to calculate standard deviation "by hand".
Interestingly, in the real world no statistician would ever calculate standard deviation by hand. The calculations involved are somewhat complex, and the risk of making a mistake is high. Also, calculating by hand is slow. Very slow. This is why statisticians rely on spreadsheets and computer programs to crunch their numbers.
So what's the point of this article? Why are we taking time to learn a process statisticians don't actually use? The answer is that learning to do the calculations by hand will give us insight into how standard deviation really works. This insight is valuable. Instead of viewing standard deviation as some magical number our spreadsheet or computer program gives us, we'll be able to explain where that number comes from.

Overview of how to calculate standard deviation

The formula for standard deviation (SD) is
SD=xμ2N\Large\text{SD} = \sqrt{\dfrac{\sum\limits_{}^{}{{\lvert x-\mu\rvert^2}}}{N}}
where \sum means "sum of", xx is a value in the data set, μ\mu is the mean of the data set, and NN is the number of data points in the population.
The standard deviation formula may look confusing, but it will make sense after we break it down. In the coming sections, we'll walk through a step-by-step interactive example. Here's a quick preview of the steps we're about to follow:
Step 1: Find the mean.
Step 2: For each data point, find the square of its distance to the mean.
Step 3: Sum the values from Step 2.
Step 4: Divide by the number of data points.
Step 5: Take the square root.

An important note

The formula above is for finding the standard deviation of a population. If you're dealing with a sample, you'll want to use a slightly different formula (below), which uses n1n-1 instead of NN. The point of this article, however, is to familiarize you with the the process of computing standard deviation, which is basically the same no matter which formula you use.
SDsample=xxˉ2n1\text{SD}_\text{sample} = \sqrt{\dfrac{\sum\limits_{}^{}{{\lvert x-\bar{x}\rvert^2}}}{n-1}}
That's a great question, but it is difficult to answer succinctly. We have a lot of videos and simulations on this topic—it's fairly complex and quite interesting.
If you want to learn about the distinction between population and sample standard deviation, and why they're not calculated the same way, you should head to the lesson on sample variance and standard deviation.
Onward!

Step-by-step interactive example for calculating standard deviation

First, we need a data set to work with. Let's pick something small so we don't get overwhelmed by the number of data points. Here's a good one:
6,2,3,16, 2, 3, 1

Step 1: Finding μ\goldD{\mu} in xμ2N\sqrt{\dfrac{\sum\limits_{}^{}{{\lvert x-\goldD{\mu}\rvert^2}}}{N}}

In this step, we find the mean of the data set, which is represented by the variable μ\mu.
Fill in the blank.
μ=\mu =
μ=6+2+3+14=124=3\mu = \dfrac{6+2 + 3 + 1}{4} = \dfrac{12}{4} = \blueD3

Step 2: Finding xμ2\goldD{\lvert x - \mu \rvert^2} in xμ2N\sqrt{\dfrac{\sum\limits_{}^{}{\goldD{{\lvert x-\mu}\rvert^2}}}{N}}

In this step, we find the distance from each data point to the mean (i.e., the deviations) and square each of those distances.
For example, the first data point is 66 and the mean is 33, so the distance between them is 33. Squaring this distance gives us 99.
Complete the table below.
Data point xxSquare of the distance from the mean xμ2\lvert x - \mu \rvert^2
6699
22
33
11
Data point xxDistance from the mean squared xμ2\lvert x - \mu \rvert^2
66632=32=9\lvert6-\blueD{3}\rvert^2 = 3^2 = 9
22232=12=1\lvert2-\blueD{3}\rvert^2 = 1^2 = 1
33332=02=0\lvert3-\blueD{3}\rvert^2 = 0^2 = 0
11132=22=4\lvert1-\blueD{3}\rvert^2 = 2^2 = 4

Step 3: Finding xμ2\goldD{\sum\lvert x - \mu \rvert^2} in xμ2N\sqrt{\dfrac{\goldD{\sum\limits_{}^{}{{\lvert x-\mu}\rvert^2}}}{N}}

The symbol \sum means "sum", so in this step we add up the four values we found in Step 2.
Fill in the blank.
xμ2=\sum\lvert x - \mu \rvert^2 =
Add up all of the squared distances from the data points to the mean from Step 2:
xμ2=9+1+0+4=14\sum\lvert x - \mu \rvert^2 = 9 + 1 + 0 + 4 = 14

Step 4: Finding xμ2N\goldD{\dfrac{\sum\lvert x - \mu \rvert^2}{N}} in xμ2N\sqrt{\goldD{\dfrac{\sum\limits_{}^{}{{\lvert x-\mu}\rvert^2}}{N}}}

In this step, we divide our result from Step 3 by the variable NN, which is the number of data points.
Fill in the blank.
xμ2N=\dfrac{\sum\lvert x - \mu \rvert^2}{N} =
Divide the sum from Step 3 by the number of data points (N=4)( N =4):
xμ2N=144=3.5\dfrac{\sum\lvert x - \mu \rvert^2}{N} =\dfrac{{14}}4 = {3.5}

Step 5: Finding the standard deviation xμ2N\sqrt{\dfrac{\sum\limits_{}^{}{{\lvert x-\mu\rvert^2}}}{N}}

We're almost finished! Just take the square root of the answer from Step 4 and we're done.
Fill in the blank.
Round your answer to the nearest hundredth.
SD=xμ2N\text{SD} = \sqrt{\dfrac{\sum\limits_{}^{}{{\lvert x-\mu\rvert^2}}}{N}} \approx
Take the square root of the number we found in Step 4:
xμ2N=3.51.87\sqrt{\dfrac{\sum\limits_{}^{}{{\lvert x-\mu\rvert^2}}}{N}} = \sqrt{{3.5}} \approx 1.87
The standard deviation is 1.871.87.
Yes! We did it! We successfully calculated the standard deviation of a small data set.

Summary of what we did

We broke down the formula into five steps:
Step 1: Find the mean μ\mu.
μ=6+2+3+14=124=3\mu = \dfrac{6+2 + 3 + 1}{4} = \dfrac{12}{4} = \blueD3
Step 2: Find the square of the distance from each data point to the mean xμ2\lvert x-\mu\rvert^2.
xxxμ2\lvert x - \mu \rvert^2
66632=32=9\lvert6-\blueD{3}\rvert^2 = 3^2 = 9
22232=12=1\lvert2-\blueD{3}\rvert^2 = 1^2 = 1
33332=02=0\lvert3-\blueD{3}\rvert^2 = 0^2 = 0
11132=22=4\lvert1-\blueD{3}\rvert^2 = 2^2 = 4
Steps 3, 4, and 5:
SD=xμ2N=9+1+0+44=144        Sum the squares of the distances (Step 3).=3.5        Divide by the number of data points (Step 4).1.87        Take the square root (Step 5).\begin{aligned} \text{SD} &= \sqrt{\dfrac{\sum\limits_{}^{}{{\lvert x-\mu\rvert^2}}}{N}}\\\\\\\\ &= \sqrt{\dfrac{9 + 1 + 0 + 4}{4}} \\\\\\\\ &= \sqrt{\dfrac{{14}}{4}} ~~~~~~~~\small \text{Sum the squares of the distances (Step 3).} \\\\\\\\ &= \sqrt{{3.5}} ~~~~~~~~\small \text{Divide by the number of data points (Step 4).} \\\\\\\\ &\approx 1.87 ~~~~~~~~\small \text{Take the square root (Step 5).} \end{aligned}

Try it yourself

Here's a reminder of the formula:
SD=xμ2N\Large\text{SD} = \sqrt{\dfrac{\sum\limits_{}^{}{{\lvert x-\mu\rvert^2}}}{N}}
And here's a data set:
1,4,7,2,61, 4, 7, 2,6
Find the standard deviation of the data set.
Round your answer to the nearest hundredth.
SD=\text{SD}=

Find the mean

μ=1+4+7+2+65=205=4\mu = \dfrac{1 + 4 + 7 + 2 + 6}{5} = \dfrac{20}{5} = \blueD4

Find the square of the distances from each of the data points to the mean

xxxμ2\lvert x - \mu \rvert^2
11142=32=9\lvert1-\blueD{4}\rvert^2 = 3^2 = 9
44442=02=0\lvert4-\blueD{4}\rvert^2 = 0^2 = 0
77742=32=9\lvert7-\blueD{4}\rvert^2 = 3^2 = 9
22242=22=4\lvert2-\blueD{4}\rvert^2 = 2^2 = 4
66642=22=4\lvert6-\blueD{4}\rvert^2 = 2^2 = 4

Apply the formula

SD=xμ2N=9+0+9+4+45=265=5.22.28\begin{aligned} \text{SD} &= \sqrt{\dfrac{\sum\limits_{}^{}{{\lvert x-\mu\rvert^2}}}{N}} \\\\\\\\ &= \sqrt{\dfrac{9 + 0 + 9 + 4 + 4}{5}} \\\\\\\\ &= \sqrt{\dfrac{26}{5}}\\\\\\\\ &= \sqrt{5.2}\\\\\\\\ &\approx 2.28\end{aligned}

The answer

The standard deviation is approximately 2.282.28.