Standard deviation calculator

Paste your numbers and the standard deviation calculator shows the sample and population standard deviation with every step: for 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5, the sample standard deviation s ≈ 2.138 and the population standard deviation σ = 2. Mean, median, mode, variance, quartiles, z-scores and a box plot come with it.

Source: Section 1.3.5.1, NIST/SEMATECH e-Handbook of Statistical Methods – Measures of Location (mean, median, mode). Updated: .

Use a dot for decimals (2.5). Separate values with commas, spaces, semicolons or new lines – a column copied from a spreadsheet works too.
Frequency table: one value and how often it occurs per line, e.g. "4 3" for three 4s. Two spreadsheet columns can be pasted directly.
A value x whose distance from the mean is expressed in standard deviations.
My ToolboxYour inputs are saved in this browser only.

Box plot (box Q1 to Q3, line = median, circles = outliers)
4.5295.5
Histogram (classes by Sturges’ rule)
012345246810ValueFrequency1511

Both charts are redrawn on every change. All the numbers behind them are listed in the results.

Result

Standard deviation
s = 2.13809
Variance
s² = 4.571429
Mean (average)
5
Count (n)
8
Sum
40
Median
4.5
Mode
4 (3 times)
Minimum
2
Maximum
9
Range
7
Coefficient of variation
42.76%
Standard error of the mean (s / √n)
0.755929
Sample standard deviation (s, n − 1)
2.13809
Sample variance (s², n − 1)
4.571429
Population standard deviation (σ, n)
2
Population variance (σ², n)
4
Quartiles
Q1 = 4 · Q3 = 5.5 · interquartile range = 1.5
Outliers (1.5 × IQR)
1 outside 1.75 to 7.75: 9
Step-by-step table
ixᵢxᵢ − x̄(xᵢ − x̄)²z
12−39−1.4031
24−11−0.4677
34−11−0.4677
44−11−0.4677
55000
65000
77240.9354
894161.8708
Σ40032
Sorted values
2, 4, 4, 4, 5, 5, 7, 9
Steps
  • Count n = 8, sum Σx = 40
  • Mean x̄ = Σx / n = 40 / 8 = 5
  • Median: sort the values; average of values 4 and 5 = (4 + 5) / 2 = 4.5
  • Sum of squared deviations Σ(x − x̄)² = (2 − 5)² + (4 − 5)² + (4 − 5)² + (4 − 5)² + (5 − 5)² + (5 − 5)² + (7 − 5)² + (9 − 5)² = 32
  • Sample: s² = 32 / (n − 1) = 32 / 7 = 4.571429; s = √4.571429 = 2.13809
  • Population: σ² = 32 / n = 32 / 8 = 4; σ = √4 = 2
  • Range = maximum − minimum = 9 − 2 = 7

How it is calculated

How the calculator works

For a data set of n values x1, …, xn the calculator uses the definitions of the NIST/SEMATECH e-Handbook of Statistical Methods, section 1.3.5.6 “Measures of Scale” (checked 2026):

How to calculate standard deviation

  1. Paste your values into the data set field – separated by commas, spaces, semicolons or new lines; a spreadsheet column works too.
  2. Choose whether your values are a sample (divide by n − 1) or the whole population (divide by n) – both results are listed.
  3. Read mean, median, mode, variance, standard deviation and quartiles with the full working and the step-by-step table.

Worked example by hand

Data: 2, 4, 4, 4, 5, 5, 7, 9 (n = 8).

  1. Sum: 2 + 4 + 4 + 4 + 5 + 5 + 7 + 9 = 40.
  2. Mean: 40 / 8 = 5.
  3. Subtract the mean from each value and square the result (table below).
  4. Sum of squares: 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32.
  5. Population: σ² = 32 / 8 = 4, so σ = √4 = 2.
  6. Sample: s² = 32 / 7 ≈ 4.5714, so s = √4.5714 ≈ 2.1381.
