Skip to content

Standard Deviation Calculator

Paste a data set to get its standard deviation and variance — for a sample or a whole population — along with the mean, quartiles, standard error and a table of every deviation.

Separate numbers with commas, spaces or new lines. Use a point for decimals (2.5) and leave out thousands separators (1500, not 1,500).

Your data is

Choose sample when the numbers are part of a larger group you want to draw conclusions about.

Result

Sample standard deviation (s)

2.13809

Sample variance s² = 4.571429

Mean (x̄)
5
Count (n)
8
Sum (Σx)
40
Population standard deviation (σ)
2
Population variance (σ²)
4
Standard error of the means ÷ √n
0.755929
Coefficient of variationStandard deviation ÷ mean
42.76%
Minimum
2
First quartile (Q1)
4
Median
4.5
Third quartile (Q3)
6
Maximum
9
Interquartile range (IQR = Q3 − Q1)
2
Range
7
Show the working
  1. Mean: add the values and divide by the count40 ÷ 8 = x̄ = 5
  2. Square each value’s distance from the mean and add them up(2 − 5)² + 3 × (4 − 5)² + 2 × (5 − 5)² + (7 − 5)² + (9 − 5)² = 32
  3. Sample variance: divide by n − 132 ÷ (8 − 1) = s² = 4.571429
  4. Standard deviation: take the square root√4.571429 = s = 2.13809
  5. Standard error of the mean: s ÷ √n2.13809 ÷ √8 = 0.755929

Sample formulas divide by n − 1 (Bessel’s correction): the deviations are measured from the sample’s own mean, which makes them slightly too small, and n − 1 makes up for it.

Quartiles use the median-of-halves method: the median is left out of both halves when the count is odd, as on TI graphing calculators. Spreadsheet functions such as QUARTILE.INC interpolate and can differ slightly.

Deviation table

Each distinct value, how often it occurs, its deviation from the mean and the squared deviation. Scroll sideways to see all columns.
Value (x)Count (f)x − x̄(x − x̄)²f × (x − x̄)²
21-399
43-113
52000
71244
9141616
Total832

What standard deviation tells you

The standard deviation measures how spread out numbers are around their mean. A small standard deviation means the values sit close to the average; a large one means they are widely scattered. It is in the same units as the data, so test scores give a standard deviation in points and heights one in centimetres.

The variance is the standard deviation squared. It is what the formula works out first, and it is useful in further calculations, but its units are squared (points², cm²), so the standard deviation is easier to interpret.

Before you read the result, decide whether your numbers are a sample or the whole population:

  • Sample — the numbers are some members of a larger group, and you want to say something about the whole group: 30 patients from a trial, 12 bags from a production run, one class out of a school. This is the usual case.
  • Population — the list contains every member of the group you care about: the final marks of everyone in your class, the monthly sales for every month of last year.

The calculator shows both, highlighting the one you choose. It also gives the quartiles, interquartile range and standard error, and a deviation table you can use to check a hand calculation line by line.

Standard deviation and variance formulas

s = √( Σ(x − x̄)² ÷ (n − 1) )

σ = √( Σ(x − μ)² ÷ n )

SE = s ÷ √n

CV = standard deviation ÷ mean × 100%

x
each value in the data
x̄, μ
the mean of the values (x̄ for a sample, μ for a population — the number is the same)
n
the number of values
Σ(x − x̄)²
the sum of squared deviations: each value’s distance from the mean, squared, all added up

Why n − 1? A sample’s values are, on average, closer to their own mean than to the true population mean, so squared deviations measured from x̄ come out slightly too small. Dividing by n − 1 instead of n (Bessel’s correction) removes that bias from the variance. With large samples the difference is tiny; with five values it is 25%.

Quartiles. There is no single standard way to compute quartiles; NIST describes several interpolation methods in use. This calculator uses the median-of-halves method taught in most school courses and used by TI graphing calculators: sort the data, split it into a lower and an upper half (leaving the median out of both when n is odd), and take the median of each half as Q1 and Q3.

Accuracy. The variance is computed in two passes — the mean first, then the squared deviations with a correction for rounding in the mean — as recommended by Chan, Golub and LeVeque. The shortcut Σx² − (Σx)² ÷ n that some calculators use loses almost all precision when the values share a large common part, such as measurements around 1,000,000.

The coefficient of variation is only shown when all values are zero or positive and the mean is above zero; for data such as temperatures in °C, where zero is arbitrary, it has no meaning.

Worked example: 2, 4, 4, 4, 5, 5, 7, 9

  1. Mean: the eight values add up to 40, so x̄ = 40 ÷ 8 = 5.
  2. Deviations from the mean: −3, −1, −1, −1, 0, 0, 2, 4. Squared: 9, 1, 1, 1, 0, 0, 4, 16.
  3. Sum of squares: 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32.
  4. Population: σ² = 32 ÷ 8 = 4, so σ = √4 = 2.
  5. Sample: s² = 32 ÷ 7 = 4.571429, so s = √4.571429 = 2.13809.
  6. Standard error: 2.13809 ÷ √8 = 0.755929.
  7. Quartiles: the lower half 2, 4, 4, 4 has median 4 (Q1); the upper half 5, 5, 7, 9 has median 6 (Q3). The median is 4.5 and the interquartile range is 6 − 4 = 2.

Reading the result

  • For roughly bell-shaped data, about 68% of values lie within one standard deviation of the mean and about 95% within two. For skewed data this rule of thumb doesn’t hold; the median and interquartile range describe it better.
  • Outliers have a big effect. Because deviations are squared, one extreme value can inflate the standard deviation a lot. The IQR ignores the top and bottom quarters and is much less sensitive.
  • Standard deviation versus standard error. The standard deviation describes the spread of individual values; the standard error describes how precisely the sample mean estimates the population mean, and it shrinks as the sample grows.
  • A sample doesn’t fix bad sampling. The n − 1 correction only removes a mathematical bias. If the sample isn’t representative, no formula can make the result describe the population.

For the mean, median and mode on their own, or a weighted average, use the average calculator. For the chance of an outcome, see the probability calculator.

Frequently asked questions

Should I use the sample or the population standard deviation?

Use the sample standard deviation when your numbers are a subset of a larger group you want to describe, which is most of the time. Use the population version only when the list includes every member of the group, such as the marks of every student in one class.

Why does the sample formula divide by n − 1?

Deviations are measured from the sample mean, which is always as close as possible to the sample’s own values, so they come out slightly too small. Dividing by n − 1 instead of n corrects the variance for that bias. The correction is called Bessel’s correction.

What is the difference between variance and standard deviation?

The variance is the average squared distance from the mean; the standard deviation is its square root. They carry the same information, but the standard deviation is in the original units, so it is easier to interpret.

Why are my quartiles different from Excel’s?

Quartiles have several accepted definitions. This calculator splits the sorted data into halves and takes the median of each, the method used in most textbooks and on TI calculators. Excel’s QUARTILE.INC interpolates between values, so on small data sets the two can differ.

What is the standard error of the mean?

It is the sample standard deviation divided by the square root of the sample size. It estimates how much the sample mean would vary from sample to sample, so it gets smaller as you collect more data. For 2, 4, 4, 4, 5, 5, 7, 9 it is about 0.756.

Can the standard deviation be zero or negative?

It is zero when every value is the same, because nothing deviates from the mean. It can never be negative: it is the square root of an average of squares, and squares are never negative.

Sources

Last reviewed September 15, 2026