Skip to content
RightYantra
Calculators

Standard Deviation Calculator

Paste your data and get the standard deviation both ways — for a sample, dividing by n − 1, and for a whole population, dividing by n — together with the variance, the coefficient of variation, the standard error, a z-score for any value, and a table that shows every step of the arithmetic.

How to use it· 4 steps
  1. Paste or type your numbers, separated by commas, spaces or new lines.
  2. Say whether the data is a sample from a larger group or the whole population; the matching figures are highlighted.
  3. Read the standard deviation and variance, then follow the step table: each value, its distance from the mean, and that distance squared.
  4. Enter a value in the z-score box to see how many standard deviations it lies from the mean.
Standard Deviation CalculatorRuns on your device

Step by step

How to use the standard deviation calculator

  1. 1Paste or type your numbers, separated by commas, spaces or new lines.
  2. 2Say whether the data is a sample from a larger group or the whole population; the matching figures are highlighted.
  3. 3Read the standard deviation and variance, then follow the step table: each value, its distance from the mean, and that distance squared.
  4. 4Enter a value in the z-score box to see how many standard deviations it lies from the mean.

The formula, one step at a time

Standard deviation measures how far values typically sit from their mean. Find the mean x̄; subtract it from each value to get the deviations xᵢ − x̄; square each deviation; add the squares to get the sum of squares; divide by n for the population variance σ², or by n − 1 for the sample variance s²; and take the square root to return to the original units.

The pre-filled data, 2, 4, 4, 4, 5, 5, 7, 9, is the classic textbook example. The mean is 40 ÷ 8 = 5. The deviations are −3, −1, −1, −1, 0, 0, 2 and 4; squared, 9, 1, 1, 1, 0, 0, 4 and 16, which sum to 32. Divided by n = 8 that is a population variance of 4 and a standard deviation of exactly 2. Divided by n − 1 = 7 it is a sample variance of 4.571 and a sample standard deviation of 2.138.

The deviations themselves always add up to zero — positives and negatives cancel by the definition of the mean — which is why they are squared before averaging. The step table ends with that zero and the sum of squares, so you can check your own working line by line.

Sample or population: n − 1 or n

Use the population formula when your data is every member of the group you care about: all 30 students in your class, every sale made this month. Use the sample formula when the data stands in for a larger group you have not measured — 30 students surveyed to estimate a whole school. In coursework and research the data is almost always a sample.

Dividing by n − 1 is Bessel's correction. Deviations are measured from the sample's own mean, and the sample mean is by definition the point that makes the squared deviations as small as possible, so they come out slightly smaller than the deviations from the true population mean would be. Dividing by one less than n exactly offsets that bias in the variance. The difference fades as samples grow: the two standard deviations differ by a factor of √(n ÷ (n − 1)), which is 1.069 for 8 values and 1.005 for 100.

Software names them inconsistently. In Excel, STDEV.S and VAR.S are the sample versions and STDEV.P and VAR.P the population ones; the older STDEV and STDEVP mean the same, and Google Sheets accepts both sets of names. Calculators label them s or sx for the sample and σ or σx for the population.

Reading the results: CV, standard error and z-scores

The coefficient of variation, CV = SD ÷ mean × 100%, expresses spread relative to size, so data on different scales can be compared: a standard deviation of 5 means a lot around a mean of 20 (CV 25%) and very little around a mean of 2,000 (CV 0.25%). It is only meaningful for positive data measured from a true zero, such as weights or prices — the calculator warns when your data contains negative values.

The standard error of the mean, s ÷ √n, is a different quantity: not how spread out the data is, but how precisely the sample mean estimates the population mean. It shrinks as the sample grows even when the spread does not, which is why large surveys report small margins of error.

A z-score, z = (x − x̄) ÷ SD, says how many standard deviations a value lies from the mean. In the example, 9 is (9 − 5) ÷ 2 = 2 population standard deviations above the mean, or 1.87 using the sample figure. For data that is roughly bell-shaped, about 68% of values fall within one standard deviation of the mean, 95% within two and 99.7% within three — but that rule describes normal distributions, not every data set.

Why the method of calculation matters

Many calculators use the shortcut formula Σx² − (Σx)² ÷ n, which saves a pass through the data but subtracts two enormous, nearly equal numbers. With values like 10,000,000.1, 10,000,000.2 and 10,000,000.3, the squares carry about fifteen digits before the decimal point, and the subtraction wipes out every digit that mattered — the result can even be a negative variance, which is impossible.

This calculator uses Welford's algorithm (1962), which updates the mean and the sum of squared deviations together, one value at a time, and stays accurate for data like that. It is checked against the NIST Statistical Reference Datasets NumAcc1 to NumAcc4, whose certified standard deviations are 1 and 0.1 for values as large as ten million.

Two limits are worth knowing. Each value counts once, so a frequency table should be entered as repeated values. And there is no grouped-data or confidence-interval mode. For the mean, median, mode and quartiles of the same data, use the mean, median and mode calculator. As everywhere on this site, the numbers never leave your browser.

Answers

Frequently asked questions

Should I use sample or population standard deviation?

Use the sample version unless your data includes every member of the group you are describing. Survey results, experiments and coursework data are nearly always samples.

Why divide by n − 1 instead of n?

Because deviations measured from a sample's own mean are slightly too small on average. Dividing by n − 1 (Bessel's correction) makes the sample variance an unbiased estimate of the population variance.

What is the difference between variance and standard deviation?

Variance is the average squared deviation, in squared units. The standard deviation is its square root, back in the units of the data, which makes it the easier one to interpret.

Is a high standard deviation bad?

Not in itself — it means the values are spread out. Whether that matters depends on the context; the coefficient of variation helps compare spread across data on different scales.

How do I calculate a z-score?

Subtract the mean from the value and divide by the standard deviation: z = (x − x̄) ÷ SD. Type the value into the z-score box and the calculator does it with the SD you selected.

Does this match Excel's STDEV functions?

Yes: the sample figure matches STDEV.S and the population figure matches STDEV.P, and the variances match VAR.S and VAR.P.