Standard deviation, explained visually

Standard deviation measures how spread out numbers are: roughly, how far a typical value sits from the mean. Square each value's distance from the mean, average the squares, then take the square root. For 4, 6, 7, 8 and 10 the mean is 7 and the standard deviation is 2. For a sample, divide by n − 1 instead of n.

σ=∑(x−μ)2N\sigma = \sqrt{\frac{\sum (x - \mu)^2}{N}}

The standard deviation σ is the square root of the average squared distance from the mean μ: add the squared deviations and divide by N, the number of values. For a sample, subtract the sample mean x̄ and divide by n − 1 instead.

Updated

Two dot plots on number lines from 2 to 18, each with a dashed line at the mean of 10. Class A has twelve blue dots stacked between 8 and 12, a narrow shaded band from 9 to 11 and an arrow labeled σ = 1. Class B has twelve purple dots spread from 4 to 16, a wide shaded band from 6 to 14 and an arrow labeled σ = 4.
Two classes' scores on the same quiz, both with a mean of 10. Class A's scores bunch near 10, so its standard deviation is 1. Class B's spread from 4 to 16, so its standard deviation is 4. The shaded band reaches one standard deviation either side of the mean.

Key ideas

  1. 01

    Standard deviation measures spread: roughly how far a typical value lies from the mean. A small standard deviation means the values cluster near the mean; a large one means they are scattered.

  2. 02

    To find a standard deviation, subtract the mean from each value, square the results, average the squares and take the square root. The average of the squares is the variance.

  3. 03

    Deviations from the mean always add up to zero, so they are squared before averaging. The square root at the end returns the answer to the data's own units.

  4. 04

    Use the population formula (σ, divide by N) when the data is the whole group, and the sample formula (s, divide by n − 1) when it is a sample from a larger group.

  5. 05

    Variance is the standard deviation squared. If heights have a standard deviation of 7 cm, their variance is 49 cm².

  6. 06

    In bell-shaped data, about 68% of values lie within one standard deviation of the mean, about 95% within two and about 99.7% within three.

  7. 07

    Standard deviation is never negative, and it is 0 only when every value is the same. Adding 10 to every value leaves it unchanged; multiplying every value by 3 triples it.

What is standard deviation?

Standard deviation measures how spread out a set of numbers is around its mean. Roughly, it is the typical distance between a value and the mean, in the same units as the data. A small standard deviation means most values sit close to the mean; a large one means they are scattered far from it.

Two classes take the same quiz and both average 10 points. In class A, 10 of the 12 students score 9, 10 or 11. In class B, scores run from 4 to 16. The mean can't tell the two classes apart, but the standard deviation can: 1 point for class A and 4 points for class B, treating each class as the whole group.

Two classes with the same mean quiz score and different standard deviations
ClassScoresMeanStandard deviation
A8, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 12101
B4, 5, 6, 7, 7, 9, 11, 13, 13, 14, 15, 16104
  • A standard deviation of 0 means every value is identical: there is no spread at all.
  • A small standard deviation means the values crowd close to the mean, so the mean describes them well.
  • A large standard deviation means the values are scattered, and many sit far from the mean.

A standard deviation is a distance, so it is never negative and it is measured in the same units as the data: points, centimeters, hours.

What is the standard deviation formula?

The standard deviation formula takes the square root of the average squared distance from the mean. It comes in two versions: the population formula divides by NN, the number of values, and is for data that includes every member of the group; the sample formula divides by n−1n - 1 and is for data sampled from a larger group.

σ=∑(x−μ)2N\sigma = \sqrt{\frac{\sum (x - \mu)^2}{N}}

Population standard deviation: for every value x, square its difference from the population mean mu; add up those squares, divide by N, the number of values, and take the square root. The result is sigma.

s=∑(x−xˉ)2n−1s = \sqrt{\frac{\sum (x - \bar{x})^2}{n - 1}}

Sample standard deviation: for every value x, square its difference from the sample mean x-bar; add up those squares, divide by n minus 1, and take the square root. The result is s.

What each symbol in the standard deviation formulas means
SymbolRead asMeaning
σ\sigmasigmastandard deviation of a population
sssstandard deviation of a sample
μ\mumumean of a population
xˉ\bar{x}x-barmean of a sample
xxxeach value in the data
NN or nnN or nhow many values there are
∑\sumthe sum ofadd up the expression for every value
σ2\sigma^2 or s2s^2sigma squared or s squaredthe variance: the standard deviation squared