ixx − x̄(x − x̄)²z = (x − x̄) / s
12−39−1.4031
24−11−0.4677
34−11−0.4677
44−11−0.4677
55000
65000
77240.9354
894161.8708
Σ40032

The column x − x̄ always adds up to 0 – a quick check that the mean is right. Sorted, the two middle values are 4 and 5, so the median is 4.5; the mode is 4 (three times); the range is 9 − 2 = 7.

Sample or population?

If your numbers are the whole group you care about (e.g. the scores of every student in one class), divide by n. If they are a sample used to draw conclusions about a larger group (e.g. 50 surveyed customers), divide by n − 1 (Bessel’s correction). In Excel and Google Sheets these are STDEV.S and STDEV.P; on a TI-84, 1-Var Stats lists Sx (sample) and σx (population).

Common mistakes

Quartiles

Q1 and Q3 use linear interpolation (Excel QUARTILE.INC, the R default): Q1 = 4, Q3 = 5.5, interquartile range 1.5 in the example. Textbooks and the TI-84 sometimes use other methods, so quartiles can differ slightly; the quartile calculator compares four methods.

Frequency table, z-score, coefficient of variation and box plot

If your data comes as a frequency table, change “Input type” and write a value and its frequency on each line: the lines “2 1”, “4 3”, “5 2”, “7 1”, “9 1” are the same eight values as in the example above and again give x̄ = 5 and s ≈ 2.1381. The step-by-step table then shows the columns f · x and f · (x − x̄)².

The z-score tells you how many standard deviations a value lies from the mean: z = (x − x̄) / s. For x = 9 in the example: (9 − 5) / 2.1381 ≈ 1.8708. The coefficient of variation relates the spread to the mean: 2.1381 / 5 ≈ 42.76%. The standard error is s / √n = 2.1381 / √8 ≈ 0.7559.

The box plot draws Q1, the median and Q3 as a box. Values more than 1.5 times the interquartile range below Q1 or above Q3 count as outliers (Tukey’s rule) – in the example everything outside 1.75 to 7.75, i.e. the 9.

Single measures in more depth: standard error, coefficient of variation and mean, median and mode. To see the shape of larger data sets, use the histogram maker.

Frequently asked questions

Should I use the sample or the population standard deviation?

Use the sample formula (divide by n − 1) unless your data contain every member of the group. Measurements and surveys are almost always samples; the scores of every student in one class are a population, so divide by n.

How do you calculate standard deviation by hand?

Find the mean, subtract it from each value, square the differences, add them up, divide by n − 1 (sample) or n (population) and take the square root. For 2, 4, 4, 4, 5, 5, 7, 9 that is √(32 / 7) ≈ 2.1381.

How do I calculate standard deviation in Excel or Google Sheets?

Use =STDEV.S(A1:A8) for a sample and =STDEV.P(A1:A8) for a population. The older functions STDEV and STDEVP give the same results; VAR.S and VAR.P return the variance.

How do I find standard deviation on a TI-84?

Enter the data in L1 with STAT → EDIT, then run STAT → CALC → 1-Var Stats. Sx is the sample standard deviation and σx the population standard deviation.

What is a good standard deviation?

There is no universal good value – it depends on the unit and the mean. Compare the spread to the mean with the coefficient of variation: 2.1381 / 5 ≈ 43% in the example is a wide spread, while a few percent counts as tight for most measurements.

What is the difference between variance and standard deviation?

The standard deviation is the square root of the variance. It has the same unit as the data (e.g. cm), whereas the variance is in squared units (cm²), so the standard deviation is easier to interpret.

Mean or median – which is better?

The median, when the data are skewed or contain outliers: for 1, 2, 3, 4, 100 the mean is 22 but the median is 3. For roughly symmetric data both are close and the mean is the usual choice.

Why are my quartiles different from my textbook or TI-84?

Because there are several common definitions of quartiles. This calculator uses linear interpolation like Excel QUARTILE.INC. Mean, median, variance and standard deviation are uniquely defined and will match.

Sources and legal basis

As of: · Editorial policy

Related tools