Sample standard deviation calculator

This calculator returns the sample standard deviation, s = sqrt(sum((x - xbar)^2) / (n - 1)): a measure of how spread out a set of measurements is, in the same units as the data. Use it when your numbers are a sample drawn from a larger population you want to say something about, which is the usual case for lab measurements, survey responses, quality-control batches and A/B test data.

Sample or population? This is the single most common mistake. Divide by n - 1 (sample, this tool) when your data is a subset and you want to estimate the spread of the wider population. Divide by n (population) only when your data is the entire population, for example every student in one specific class when that class is all you care about. Using the population formula on a sample systematically understates the spread. Statistical software defaults differ: spreadsheets use STDEV.S for sample and STDEV.P for population, so check which one you called.

When the number can mislead. Standard deviation assumes spread is meaningfully summarised by one figure, which is true for roughly symmetric data and misleading for strongly skewed data or data with outliers, where a single extreme value inflates s substantially. It is not defined for a single observation (n - 1 = 0). It says nothing about whether the data is normally distributed, so do not use it to justify the "68 to 95 to 99.7 percent" rule without first checking the shape of the distribution.

For the sample 2, 4, 4, 4, 5, 5, 7, 9 the sample standard deviation is 2.13809.

Formula: s = sqrt(sum((x-xbar)^2)/(n-1)). Source: NIST/SEMATECH e-Handbook of Statistical Methods, as at 2026-07-09.

Sample SD2.13809

Applies to: any numeric inputs. Method source: NIST/SEMATECH e-Handbook of Statistical Methods, checked 2026-07-09.

The formula

s = sqrt(sum((x-xbar)^2)/(n-1))

Worked example

Eight measurements: 2, 4, 4, 4, 5, 5, 7, 9.

  1. Mean: (2 + 4 + 4 + 4 + 5 + 5 + 7 + 9) / 8 = 40 / 8 = 5
  2. Deviations from the mean: -3, -1, -1, -1, 0, 0, 2, 4
  3. Squared deviations: 9, 1, 1, 1, 0, 0, 4, 16, which sum to 32
  4. Divide by n - 1 (not n, because this is a sample): 32 / 7 = 4.571429. This is the sample variance.
  5. Take the square root: Sample SD = 2.13809

Dividing by n - 1 rather than n is Bessel's correction. Using n here would give 2 exactly, which understates the spread: a sample tends to sit closer to its own mean than to the true population mean, so dividing by n - 1 corrects that bias. With only 8 values the difference is about 7 percent, and it shrinks as the sample grows.

This worked example is one of the automated golden-value tests this calculator must pass before it can publish.

What this assumes

  • Inputs are real numbers in the units shown.
  • The result is the exact value of s = sqrt(sum((x-xbar)^2)/(n-1)); general information, not professional advice.

Frequently asked questions

What formula does this use?

s = sqrt(sum((x-xbar)^2)/(n-1)), the standard form documented by NIST/SEMATECH e-Handbook of Statistical Methods.

Does the result ever change over time?

No. This is a pure formula with no external rate, so the same inputs always give the same result.

Official sources and verification

Reviewed by the CalculatorHub team, edited by James Graham, 2026-07-09. See our methodology. General information, not professional advice.