The two formulas differ in only two places: the mean you subtract (μ\mu or xˉ\bar{x}) and the number you divide by (NN or n−1n - 1).

How do you calculate standard deviation?

To calculate a standard deviation, find the mean, measure how far each value is from it, square those distances, average the squares and take the square root. Here are the steps for five plant heights, 4, 6, 7, 8 and 10 cm, treated as the whole population.

  1. 1Find the mean. Add the values and divide by how many there are: μ=4+6+7+8+105=355=7\mu = \frac{4 + 6 + 7 + 8 + 10}{5} = \frac{35}{5} = 7.
  2. 2Find each deviation. Subtract the mean from each value: −3,−1,0,1,3-3, -1, 0, 1, 3. The deviations add up to 0, which checks the mean.
  3. 3Square each deviation: 9,1,0,1,99, 1, 0, 1, 9.
  4. 4Add the squares: 9+1+0+1+9=209 + 1 + 0 + 1 + 9 = 20.
  5. 5Divide by the number of values to get the variance: σ2=205=4\sigma^2 = \frac{20}{5} = 4. For a sample, divide by n−1=4n - 1 = 4 instead.
  6. 6Take the square root: σ=4=2\sigma = \sqrt{4} = 2 cm.
Deviations and squared deviations for 4, 6, 7, 8 and 10 (mean 7)
Value xDeviation x − 7Squared deviation (x − 7)²
4−39
6−11
700
811
1039
Total: 35020

The standard deviation of 4, 6, 7, 8 and 10 is 2: a typical plant is about 2 cm taller or shorter than the mean height of 7 cm.

Why do we square the deviations?

The deviations in a standard deviation are squared because plain deviations always add up to zero, so their average is zero for every data set, however spread out. The mean is the balance point of the data: the distances below it exactly cancel the distances above it.

A number line from 3 to 11 with a dashed line at the mean, 7. Five blue dots, one per row, sit at 4, 6, 7, 8 and 10. Amber arrows run from the mean to each dot and are labeled −3, −1, +1 and +3, with 0 beside the dot at 7. A green line below reads −3 − 1 + 0 + 1 + 3 = 0.
The deviations of 4, 6, 7, 8 and 10 from their mean, 7. The arrows to the left (−3 and −1) exactly cancel the arrows to the right (+1 and +3), so the deviations add up to 0.
∑(x−xˉ)=0\sum (x - \bar{x}) = 0

The deviations from the mean always add up to zero.

Squaring fixes this. Every square is positive, so values below the mean can no longer cancel values above it. The average of the squares is the variance, and taking its square root brings the answer back to the data's own units.

A row of amber squares built on the deviations: sides 3 and 1, a dot for the deviation of 0, then sides 1 and 3. They are labeled with their areas 9, 1, 0, 1 and 9, with (−3)², (−1)², 0², 1² and 3² beneath them, and 9 + 1 + 0 + 1 + 9 = 20 above. To the right, a green square of area 4, labeled 20 ÷ 5 = 4 above and σ = √4 = 2 below.
Each deviation drawn as a square: areas 9, 1, 0, 1 and 9, which add up to 20. Their average area, 20 ÷ 5 = 4, is the variance, and the side of a square with that area, 2, is the standard deviation.

You could average the distances without their signs instead. That gives the mean absolute deviation, 1.6 for this data. Squares are the standard because they make the rest of statistics work: the variances of independent quantities add up, and the bell-shaped normal distribution is described by its mean and standard deviation. Squaring also gives large deviations more weight than small ones.

Sample vs population standard deviation: when do you use n − 1?

Use the population standard deviation, dividing by NN, when your data includes every member of the group you are describing. Use the sample standard deviation, dividing by n−1n - 1, when your data is a sample and you want the spread of the larger group it came from.

Why n−1n - 1? A sample's values sit closer to their own mean xˉ\bar{x} than to the true population mean μ\mu, because xˉ\bar{x} is calculated from those very values. So the squared deviations from xˉ\bar{x} come out a little too small, and dividing by nn would underestimate the spread. Dividing by the smaller number n−1n - 1 corrects this, so that the sample variance s2s^2 is right on average. The adjustment is called Bessel's correction.

