Standard deviation calculator

Paste numbers, choose population or sample, and get the standard deviation, variance and a steps table. Exact arithmetic.

How it works

  1. Type or paste your numbers
  2. Choose Population or Sample
  3. Read the standard deviation and the steps

Population or sample

Choose Population when your numbers are every value in the group you care about, such as all 8 scores in a class. The variance divides the sum of squared deviations by n. Choose Sample when the numbers are a sample of a larger group. The variance then divides by n - 1, which corrects for the sample's mean being closer to its own data than the true mean is. For 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5 and the sum of squared deviations is 32: the population variance is 32 ÷ 8 = 4 and the standard deviation 2, and the sample variance is 32 ÷ 7 = 4.5714285714 and the standard deviation 2.1380899353. A sample needs at least 2 numbers; with one number the page shows a fixed message, because n - 1 would be zero.

What you can type

Separate numbers with commas, semicolons, spaces, tabs or new lines. A number is an optional sign, digits and an optional decimal point, such as 12, -3.5 or .5. Thousands commas, decimal commas and scientific notation are not read, because a comma always separates numbers. Entries that are not numbers are skipped and counted in a note, never repeated back. Up to 100,000 numbers are allowed.

Why the result does not drift

Calculators that add up squares in floating point can lose all their digits when the numbers are large and close together. This page works on the digits you typed with exact integer arithmetic: the sum of squared deviations is n times the sum of squares minus the square of the sum, divided by n, and the square root is an exact integer root. So 1000000.1, 1000000.2 and 1000000.3 give a sample standard deviation of exactly 0.1. Figures are rounded to 10 decimal places, halves away from zero, only when they do not end sooner, and a note says so.

The steps table

The table lists each value in the order you typed it, its deviation from the mean and the square of that deviation. The squared deviations add up to the sum of squares shown with the results. To keep the page fast the table stops at 200 rows and says so; the results still use every number. Only the Population or Sample choice is remembered on your device; your numbers are not stored or sent anywhere.

Frequently asked questions

When should I use sample instead of population standard deviation?

Use sample when your numbers are a subset drawn from a larger group, such as 30 measured parts out of a day's production. Use population when you hold every value, such as all 8 scores in a class. The sample version divides by n - 1, so it is always a little larger.

What is the difference between variance and standard deviation?

Variance is the average squared distance from the mean. The standard deviation is its square root, so it has the same units as your data. For 2, 4, 4, 4, 5, 5, 7, 9 the population variance is 4 and the standard deviation is 2.

Why does a sample of one number give a message?

The sample formulas divide by n - 1, which is 0 for a single number, so no standard deviation exists. Add a second number or choose Population, where one value gives a standard deviation of 0.

What is the sum of squares shown?

It is the sum of the squared deviations from the mean, Σ(x - mean)². For 1, 2, 3, 4 it is 2.25 + 0.25 + 0.25 + 2.25 = 5. Dividing it by n or n - 1 gives the variance.

Why does the steps table stop at 200 rows?

A table of tens of thousands of rows would slow the page. It shows the first 200 values and says how many there are; the standard deviation, variance, mean and sum of squares are always worked out from the whole list.

Is 0 a possible answer?

Yes. When every number is the same, such as 7, 7, 7, nothing deviates from the mean and the standard deviation is exactly 0.