Standard Deviation Calculator

Standard deviation and variance of a data set β€” sample or population, with every step and a full summary.

8 numbers

Separate numbers with commas, spaces or new lines. A comma always separates, so write 1234, not 1,234.

The data is a

Part of a larger group: divides by n βˆ’ 1.

Sample standard deviation of 8 numbers

5.237229366

Population standard deviation: 4.898979486

Variance (sΒ²)
27.42857143
Mean
18
Count (n)
8
Sum
144
Sum of squared deviations
192

Summary

Smallest
10
First quartile (Q1)
15
Median
18.5
Third quartile (Q3)
23
Largest
23
Interquartile range
8
Range
13
Coefficient of variation
29.0957187%
Standard error of the mean
1.8516402
Outliers
None
xx βˆ’ mean(x βˆ’ mean)Β²
10βˆ’864
12βˆ’636
23525
23525
16βˆ’24
23525
2139
16βˆ’24
Ξ£ 1440Ξ£ 192

Paste or type a data set to get its standard deviation and variance, as a sample or as a population, with the mean, count, sum and sum of squared deviations. A summary adds the quartiles, interquartile range, outliers, coefficient of variation and standard error of the mean. The working shows each step, and a table lists every value with its deviation from the mean and the square of it.

What the standard deviation tells you

The standard deviation is the typical distance of the values from their mean, in the same unit as the data. A small one means the values sit close to the mean; a large one means they are spread out. The variance is its square, in squared units.

For data that follows a normal (bell-shaped) distribution, about 68% of values lie within one standard deviation of the mean, about 95% within two and about 99.7% within three. The rule holds only for normal data; skewed data, such as incomes, does not follow it.

The coefficient of variation is the standard deviation as a percentage of the size of the mean, which lets data sets with different units or scales be compared; with a mean of 0 it reads β€œUndefined when the mean is 0”. The standard error of the mean is the standard deviation shown divided by √n. Outliers are the values more than 1.5 times the interquartile range below Q1 or above Q3.

How to use it

Enter the data as a List, separated by commas, spaces, semicolons, tabs or new lines, or With frequencies, each value once with the whole number of times it occurs. The tool opens on 10, 12, 23, 23, 16, 23, 21, 16. A comma always separates two numbers, so write 1234, not 1,234. A data set can hold up to 100,000 numbers.

Choose Sample when the data is part of a larger group you want to describe, and Population when it is the whole group. The other kind is shown under the result. A sample of one value has no standard deviation (β€œSample standard deviation needs at least 2 values”).

Quartile method sets how Q1 and Q3 are found; the interquartile range and the outliers follow it. The exclusive method has no quartiles for one or two values (β€œExclusive quartiles need at least 3 values”). The sample or population choice and the quartile method are remembered on this device. The table lists the first 50 values; its totals cover all of them. Everything runs in your browser.

The formulas

Both formulas add the squared distances from the mean. A population divides that sum by the count n. A sample divides by n βˆ’ 1, known as Bessel's correction: the mean of a sample is fitted to that sample, so the values lie closer to it than to the true mean of the larger group, and dividing by n would understate the spread.

The tool works from the deviations themselves rather than from the sum of the squared values, which loses its digits when the values are large and close together. Numbers are held in double precision and shown to 10 significant figures.

  • Inclusive (Excel QUARTILE.INC) β€” the value at position (n βˆ’ 1) Γ— p of the sorted data, counting from 0, interpolated between neighbours. Also R's default (type 7).
  • Exclusive (Excel QUARTILE.EXC) β€” the value at position (n + 1) Γ— p, counting from 1, interpolated. R's type 6.
  • Median of halves β€” the medians of the lower and upper halves, leaving the middle value out of both when the count is odd. Used by TI-83 and TI-84 calculators and many school textbooks.
  • Tukey's hinges β€” the same, with the middle value of an odd count kept in both halves.
Population variance σ² = Ξ£(x βˆ’ mean)Β² Γ· n
Sample variance sΒ² = Ξ£(x βˆ’ mean)Β² Γ· (n βˆ’ 1)
Standard deviation = √variance
Coefficient of variation = standard deviation Γ· |mean| Γ— 100
Standard error of the mean = standard deviation ÷ √n
Outliers: below Q1 βˆ’ 1.5 Γ— IQR or above Q3 + 1.5 Γ— IQR

Examples

The data set the tool opens with

For 10, 12, 23, 23, 16, 23, 21, 16 as a Sample: the standard deviation is 5.237229366 and the variance 27.42857143. As a population it is 4.898979486.

  1. Find the mean: the sum divided by the count. 144 Γ· 8 = 18
  2. Subtract the mean from each value and square the result, as in the table.
  3. Add the squares. Ξ£(x βˆ’ mean)Β² = 192
  4. Divide by one less than the count, as the data is a sample. This is the variance. 192 Γ· 7 β‰ˆ 27.42857143
  5. Take the square root for the standard deviation. √27.42857143 β‰ˆ 5.237229366

Test scores of a whole class

Seven students are the whole class, so with Population and the scores 62, 70, 75, 75, 81, 88, 95: the mean is 78 and the standard deviation 10.25391911. Treated as a sample of a larger year group, it would be 11.07549848.

  1. Find the mean: the sum divided by the count. 546 Γ· 7 = 78
  2. Subtract the mean from each value and square the result, as in the table.
  3. Add the squares. Ξ£(x βˆ’ mean)Β² = 736
  4. Divide by the count, as the data is the whole population. This is the variance. 736 Γ· 7 β‰ˆ 105.1428571
  5. Take the square root for the standard deviation. √105.1428571 β‰ˆ 10.25391911

Spotting an outlier

For 12, 14, 15, 15, 16, 18, 45 with the default quartile method: Q1 is 14.5, Q3 is 17 and the interquartile range 2.5. The outliers listed: 45. That one value lifts the standard deviation to 11.48497984.

Frequently asked questions

Use population when the data covers every member of the group you are describing, such as all the students in one class. Use sample when the data is drawn from a larger group and stands in for it, such as a survey. When unsure, sample is the usual choice. For the default data the two are 5.237229366 and 4.898979486; the gap shrinks as the count grows.
There are several accepted definitions, and they agree only for some counts. For 6, 7, 15, 36, 39, 40, 41, 42, 43, 47, 49, the four methods here give:
  • Inclusive (Excel QUARTILE.INC): Q1 25.5, Q3 42.5
  • Exclusive (Excel QUARTILE.EXC): Q1 15, Q3 43
  • Median of halves: Q1 15, Q3 43
  • Tukey's hinges: Q1 25.5, Q3 42.5
Pick the method your course, spreadsheet or calculator uses.
It is 0 when every value is the same, and never negative, as it is the square root of a sum of squares.

See also