Skip to the content

Standard Deviation Calculator

Paste your numbers to get the standard deviation both ways: for a sample, dividing by n − 1, and for a whole population, dividing by n.

Separate the numbers with commas, spaces, semicolons or new lines. Decimals need a point: 1,5 is read as the two numbers 1 and 5.

Sample standard deviation
2.138089935
s, divides by n − 1
Population standard deviation
2
σ, divides by n
Mean
5
sum ÷ count
Median
4.5
halfway between the two middle values
Mode
4
appears 3 times
Count
8
Sum
40
Minimum
2
Maximum
9
Range
7
Lower quartile (Q1)
4
Upper quartile (Q3)
6
Interquartile range
2

Variance and standard deviation

Population (÷ n)Sample (÷ n − 1)
Variance44.571428571
Standard deviation22.138089935

Box plot

29

Sorted, smallest first

2, 4, 4, 4, 5, 5, 7, 9

Share this tool:TwitterFacebookLinkedInWhatsAppEmail

The calculation, step by step

The standard deviation says how far the values typically lie from their mean. Take the numbers the box above starts with: 2, 4, 4, 4, 5, 5, 7, 9.

  1. Work out the mean: 40 ÷ 8 = 5.
  2. Subtract the mean from each value and square the result.
  3. Add the squares up.
  4. Divide by the number of values, or by one less (see below). This is the variance.
  5. Take the square root.
ValueMinus the mean (5)Squared
2−39
4−11
4−11
4−11
500
500
724
9416
Total: 40032

The squares add up to 32. Dividing by 8 gives a variance of 4 and a standard deviation of √4 = 2. Dividing by 7 gives a variance of about 4.571 and a standard deviation of about 2.138.

Divide by n or by n − 1?

Divide by n when the numbers are the whole group you want to describe, such as every pupil in one class. That is the population standard deviation, σ.

Divide by n − 1 when the numbers are a sample from a larger group, such as thirty parts taken from a day's production. That is the sample standard deviation, s.

Why one less? In step 2 the distances are measured from the sample's own mean, and that is exactly the point from which the squares add up to the smallest possible total. Measured from the true mean of the larger group, which is almost never the same point, they would add up to more than 32. Dividing by a slightly smaller number makes up for the shortfall.

With 8 values the two answers differ by about 7%. With 100 values the difference is half a percent.

Reading the result

The standard deviation has the same unit as the data. For data that follow a bell curve, about 68% of the values lie within one standard deviation of the mean and about 95% within two. For lopsided data those percentages do not hold.

The statistics calculator page explains the other results, including how the quartiles are found and how to read the box plot.

See all 9