Population and sample standard deviation side by side
PopulationSample
Dataevery member of the groupsome members, drawn from a larger group
Symbolσ\sigmass
Mean subtractedμ\muxˉ\bar{x}
Divide byNNn−1n - 1
For 4, 6, 7, 8, 1020/5=2\sqrt{20 / 5} = 220/4≈2.24\sqrt{20 / 4} \approx 2.24
TI-84 (1-Var Stats)σxSx
Excel and Google SheetsSTDEV.PSTDEV.S

If a problem calls the data a sample, or asks you to estimate the spread of a larger group, divide by n−1n - 1. If the data is the whole group, divide by NN.

What is the difference between variance and standard deviation?

Variance is the average squared deviation from the mean, and standard deviation is the square root of the variance. They carry the same information, but the standard deviation is in the same units as the data, so it is the one you can read directly. The variance is the step the calculation passes through, and the quantity statisticians work with when they combine spreads.

Variance and standard deviation compared
VarianceStandard deviation
Symbolσ2\sigma^2 or s2s^2σ\sigma or ss
What it isaverage squared deviationsquare root of the variance
Units, for heights in cmcm²cm
For 4, 6, 7, 8, 1042
To get the other onetake the square rootsquare it

So a standard deviation of 7 cm means a variance of 49 cm², and a variance of 2.25 means a standard deviation of 2.25=1.5\sqrt{2.25} = 1.5.

What does one standard deviation from the mean tell you?

One standard deviation either side of the mean marks the range where most values fall: in bell-shaped data, about 68% of values lie within one standard deviation of the mean, about 95% within two and about 99.7% within three. This is the 68–95–99.7 rule, also called the empirical rule, and it holds for every normal distribution.

A blue bell curve over an axis marked μ − 3σ through μ + 3σ. The area under it is shaded amber in bands: darkest within one standard deviation of μ, labeled 34.1% on each side, then 13.6% on each side between one and two, then 2.1% between two and three. Brackets above the curve span ±1σ, ±2σ and ±3σ, labeled 68%, 95% and 99.7%.
A normal distribution marked in standard deviations from the mean μ. Each shaded band is labeled with the share of values it holds: 34.1% on each side within one standard deviation, 13.6% between one and two, and 2.1% between two and three.

Scores on most modern IQ tests, for example, are scaled to a mean of 100 and a standard deviation of 15. So about 68% of people score between 85 and 115, about 95% score between 70 and 130, and a score of 115, one standard deviation above the mean, sits at about the 84th percentile.

Share of a normal distribution within k standard deviations of the mean
WithinShare of valuesPercentile of the mean plus k standard deviations
1 standard deviation68.27%84.13
2 standard deviations95.45%97.72
3 standard deviations99.73%99.87

Each of these percentages is an area under the curve: the share of the bell that lies between the two boundaries.

The 68–95–99.7 rule is for bell-shaped data only. For any data set at all, Chebyshev's inequality still guarantees that at least 75% of values lie within two standard deviations of the mean.

Worked examples

Population standard deviation of six values

Six friends spent 2, 3, 6, 6, 8 and 11 hours on homework last week. Find the standard deviation of their hours, treating the six friends as the whole group.

  1. 1The data is the whole group, so use the population formula and divide by N=6N = 6.
  2. 2Mean: μ=2+3+6+6+8+116=366=6\mu = \frac{2 + 3 + 6 + 6 + 8 + 11}{6} = \frac{36}{6} = 6 hours.
  3. 3Deviations: −4,−3,0,0,2,5-4, -3, 0, 0, 2, 5. They add up to 0, so the mean is right.
  4. 4Squares: 16,9,0,0,4,2516, 9, 0, 0, 4, 25, which add up to 5454.
  5. 5Variance: σ2=546=9\sigma^2 = \frac{54}{6} = 9.
  6. 6Standard deviation: σ=9=3\sigma = \sqrt{9} = 3.

Answer: σ=3\sigma = 3 hours: a typical friend's homework time is about 3 hours from the mean of 6.

Sample standard deviation, dividing by n − 1

