Standard Deviation Calculator

Sample and population standard deviation, variance and every step.

Separate with commas, spaces or new lines. You can paste a spreadsheet column.

Your data is

Sample standard deviation (s)

2.138089935

The sample standard deviation of these 8 values is 2.138089935, around a mean of 5.

Sample variance (s²)
4.571428571
Population standard deviation (σ)
2
Mean
5
Count (n)
8
Sum of squares Σ(x − mean)²
32

Fix the highlighted field to update the result.

Step by step

  1. Mean = 40 ÷ 8 = 5
  2. Sum of squared deviations Σ(x − mean)² = 32
  3. Variance = 32 ÷ 7 (n − 1) = 4.571428571
  4. Standard deviation = √4.571428571 = 2.138089935
Show the deviation table
Each value’s distance from the mean
Value (x)x − mean(x − mean)²
2-39
4-11
4-11
4-11
500
500
724
9416

How to use

  1. Type or paste your numbers, separated by commas, spaces or new lines.
  2. Choose A sample if your data comes from a bigger group, or The whole population if it covers every member.
  3. Read the standard deviation, the variance and the step-by-step working. Open the deviation table to see every value.

Formula

Population: σ = √( Σ(x − μ)² ÷ N )
Sample:     s = √( Σ(x − x̄)² ÷ (n − 1) )
  1. Find the mean.
  2. Subtract the mean from each value and square the result.
  3. Add the squares to get the sum of squares.
  4. Divide by N (population) or n − 1 (sample) to get the variance.
  5. Take the square root.

Example

For 2, 4, 4, 4, 5, 5, 7, 9, the mean is 40 ÷ 8 = 5.

Value x − mean (x − mean)²
2 −3 9
4 −1 1
4 −1 1
4 −1 1
5 0 0
5 0 0
7 2 4
9 4 16
  • Sum of squares = 32
  • Population: σ = √(32 ÷ 8) = √4 = 2
  • Sample: s = √(32 ÷ 7) = 2.138 (2.138089935)

For 4, 8, 15, 16, 23, 42, the mean is 18, σ = 12.3153 and s = 13.4907.

Why n − 1, and how we keep it accurate

A sample’s values sit closer to their own mean than to the true population mean, so dividing by n would underestimate the spread. Dividing by n − 1 (Bessel’s correction) fixes that on average.

We find the mean first and then sum the squared deviations (a two-pass method). This stays accurate on NIST’s hard test data, where the one-step shortcut formula breaks down.

Want the mean, median and mode as well? Use the average calculator.

Frequently asked questions

Should I use sample or population standard deviation?

Use the sample version (s, divide by n − 1) when your data is a sample from a bigger group. Use the population version (σ, divide by N) when you have every member.

Why divide by n − 1 for a sample?

A sample’s values sit closer to their own mean than to the true population mean. Dividing by n − 1 corrects that, giving a better estimate of the population variance.

How do I calculate standard deviation by hand?

Find the mean, subtract it from each value, square each difference and add them up. Divide by n − 1 (sample) or N (population), then take the square root.

What does standard deviation tell me?

It is the typical distance of values from the mean, in the data’s own units. Small means values cluster tightly; large means they are spread out.

What is the difference between variance and standard deviation?

Variance is the average squared distance from the mean. Standard deviation is its square root, so it is back in the original units and easier to read.

Can standard deviation be zero or negative?

It is never negative. It is zero only when every value is the same, because then nothing differs from the mean.

Embed this calculator

Add this calculator to your own website for free. Copy the code below and paste it into your page’s HTML. The attribution link is optional.