Skip to content
CalcWorld

Browse all tools

Standard Deviation Calculator

This standard deviation calculator measures how spread out a data set is around its mean, for a sample or for a whole population. For the quiz scores 2, 4, 4, 4, 5, 5, 7 and 9 the mean is 5 and the population standard deviation is 2.

Sources: OpenStax Introductory Statistics 2e Updated

Separate the values with commas, spaces or new lines.
The data is a

Sample standard deviation (s)

≈ 2.483277

Sample variance (s²)
6.166667
Mean
5.166667
Count (n)
6
Sum
31
Population standard deviation (σ)
2.266912
Show steps Here’s how we got it
  1. Count the values

    n = 6

  2. Find the mean

    (2 + 4 + 4 + 5 + 7 + 9) ÷ 6 = 31 ÷ 6 ≈ 5.166667

    The mean is the sum divided by how many values there are.

  3. Subtract the mean from each value, then square the result

    Value xx − mean(x − mean)2
    2−3.166710.0278
    4−1.16671.3611
    4−1.16671.3611
    5−0.16670.0278
    71.83333.3611
    93.833314.6944
    Sum30.8333

    Squaring makes every difference positive, so values below the mean do not cancel values above it.

  4. Add up the squared differences

    Sum of squares ≈ 30.833333

  5. Divide by n − 1

    30.833333 ÷ (6 − 1) = 30.833333 ÷ 5 ≈ 6.166667

    This is the sample variance. The values in a sample sit closer to their own mean than to the true population mean, so dividing by n would come out too small. Dividing by n − 1 corrects for that.

  6. Take the square root

    √6.166667 ≈ 2.483277

    The square root brings the answer back to the same units as the data.

The standard deviation formulas

For a sample of n values with mean xˉ\bar{x}:

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

For a whole population of N values with mean μ\mu:

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

The symbol Σ means "add up". The only difference between the two formulas is the number you divide by, as OpenStax Introductory Statistics sets out.

How to calculate standard deviation: a worked example

Eight students score 2, 4, 4, 4, 5, 5, 7 and 9 on a quiz. Treat them as the whole class, so use the population formula.

  1. Count the values

    n = 8

  2. Find the mean

    (2 + 4 + 4 + 4 + 5 + 5 + 7 + 9) ÷ 8 = 40 ÷ 8 = 5

    The mean is the sum divided by how many values there are.

  3. Subtract the mean from each value, then square the result

    Value xx − mean(x − mean)2
    2−39
    4−11
    4−11
    4−11
    500
    500
    724
    9416
    Sum32

    Squaring makes every difference positive, so values below the mean do not cancel values above it.

  4. Add up the squared differences

    Sum of squares = 32

  5. Divide by n

    32 ÷ 8 = 4

    This is the population variance: the average squared distance from the mean.

  6. Take the square root

    √4 = 2

    The square root brings the answer back to the same units as the data.

Answer: 2

Standard deviation example: dot plot of the quiz scores 2, 4, 4, 4, 5, 5, 7 and 9 with the mean 5 and a shaded band from 3 to 7, one population standard deviation of 2 either side; 6 of the 8 scores fall inside it.
Most of the scores sit within one standard deviation of the mean. Only 2 and 9 are outside the band.

Standard deviation as the side of a square

Each squared difference can be drawn as a real square, with the distance from the mean as its side. The variance is the average area of those squares, and the standard deviation is the side of that average square.

The squared differences from the mean 5 drawn as squares: 9, 1, 1, 1, 0, 0, 4 and 16, adding up to 32; divided by 8 that gives a variance of 4, a square whose side is the standard deviation 2.
The variance is the average of the squares. Its side length, the square root, brings the answer back to the units of the data.

Squaring gives large differences extra weight: the score of 9 contributes 16 of the 32, half the total. That is why one extreme value can raise the standard deviation a lot, while the interquartile range hardly moves.

Sample or population?

If these eight scores were a sample from a larger year group, the sample formula divides 32 by 7 instead of 8. The sample standard deviation is then √(32 ÷ 7) = 2.13809, slightly larger than 2.

Standard deviations of x and y also appear inside the correlation coefficient r, which the linear regression calculator reports with the line of best fit.

Standard deviation practice question

Find the sample standard deviation of 3, 5, 7, 9 and 11.

Check your answer

Answer: ≈ 3.162278

  1. Count the values

    n = 5

  2. Find the mean

    (3 + 5 + 7 + 9 + 11) ÷ 5 = 35 ÷ 5 = 7

    The mean is the sum divided by how many values there are.

  3. Subtract the mean from each value, then square the result

    Value xx − mean(x − mean)2
    3−416
    5−24
    700
    924
    11416
    Sum40

    Squaring makes every difference positive, so values below the mean do not cancel values above it.

  4. Add up the squared differences

    Sum of squares = 40

  5. Divide by n − 1

    40 ÷ (5 − 1) = 40 ÷ 4 = 10

    This is the sample variance. The values in a sample sit closer to their own mean than to the true population mean, so dividing by n would come out too small. Dividing by n − 1 corrects for that.

  6. Take the square root

    √10 ≈ 3.162278

    The square root brings the answer back to the same units as the data.

Questions about standard deviation

How do you calculate standard deviation?

Find the mean. Subtract it from each value and square the result. Add the squares, divide by n − 1 for a sample or by n for a population, and take the square root. The calculator shows each of these steps for your own numbers.

What is the difference between sample and population standard deviation?

Use the population formula, dividing by n, when your data is every member of the group you care about. Use the sample formula, dividing by n − 1, when your data is a sample taken from a larger group. The sample value is always a little larger.

Why divide by n − 1 for a sample?

The differences are measured from the sample's own mean, and the values in a sample sit closer to their own mean than to the true population mean. Dividing by n would make the spread look too small on average. Dividing by n − 1 corrects for that.

What does the standard deviation tell you?

How far the values typically are from the mean, in the same units as the data. A small standard deviation means the values are bunched close to the mean. A large one means they are spread out. If every value is the same, it is 0.

What is the difference between standard deviation and variance?

The variance is the average squared difference from the mean. The standard deviation is its square root. Standard deviation is used more often because it has the same units as the data.

What do the standard deviation symbols s and σ mean?

s is the sample standard deviation and σ (sigma) is the population standard deviation. Their squares, s² and σ², are the variances. x̄ is a sample mean and μ is a population mean.

What is the standard deviation of 5, 9, 8, 12, 6, 10, 6, 8?

About 2.33 as a sample, or 2.18 as a population. The mean is 64 ÷ 8 = 8, and the squared differences from it add up to 38. The sample standard deviation is √(38 ÷ 7) ≈ 2.33 and the population one is √(38 ÷ 8) ≈ 2.18.

What is the standard deviation of 5, 5, 5, 9, 9, 9, 10, 10, 10?

About 2.29 as a sample, or 2.16 as a population. The mean is 72 ÷ 9 = 8, and with each value appearing three times the squared differences add up to 3 × 9 + 3 × 1 + 3 × 4 = 42. The sample standard deviation is √(42 ÷ 8) ≈ 2.29 and the population one is √(42 ÷ 9) ≈ 2.16.

Sources