Standard Deviation Calculator

Enter your data to get the sample and population standard deviation, with the full working: deviations, squares, variance and square root.

Your data is a

Sample SD (s)2.1381
Population SD (σ)2
Mean5
Count (n)8
mean23456789
values mean mean ± 1 SD box plot (Q1–Q3, median)

Step by step

  1. Mean: add the values and divide by the count: x̄ = 40 ÷ 8 = 5
  2. Subtract the mean from each value and square the result (table below)
  3. Add the squares: Σ(x − x̄)² = 32
  4. Divide by n − 1 = 7: variance s² = 32 ÷ 7 = 4.5714
  5. Take the square root: s = √4.5714 = 2.1381
xx − x̄(x − x̄)²
2−39
4−11
4−11
4−11
500
500
724
9416
Count (n)8
Sum40
Mean5
Median4.5
Mode4 (appears 3 times)
Minimum2
Maximum9
Range7
Q1 (first quartile)4
Q3 (third quartile)6
Interquartile range (IQR)2
Sample standard deviation (s)2.1381
Population standard deviation (σ)2
Sample variance (s²)4.5714
Population variance (σ²)4
Standard error of the mean0.7559
Coefficient of variation42.76%
Mean absolute deviation1.5
Sum of squares (Σ(x − x̄)²)32
Outliers (1.5 × IQR rule)none
Sorted data

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

How it works

The calculator finds the mean, squares each value’s distance from it, averages those squares (dividing by n − 1 for a sample or N for a population) and takes the square root. For 2, 4, 4, 4, 5, 5, 7, 9 that gives σ = 2 and s ≈ 2.1381.

The symbols, a hand-worked example and the Excel functions are on the standard deviation formula page. For spread around the median instead, use the IQR calculator; to draw the data, the histogram maker.

Sample vs population

Dividing by n − 1 instead of n (Bessel’s correction) makes the sample variance an unbiased estimate of the population variance. If your numbers are a sample — a class, a survey, an experiment — use s. If they are the whole group you care about, use σ.

What is a “good” standard deviation?

It depends on the units and the mean. For roughly bell-shaped data about 68% of values fall within one SD of the mean and 95% within two (the empirical rule). To compare spreads of data with different means, use the coefficient of variation.

Frequently asked questions

How do you calculate standard deviation?

Subtract the mean from each value, square the results, add them, divide by n − 1 for a sample (or n for a population) and take the square root.

What is the difference between s and σ?

s is the sample standard deviation (divides by n − 1); σ is the population standard deviation (divides by N). s is slightly larger.

Can standard deviation be negative?

No. It is a square root of an average of squares, so it is 0 or positive. It is 0 only when all values are equal.

What is the standard deviation of 2, 4, 4, 4, 5, 5, 7, 9?

The population SD is 2 and the sample SD is about 2.1381.

Last reviewed November 2026. Results are rounded to 4 decimal places; all math runs in your browser.