arrow

Research Skills

What Is Standard Deviation and How Do You Calculate It?

Learn what standard deviation means and how to calculate it step by step with simple examples. Explore sample vs population formulas, the 68-95-99.7 rule, Excel calculations, and differences between variance and standard error. Understand common mistakes and how to interpret data accurately.

What Is Standard Deviation and How Do You Calculate It?

Standard deviation (SD) is a measurement of how much your numbers vary from each other. When the SD is small, most values hug the average. When it’s big, they wander all over the place.

Picture two classes that both average 70 on a test. In the first class, nobody scored below 68 or above 72. In the second, the scores swing from 50 all the way up to 90. You’d never guess that from the average alone, and that’s exactly the gap SD fills.

What Does SD Actually Measure?

Standard deviation measures, roughly, how far a typical value lands from the mean. It uses the same units as your data, which makes it easy to picture. Say adult heights in a group have an SD of 7 cm. Then most people are somewhere around 7 cm taller or shorter than average. An SD of 0? Everyone’s identical.

You’ll never see a negative SD, by the way. Distance can’t be less than zero.

Let’s put real numbers on those two classes. Class A scored 68, 70, 70 and 72. Class B scored 50, 60, 80 and 90. If we treat each class as the whole group, Class A’s SD comes out to about 1.4 points. Class B’s? Roughly 15.8. Same average, wildly different spread.

The term itself goes back a long way. Karl Pearson first used it in writing in 1894, and it’s still the measure of spread you’ll run into most.

How Do You Calculate Standard Deviation Step by Step?

You start with the mean. Then you see how far each value sits from it, square those gaps so the negatives stop cancelling out, and add them up. Divide by N if you’ve got the whole population, or by n − 1 if it’s a sample. That gives you the variance. Its square root is your SD.

It’s easier to see with an example. Imagine a bus that ran late on 8 trips, by 2, 4, 4, 4, 5, 5, 7 and 9 minutes.

  1. The mean is 40 ÷ 8, which is 5 minutes.

  2. Each trip’s distance from the mean: −3, −1, −1, −1, 0, 0, 2, 4.

  3. Square them and you get 9, 1, 1, 1, 0, 0, 4, 16. That adds up to 32.

  4. Fo32/8=4 for a population. For a sample, 32/7 is approximately 4.57.

  5. Take the square root. The population SD is 2 minutes, and the sample SD is about 2.14.

In plain terms, a typical trip ran about 2 minutes off the usual 5 minute delay.

If you prefer formulas, here they are. The Σ symbol just means “add everything up.”

Population: σ = √[ Σ(x − μ)² / N ]
Sample: s = √[ Σ(x − x̄)² / (n − 1) ]

[Add your own example here: a real dataset you’ve worked with and what its SD told you.]

Should You Use Sample or Population SD?

It comes down to what your data covers. Got every single member of the group, like all 30 students you’re grading? Use population SD and divide by N. Working with just part of a bigger group and trying to estimate its spread? Use sample SD and divide by n − 1. Most published studies report the sample version.

So why n − 1 and not just n? Your sample mean is calculated from your own data, so it naturally sits a bit closer to those values than the true mean would. That makes the gaps look slightly smaller than they really are. Dividing by n − 1 (known as Bessel’s correction) bumps the estimate back up to where it should be.

Feature 

Population SD 

Sample SD 

Symbol 

σ (sigma) 

s 

Divide by 

N 

n − 1 

Excel and Google Sheets 

STDEV.P 

STDEV.S 

Use when 

You have the whole group 

You have part of a group 

How Do You Read SD on a Bell Curve?

If your data roughly follows a bell shape, about 68% of values fall within 1 SD of the mean. Widen that to 2 SD and you catch about 95%. At 3 SD, it’s about 99.7%. That’s called the empirical rule. Not bell shaped? Chebyshev’s inequality still promises at least 75% within 2 SD and at least 89% within 3.

IQ scores are a nice real world case. Tests are commonly scaled so the mean is 100 and the SD is 15. That means around 68% of people land somewhere between 85 and 115.

What Is a Good Standard Deviation?

Honestly, there isn’t one magic number. It all depends on what you’re measuring. A factory filling bottles wants a tiny SD, because that means every bottle’s nearly the same. An investor sees a bigger SD in returns as a sign of more ups and downs, and more risk. So always compare it to something: the mean, past results, or a target.