A biologist measures 5 leaves picked at random from a tree: 5, 7, 9, 9 and 10 cm. Estimate the standard deviation of the lengths of all the leaves on the tree.

  1. 1The 5 leaves are a sample of the tree's leaves, so use the sample formula and divide by n−1=4n - 1 = 4.
  2. 2Mean: xˉ=5+7+9+9+105=405=8\bar{x} = \frac{5 + 7 + 9 + 9 + 10}{5} = \frac{40}{5} = 8 cm.
  3. 3Deviations: −3,−1,1,1,2-3, -1, 1, 1, 2, which add up to 0.
  4. 4Squares: 9,1,1,1,49, 1, 1, 1, 4, which add up to 1616.
  5. 5Sample variance: s2=164=4s^2 = \frac{16}{4} = 4.
  6. 6Sample standard deviation: s=4=2s = \sqrt{4} = 2 cm.
  7. 7Dividing by n=5n = 5 instead would give 3.2≈1.79\sqrt{3.2} \approx 1.79 cm, the kind of answer that tends to underestimate the spread of all the leaves on the tree.

Answer: s=2s = 2 cm.

Reading one standard deviation on a bell curve

Test scores are bell-shaped with a mean of 70 and a standard deviation of 8. About what percent of students scored between 62 and 78? Between 54 and 86? Above 86?

  1. 162 and 78 are 70−870 - 8 and 70+870 + 8: one standard deviation either side of the mean. About 68% of scores lie between them.
  2. 254 and 86 are 70−2×870 - 2 \times 8 and 70+2×870 + 2 \times 8: two standard deviations either side. About 95% of scores lie between them.
  3. 3The other 5% lie outside that range, split equally between the two tails, so about 5%÷2=2.5%5\% \div 2 = 2.5\% scored above 86.

Answer: About 68% between 62 and 78, about 95% between 54 and 86, and about 2.5% above 86.

Which data set has the larger standard deviation?

Data set A is 1, 2, 3, 4, 5, 6, 7, 8, 9. Data set B is 3, 4, 4, 4, 5, 6, 6, 6, 7. Which has the larger standard deviation?

Two histograms on number lines marked 1 to 9, each with a dashed line at the mean of 5. Histogram A has nine blue bars of height 1 at the values 1 through 9. Histogram B has purple bars at 3, 4, 5, 6 and 7 with heights 1, 3, 1, 3 and 1.
Data set A (top) has bars of equal height spread from 1 to 9. Data set B (bottom) has uneven bars, but every value is within 2 of the mean. Both have a mean of 5.
  1. 1Both sets have 9 values and a mean of 5.
  2. 2A: the squared deviations are 16,9,4,1,0,1,4,9,1616, 9, 4, 1, 0, 1, 4, 9, 16, which add up to 6060, so σA=60/9≈2.58\sigma_A = \sqrt{60 / 9} \approx 2.58.
  3. 3B: the squared deviations are 4,1,1,1,0,1,1,1,44, 1, 1, 1, 0, 1, 1, 1, 4, which add up to 1414, so σB=14/9≈1.25\sigma_B = \sqrt{14 / 9} \approx 1.25.
  4. 4A's values sit farther from the mean, even though its bars are all the same height. B's bars are uneven, but none of its values is more than 2 from the mean.

Answer: A has the larger standard deviation: about 2.58, compared with about 1.25 for B.

Changing units: Celsius to Fahrenheit

A week of daily high temperatures has a mean of 30 °C and a standard deviation of 5 °C. Find the mean and standard deviation in °F, using F=1.8C+32F = 1.8C + 32.

  1. 1The mean follows the formula: 1.8×30+32=861.8 \times 30 + 32 = 86 °F.
  2. 2Multiplying every value by 1.8 multiplies every distance from the mean by 1.8, so the standard deviation becomes 1.8×5=91.8 \times 5 = 9 °F.
  3. 3Adding 32 moves every value and the mean by the same amount, so no distance from the mean changes. The standard deviation stays at 9 °F.

Answer: Mean 86 °F, standard deviation 9 °F.

Check yourself

  1. 1.What is the standard deviation of 6, 6, 6, 6?Show answer

    0. Every value equals the mean, so there is no spread.

  2. 2.The variance of a data set is 36. What is its standard deviation?Show answer

    6, the square root of 36.

  3. 3.Find the population standard deviation of 1, 1, 7, 7.Show answer

    3. The mean is 4, and every value is exactly 3 away from it.

  4. 4.Find the sample standard deviation of 3, 5, 7.Show answer

    2. The squared deviations 4, 0 and 4 add up to 8, and √(8 ÷ 2) = 2.

  5. 5.You add 10 to every value in a data set. What happens to the standard deviation?Show answer

    Nothing. Every value and the mean move up by 10, so every distance from the mean stays the same.

  6. 6.You multiply every value in a data set by 3. What happens to the standard deviation?Show answer

    It is multiplied by 3, and the variance is multiplied by 9.

  7. 7.Heights are bell-shaped with a mean of 170 cm and a standard deviation of 7 cm. About what percent are between 156 cm and 184 cm?Show answer

    About 95%. 156 and 184 are two standard deviations either side of the mean.

  8. 8.For the same data, which is larger: the sample or the population standard deviation?Show answer

    The sample standard deviation, because it divides by n − 1 instead of n. They are equal only when both are 0.

