Utilia

Standard Deviation Calculator

Standard deviation calculator for sample and population data. Get the variance, mean, sum of squares and standard error, with every step of the formula shown.

Separate numbers with commas, spaces, semicolons or new lines. Use a point for decimals (2.5).

Sample (divide by n − 1)

Standard deviation s
–
Variance s²
–

Population (divide by n)

Standard deviation σ
–
Variance σ²
–
Mean x̄
–
Count n
–
Sum Σx
–
Sum of squares Σ(x − x̄)²
–
Standard error s/√n
–

Step by step

How to use the standard deviation calculator

  1. Type or paste your data in the Data set box. Separate the values with commas, spaces, semicolons or new lines; a column copied from a spreadsheet works directly. Use a point for decimals (2.5).
  2. The results update as you type, or press Calculate.
  3. Read both versions side by side: Sample (divide by n − 1) gives the Standard deviation s and Variance s²; Population (divide by n) gives the Standard deviation σ and Variance σ².
  4. Below, you also get the Mean x̄, the Count n, the Sum Σx, the Sum of squares Σ(x − x̄)² and the Standard error s/√n.
  5. The Step by step panel writes out the formula with your numbers: the mean, each squared deviation, their sum, then the variances and square roots. Copy copies every result as text.

Sample or population?

Use the population formula when your data contains every member of the group you care about: the heights of all 24 pupils of one class, the scores of every game of a season. Use the sample formula when your data is a subset used to estimate a larger group: 50 customers surveyed out of thousands, ten measurements of a process that could be repeated forever.

In practice, if you are unsure, the sample standard deviation s is usually what a teacher, a lab report or a statistics package (for example STDEV.S in spreadsheets) expects. The population version corresponds to STDEV.P.

The formulas

With n values x₁ … xₙ and their mean x̄ = Σx ÷ n:

  • Sum of squared deviations: SS = Σ(x − x̄)²
  • Population variance: σ² = SS ÷ n, and population standard deviation σ = √σ²
  • Sample variance: s² = SS ÷ (n − 1), and sample standard deviation s = √s²
  • Standard error of the mean: s ÷ √n

Dividing by n − 1 instead of n (Bessel’s correction) compensates for the fact that deviations are measured from the sample’s own mean, which is always a little closer to the data than the true mean. Without it, the sample variance would underestimate the population variance on average.

Worked example. For 2, 4, 4, 4, 5, 5, 7, 9: the mean is 40 ÷ 8 = 5. The squared deviations are 9, 1, 1, 1, 0, 0, 4 and 16, whose sum is 32. The population variance is 32 ÷ 8 = 4, so σ = 2. The sample variance is 32 ÷ 7 ≈ 4.571, so s ≈ 2.138.

Accurate even with large numbers

The textbook shortcut Σx² − (Σx)² ÷ n subtracts two huge, nearly equal numbers and can lose all its precision, for instance with timestamps or values around one billion. This tool uses Welford’s algorithm instead: it updates the mean and the sum of squared deviations one value at a time, which keeps the result accurate even when the values share a large offset.

Frequently asked questions

What does the standard deviation tell me?

It measures how far the values typically are from the mean, in the same unit as the data. A small standard deviation means the values are tightly grouped; a large one means they are spread out. For roughly bell-shaped data, about 68 % of values lie within one standard deviation of the mean.

What is the difference between variance and standard deviation?

The variance is the average squared deviation, so its unit is squared (cm², €²). The standard deviation is its square root, which brings it back to the unit of the data and makes it easier to interpret.

Why is there no sample standard deviation for a single value?

The sample formula divides by n − 1, which is zero when n = 1. One value tells you nothing about spread, so the tool shows the population values (both zero) and leaves the sample ones empty.

Can the standard deviation be negative?

No. It is the square root of an average of squares, so it is always zero or positive. It is zero only when all the values are identical.

Why does my result differ slightly from my calculator?

Check whether your calculator shows the sample (s, σₙ₋₁) or the population (σ, σₙ) version. The results here are shown with up to 10 significant digits.