That’s where the coefficient of variation (CV) comes in handy. You get it by dividing the SD by the mean and multiplying by 100%. An SD of 5 is huge when the mean is 10 (that’s a CV of 50%). On a mean of 1,000, it barely registers at 0.5%. One catch: CV only works for data with a true zero, like weight. It doesn’t make sense for something like temperature in Celsius.

How Is SD Different From Variance and Standard Error?

These three get mixed up all the time. Variance is just SD squared, so its units are squared too, which makes it awkward to read. Standard error (SE) is the SD divided by √n. It doesn’t describe your data’s spread at all. It tells you how precisely you’ve pinned down the mean. Altman and Bland (BMJ, 2005) pointed out how often researchers confuse the two.

Here’s how they compare using our bus example:

Measure 

What it tells you 

Formula 

Bus example 

Variance 

Spread, in squared units 

SD² 

4 minutes² 

SD 

Typical spread 

√variance 

2 minutes 

SE 

How precise the mean is 

sample SD ÷ √n 

2.14 ÷ √8 ≈ 0.76 minutes 

CV 

Spread compared to the mean 

SD ÷ mean × 100% 

2 ÷ 5 = 40% 

See how much smaller SE is? That’s why error bars showing “mean ± SE” look so much tighter than ones showing “mean ± SD.” If you’re reading a dense study and can’t tell which one the authors used, you can summarize a research paper with Canyam first and find the key numbers faster.

How Do You Calculate SD in Excel, Sheets or Python?

Spreadsheets make this quick. In Excel or Google Sheets, type =STDEV.S(A2:A31) for a sample or =STDEV.P(A2:A31) for a population. The older =STDEV function behaves like STDEV.S. Python has a sneaky trap, though. NumPy’s np.std() gives you population SD by default, but pandas’ .std() gives you sample SD. Same numbers in, two different answers out.

If you want sample SD in NumPy, write np.std(x, ddof=1).

What Mistakes Do People Make With SD?

A few slip ups come up again and again:

  • Running STDEV.P on sample data, or switching between tools without checking their defaults.

  • Reporting SE but labeling it as SD.

  • Using the 68, 95, 99.7 rule on lopsided data, like incomes or wait times.

  • Comparing SDs across different units or wildly different means, when CV would do the job better.

  • Forgetting to square the gaps. If you just add up the raw distances from the mean, you’ll always get zero.

What Are the Limits of SD?

SD has a weak spot: outliers. Because it squares every gap, one extreme value gets blown way out of proportion. For lopsided data, the median and the interquartile range (IQR) usually paint a fairer picture. The IQR covers the middle 50% of your values, so one wild number can’t drag it around.

Just look at how much damage one outlier can do. Take five salaries: 30, 32, 35, 38 and 40 thousand. The sample SD is about 4 thousand. Now change that 40 to 400. Suddenly the SD shoots up to roughly 164 thousand. Meanwhile, the median doesn’t budge from 35.

Curious how researchers in your own field deal with skewed data? Canyam’s literature help is a good place to dig into relevant studies.

Conclusion

SD takes a messy pile of numbers and gives you one honest answer about how spread out they are. Choose the right version, don’t mix it up with standard error, and check the shape of your data before you lean on the 68, 95, 99.7 rule.

Want to really lock it in? Grab a few numbers from your own life, maybe your weekly spending or how long your commute takes. Work out the standard deviation by hand once, then check your answer with =STDEV.S. Do that, and you won’t forget how standard deviation works. You’ll find more plain English guides like this on the Canyam blog.

FAQs

Can the SD be larger than the mean?

Yes, and it happens more than you’d think. It’s common in skewed data where lots of values sit near zero, like daily rainfall or small purchases. It just means the data is very spread out compared to its average.

Does a bigger sample give a smaller SD?

Not really. SD estimates how spread out the group actually is, and collecting more data doesn’t change that. What does shrink is the standard error, since a bigger sample pins down the mean more precisely.

What does “mean ± SD” mean in a research paper?

It’s a shorthand for the average plus the spread. If you see “72 ± 8 kg,” the average weight was 72 kg, and most values sat within about 8 kg of it.

How many values do you need to calculate SD?

You need at least two for a sample SD, because you divide by n − 1. Even then, a handful of values gives a pretty shaky estimate, so be careful drawing conclusions from it.

What is Canyam?

Canyam is an academic discovery platform. You can search more than 65 million research papers and read AI generated summaries that pull out the key findings, methods and citations.