Common mistakes

  • Stopping at the variance and calling it the standard deviation.Finish with the square root. For 4, 6, 7, 8 and 10 the variance is 4 but the standard deviation is 4=2\sqrt{4} = 2. The units are a check: the standard deviation is in the data's units, the variance in squared units.
  • Dividing by nn for a sample, or by n−1n - 1 for a whole population.Ask whether the data is every member of the group. If it is a sample used to describe a larger group, divide by n−1n - 1. On a TI-84 that is Sx; σx is the population version.
  • Adding up the deviations first and squaring the total, which gives 0 every time.Square each deviation, then add: ∑(x−xˉ)2\sum (x - \bar{x})^2, not (∑(x−xˉ))2\left(\sum (x - \bar{x})\right)^2.
  • Rounding the mean before subtracting it from each value.Keep the mean exact, as a fraction or with all its decimals, and round only the final standard deviation. A rounded mean makes the sum of squared deviations come out too large, and the error grows with the number of values.
  • Judging spread by how uneven a histogram's bars look.Spread is how far the values sit from the mean along the horizontal axis. A flat histogram stretched across a wide range has a larger standard deviation than a bumpy one bunched near the mean.
  • Using the 68–95–99.7 rule on data that isn't bell-shaped.Check the shape first. The rule holds for roughly normal data; for skewed data, the guarantee that still holds is Chebyshev's: at least 75% of values within two standard deviations of the mean.

Questions students ask

Can standard deviation be negative?

No. Standard deviation is the square root of an average of squares, and squares are never negative, so the smallest it can be is 0. If you get a negative answer, look for a sign error in the squaring step.

Can standard deviation be zero?

Yes, but only when every value in the data set is the same. Then every value equals the mean, every deviation is 0 and there is no spread at all.

Can standard deviation be greater than the mean?

Yes. The mean says where the data is centered and the standard deviation says how spread out it is, so neither limits the other. The values −5 and 5 have a mean of 0 and a population standard deviation of 5.

Is standard deviation the average distance from the mean?

Not exactly. It is the square root of the average squared distance, which is never smaller than the plain average distance, called the mean absolute deviation. For 4, 6, 7, 8 and 10 the average distance from the mean is 1.6, while the standard deviation is 2.

Is standard deviation affected by outliers?

Yes, strongly, because each deviation is squared before it is averaged. Adding one value of 30 to the data 4, 6, 7, 8, 10 raises the population standard deviation from 2 to about 8.76. When data has outliers, the interquartile range often describes its spread better.

What is the symbol for standard deviation?

The lowercase Greek letter sigma, σ, stands for the standard deviation of a population, and the letter s for the standard deviation of a sample. Variance is written σ² or s². Calculators label them σx and Sx.

How do you find standard deviation on a TI-84?

Press STAT, choose 1:Edit and type the data into list L1. Then press STAT, move to CALC and choose 1:1-Var Stats with L1 as the list. The results show Sx, the sample standard deviation, and σx, the population standard deviation.

How do you calculate standard deviation in Excel or Google Sheets?

Put the data in a column and type =STDEV.S(A1:A10) for a sample or =STDEV.P(A1:A10) for a whole population, with the range changed to fit your data. Both functions work the same way in Excel and Google Sheets. The older STDEV function gives the sample version.

What is the difference between standard deviation and standard error?

Standard deviation describes how spread out individual values are. Standard error describes how much a sample mean would vary from one sample to the next, and equals the standard deviation divided by √n. Collecting more data shrinks the standard error, while the standard deviation settles near the true spread of the population.

Can you find the standard deviation of two numbers?

Yes. For two values, the population standard deviation is half the distance between them, and the sample standard deviation is that distance divided by √2. For 3 and 9 that gives 3 and about 4.24.

Sources