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
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
Count the values
n = 6
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.
Subtract the mean from each value, then square the result
Value x x − mean (x − mean)2 2 −3.1667 10.0278 4 −1.1667 1.3611 4 −1.1667 1.3611 5 −0.1667 0.0278 7 1.8333 3.3611 9 3.8333 14.6944 Sum 30.8333 Squaring makes every difference positive, so values below the mean do not cancel values above it.
Add up the squared differences
Sum of squares ≈ 30.833333
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.
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 :
For a whole population of N values with mean :
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.
Count the values
n = 8
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.
Subtract the mean from each value, then square the result
Value x x − mean (x − mean)2 2 −3 9 4 −1 1 4 −1 1 4 −1 1 5 0 0 5 0 0 7 2 4 9 4 16 Sum 32 Squaring makes every difference positive, so values below the mean do not cancel values above it.
Add up the squared differences
Sum of squares = 32
Divide by n
32 ÷ 8 = 4
This is the population variance: the average squared distance from the mean.
Take the square root
√4 = 2
The square root brings the answer back to the same units as the data.
Answer: 2
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.
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
Count the values
n = 5
Find the mean
(3 + 5 + 7 + 9 + 11) ÷ 5 = 35 ÷ 5 = 7
The mean is the sum divided by how many values there are.
Subtract the mean from each value, then square the result
Value x x − mean (x − mean)2 3 −4 16 5 −2 4 7 0 0 9 2 4 11 4 16 Sum 40 Squaring makes every difference positive, so values below the mean do not cancel values above it.
Add up the squared differences
Sum of squares = 40
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.
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
- OpenStax Introductory Statistics 2e, 2.7 Measures of the Spread of the Data — sample standard deviation (divide by n − 1) and population standard deviation (divide by N) (checked October 12, 2026)