Standard deviation calculator

Paste your data separated by commas, spaces or line breaks. The calculator shows all key descriptive statistics together with the steps.

Use a dot for decimals (2.5). Separate values with commas, spaces, semicolons or new lines – a column copied from a spreadsheet works too.

Result

Mean (average)
5
Count (n)
8
Sum
40
Median
4.5
Mode
4 (3 times)
Minimum
2
Maximum
9
Range
7
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
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:

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 these are STDEV.S and STDEV.P.

Worked example

Data: 2, 4, 4, 4, 5, 5, 7, 9 (n = 8). Sum 40, mean 40 / 8 = 5. Sorted, the two middle values are 4 and 5, so the median is 4.5. The mode is 4 (three times). Squared deviations: 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32. Population: σ² = 32 / 8 = 4, σ = 2. Sample: s² = 32 / 7 ≈ 4.5714, s ≈ 2.1381. Range 9 − 2 = 7.

Quartiles

Q1 and Q3 use linear interpolation (Excel QUARTILE.INC, the R default). Textbooks and the TI-84 sometimes use other methods, so quartiles can differ slightly.

The calculation is numerically stable (corrected two-pass algorithm) and reproduces NIST's certified reference data sets, even for large numbers with a small spread.

Frequently asked questions

Should I use the sample or the population standard deviation?

Use the population formula (divide by n) when your data contain every member of the group. Use the sample formula (divide by n − 1) when the data are a sample and you want to estimate the spread of a larger population – the usual case for measurements and surveys.

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²), which makes the standard deviation easier to interpret.

What does "no mode" mean?

If every value occurs equally often (for example each exactly once), no value stands out, so there is no mode. If several values share the highest frequency, all of them are shown (bimodal or multimodal data).

Mean or median – which is better?

The median is robust against outliers: for 1, 2, 3, 4, 100 the mean is 22 but the median is 3. For skewed data such as incomes or house prices, the median describes the centre better.

How do I enter decimals and large numbers?

Use a dot for decimals (2.5). Because commas separate values here, write thousands without separators (1500, not 1,500).

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

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:

Related tools