How to Find Standard Deviation: Step-by-Step with Examples
Solver AI TeamPublished 12 min read
Standard deviation measures how far data typically sits from the mean. Learn the five-step method, when to divide by N or n − 1, how to handle a frequency table, and see with nine tiny samples exactly why the sample formula uses n − 1.
Frequently asked questions
What is the difference between sample and population standard deviation?
Both use the same steps, but the population version divides the sum of squared deviations by N and the sample version divides by n − 1. Use the population formula only when your data includes every member of the group you care about. When the data was picked to estimate a larger group, use the sample formula.
Why do you divide by n − 1 for a sample?
A sample sits closer to its own mean than to the true population mean, so its sum of squares comes out slightly too small. Dividing by n − 1 instead of n corrects this, so on average the sample variance equals the population variance. This adjustment is called Bessel's correction.
What is the difference between variance and standard deviation?
Variance is the average squared deviation from the mean, so it is measured in squared units such as points squared or grams squared. Standard deviation is the square root of the variance, which puts it back in the same units as the data. That is why standard deviation is easier to interpret.
Can standard deviation be negative or zero?
It can never be negative, because it is the square root of an average of squared numbers. It is zero only when every value in the data set is the same, so there is no spread at all. A negative answer always means an arithmetic slip, usually in the shortcut formula.
How do you find standard deviation from a frequency table?
Find the mean with Σfx divided by Σf. For each value, square its deviation from the mean, multiply by its frequency, and add these up. Divide by Σf for a population or Σf − 1 for a sample, then take the square root. Square the deviation before multiplying by the frequency.
To find the standard deviation, find the mean, subtract it from every value, square those deviations, add them up, divide by N (a whole population) or by n − 1 (a sample), and take the square root. The result is the typical distance of a data value from the mean, in the same units as the data.
This guide works that recipe on a plain list, a sample, and a frequency table, then shows with nine tiny samples why the sample formula divides by n − 1. If you need a refresher on the mean first, start with mean, median, mode and range.
What Standard Deviation Measures
The mean tells you where the data sits. Standard deviation tells you how spread out it is around that centre. Two classes can both average 70% on a test, yet in one class almost everybody scored between 65 and 75 while in the other the scores run from 30 to 100. The second class has a much larger standard deviation.
The Formulas: Population and Sample
Population: σ = √( Σ(x − μ)² / N ) Sample: s = √( Σ(x − x̄)² / (n − 1) ) Here μ or x̄ is the mean, N or n is the number of values, and the quantity under the root (before taking it) is the variance.
The two formulas share every step except the divisor. The top part, Σ(x − x̄)², is called the sum of squares, and you will compute it in every problem.
How to Find Standard Deviation Step by Step
Find the mean
Add the values and divide by how many there are.
Find each deviation
Subtract the mean from every value. Unless all the values are equal, some deviations are negative, and together they always add to zero.
Square each deviation
Squaring removes the signs, so values below the mean count as spread just like values above it.
Add the squares and divide
Divide the sum of squares by N for a population or n − 1 for a sample. This number is the variance.
Take the square root
Variance is in squared units (points², grams²). The square root brings you back to the units of the data.
Example 1: A whole study group (population)
The five members of a study group scored 6, 8, 9, 11, 16 on a quiz. Find the standard deviation of the group's scores.
These five people are the whole group we care about, so this is a population. Mean: μ = (6 + 8 + 9 + 11 + 16) / 5 = 50 / 5 = 10.
A typical score sits about 3.4 points from the mean of 10. Notice that the single score of 16 contributes 36 of the 58: squaring makes values far from the mean count much more than values close to it.
Sample or Population: Which Formula Do You Use?
Ask one question: is this every value I want to describe, or a handful picked from a bigger group?
Situation
Type
Divide by
Symbol
Every student in your class, and you only care about this class
Population
N
σ
30 students surveyed to learn about the whole school
Sample
n − 1
s
6 bags pulled off a production line to judge the line
Sample
n − 1
s
A textbook problem that says "sample" or asks you to estimate
Sample
n − 1
s
In statistics classes most real data is a sample, so n − 1 is the default unless the question says the data is the entire population.
Example 2: Bags of chips (sample)
A quality inspector weighs 6 bags from a production line: 28, 30, 29, 31, 33, 29 grams. Estimate the standard deviation of the bag weights.
The 6 bags stand in for thousands of others, so this is a sample. Mean: x̄ = 180 / 6 = 30 g.
Deviations: −2, 0, −1, 1, 3, −1 (they add to 0). Squares: 4, 0, 1, 1, 9, 1. Sum of squares: 16 g².
Had you divided by 6 instead, you would get √(16 / 6) ≈ 1.63 g. The gap shrinks as samples grow: s is always σ times √(n / (n − 1)), which is about 5.4% bigger at n = 10 and 2.1% bigger at n = 25.
Why Divide by n − 1 for a Sample?
Most explanations stop at "degrees of freedom". Here is a version you can check by hand. A sample's values sit closer to their own mean x̄ than to the true population mean, because x̄ was computed from those very values. So the sum of squares around x̄ comes out a little too small, and dividing by a slightly smaller number makes up for it. Another way to see it: once x̄ is fixed, only n − 1 of the deviations are free to vary, because they must add to zero. That count is the degrees of freedom.
Try it on a tiny population: {2, 4, 6}. Its mean is 4, its sum of squares is 4 + 0 + 4 = 8, so its true variance is σ² = 8 / 3 ≈ 2.67. Now list every sample of size 2 you could draw (putting the first value back before drawing the second, so there are 3 × 3 = 9 equally likely samples):
Samples
How many
Sum of squares
Divide by n = 2
Divide by n − 1 = 1
(2, 2), (4, 4), (6, 6)
3
0
0
0
(2, 4), (4, 2)
2
2
1
2
(4, 6), (6, 4)
2
2
1
2
(2, 6), (6, 2)
2
8
4
8
Average over all 9
12 / 9 ≈ 1.33
24 / 9 ≈ 2.67
Dividing by n gives an average of 1.33, only half the true 2.67. Dividing by n − 1 lands exactly on 2.67. That fix is called Bessel's correction, and on average it makes the sample variance equal the population variance.
Precisely what n − 1 fixes
The correction makes the sample variance unbiased. The square root of an unbiased variance still runs slightly low on average, so s is a small underestimate of σ. For school problems that detail rarely matters, but it's why some sites that say "n − 1 makes the standard deviation unbiased" are not quite right.
Standard Deviation from a Frequency Table
When data comes as a table of values and counts, each value appears f times, so each squared deviation is counted f times too. The steps are the same, with f multiplied in: mean = Σfx / Σf, then sum of squares = Σf(x − x̄)². Square the deviation first, then multiply by f.
Example 3: Siblings in a class (frequency table)
A class of 20 students recorded their number of siblings: 0 siblings (3 students), 1 (8), 2 (6), 3 (2), 4 (1). Find the standard deviation for this class.
The class is the whole group, so use the population formula. Σf = 3 + 8 + 6 + 2 + 1 = 20 and Σfx = 0 + 8 + 12 + 6 + 4 = 30, so μ = 30 / 20 = 1.5.
With awkward means, the shortcut formula saves work: sum of squares = Σfx² − (Σfx)² / Σf. Here Σfx² = 0 + 8 + 24 + 18 + 16 = 66, so the sum of squares is 66 − 30² / 20 = 66 − 45 = 21, the same as before. Keep full precision when you use it: rounding Σfx or the mean early can wreck the subtraction.
What a Large or Small Standard Deviation Means
A small standard deviation means the data is bunched close to the mean; a large one means it is spread out, and a single outlier can inflate it a lot. The number only means something next to its units and its mean, and it is most useful for comparing two groups measured the same way.
Example 4: Which runner is more consistent?
Two runners each record 5 lap times (seconds) from a season of training. Runner A: 62, 64, 63, 61, 65. Runner B: 58, 68, 60, 66, 63. Who is more consistent?
Both means are 315 / 5 = 63 s, so the averages can't separate them.
Runner A deviations: −1, 1, 0, −2, 2, squares add to 10. These laps are a sample of the season, so s² = 10 / 4 = 2.5 and s ≈ 1.58 s.
Runner B deviations: −5, 5, −3, 3, 0, squares add to 68. So s² = 68 / 4 = 17 and s ≈ 4.12 s.
AnswerRunner A (s ≈ 1.58 s versus 4.12 s)
Two more facts help you reason without recomputing. Adding the same number to every value shifts the mean but leaves the standard deviation unchanged: the scores in Example 1 plus 5 each (11, 13, 14, 16, 21) still have σ ≈ 3.41. Multiplying every value by a number multiplies the standard deviation by its size: doubling those scores gives σ ≈ 6.81. When data is bell-shaped, the standard deviation also sets the scale for z-scores and the normal distribution.
Common Mistakes
Common Mistake: The wrong divisor
Using N on a sample, or n − 1 on a whole population, is the most frequent error. It happens because calculators show both answers side by side. Decide sample or population before you touch a button, and write the symbol (s or σ) in your answer so the choice is visible.
Three other slips come up constantly:
Stopping at the variance. If your answer is in squared units, you forgot the square root.
Rooting too early. Taking the root of each squared deviation and then averaging gives the mean absolute deviation, a different measure. Add and divide first, then take one root at the end.
Frequency tables: multiplying before squaring.f(x − x̄)² is not (f(x − x̄))². For the 8 students with 1 sibling in Example 3, the first gives 2, the second gives 16.
How to Check Your Answer
Run these checks before you move on. Each one catches a different mistake.
Deviations add to zero. If they don't, the mean is wrong.
The answer is not negative. A standard deviation is zero only when every value is identical.
Size check. A population standard deviation can never be more than half the range. In Example 1 the range is 16 − 6 = 10, and 3.41 ≤ 5. It also sits between the smallest and largest distance from the mean (1 and 6 there).
Sample versus population. For the same numbers, s is a bit larger than σ, never smaller.
Then confirm with a calculator. On a TI-84, STAT → CALC → 1-Var Stats shows both values: Sx is the sample and σx the population standard deviation (Texas Instruments support). In Excel, STDEV.S is the sample version and STDEV.P the population one (Microsoft support). In Desmos, stdev is the sample and stdevp the population version (Desmos Help Center), which matters on the digital SAT, where Desmos is built in.
Our free standard deviation calculator shows the mean, every deviation and the variance, so you can match it line by line against your own working. If a textbook problem still won't come out, the Solver AI app on iPhone and iPad can scan it and lay out each step, which helps you find the exact line where your working went off.
Practice Problems
Work each one by hand, then check against the answers.
Find the population standard deviation of 3, 5, 7.
A sample of 5 plant heights (cm): 10, 12, 14, 16, 18. Find s.
For 2, 9, 4, 7, 8, find both σ and s, and check which is bigger.
A random sample of 20 customers rated a café from 1 to 5: rating 1 (2 people), 2 (5), 3 (8), 4 (4), 5 (1). Find the mean and the sample standard deviation.
Answers
1. Mean 5, sum of squares 8, σ = √(8 / 3) ≈ 1.63. 2. Mean 14, sum of squares 40, s = √(40 / 4) = √10 ≈ 3.16 cm. 3. Mean 6, sum of squares 34, σ = √6.8 ≈ 2.61 and s = √8.5 ≈ 2.92, so s is bigger. 4. Σfx = 57, mean 57 / 20 = 2.85; Σfx² = 183, sum of squares 183 − 57² / 20 = 20.55, s = √(20.55 / 19) ≈ 1.04.