Index / Standard Deviation

Standard Deviation Calculator

Sample or population, with the full deviation table shown — every x, every x minus the mean, every squared deviation, and the column totals.

Dispersion Analysis

idle
n
mean
Σ(x−x̄)²
df
skipped
Separate values with spaces, commas, semicolons, tabs or new lines. Anything that is not a number is skipped and reported.
Sample standard deviation (s)
Variance
Std. error
CV
Other formula
xx − x̄(x − x̄)²

How to use it

Choose whether your numbers are a sample or an entire population, then paste the data. The working table underneath shows every observation, its deviation from the mean, and that deviation squared, with the column totals at the foot — which is exactly the layout you would produce by hand, and exactly what most coursework asks you to show.

Both answers are always available: whichever formula you select, the other one appears in the fourth readout cell so you can see how much the choice actually changes the result.

Sample or population — the decision that matters

This is the most common error in introductory statistics, and it is worth being precise about, because it propagates into every calculation downstream.

Population standard deviation
σ = √( Σ(x − μ)² ÷ N )
Sample standard deviation
s = √( Σ(x − x̄)² ÷ (n − 1) )

Use the population formula only when your data genuinely is every member of the group you want to describe: the marks of all 28 students in one class when the class is the entire subject of interest, every transaction in a completed month, all fifty states.

Use the sample formula whenever your data is a subset standing in for something larger — which, in practice, is almost always. Survey respondents, measured items from a production run, patients in a trial, one class taken as representative of a year group.

Why n − 1? A sample's own mean is, by construction, the point that minimises the sum of squared deviations for that sample. The true population mean sits somewhere else, so squared deviations measured from the sample mean are systematically a little too small. Dividing by n − 1 rather than n inflates the result by exactly the right amount to correct that bias. This is Bessel's correction, and it is the reason sample variance is an unbiased estimator of population variance.

The practical size of the difference shrinks as n grows. At n = 5 the sample SD is about 12% larger than the population SD of the same numbers; at n = 30 it is under 2%; at n = 500 it is negligible. Small samples are exactly where it matters most, and exactly where people are most likely to get it wrong.

A worked example

Take five values: 4, 8, 6, 5, 3.

  1. Mean: (4 + 8 + 6 + 5 + 3) ÷ 5 = 26 ÷ 5 = 5.2
  2. Deviations: −1.2, 2.8, 0.8, −0.2, −2.2 — note they sum to zero, always, which is a useful check on your arithmetic
  3. Squared deviations: 1.44, 7.84, 0.64, 0.04, 4.84
  4. Sum of squares: 14.8
  5. Sample variance: 14.8 ÷ 4 = 3.7  →  s = √3.7 = 1.9235
  6. Population variance: 14.8 ÷ 5 = 2.96  →  σ = √2.96 = 1.7205

The two answers differ by about 12% on five observations. Paste those five numbers above and the working table reproduces this exactly, row for row.

Variance, standard deviation, standard error

Three related quantities that are constantly confused with one another.

QuantityFormulaWhat it tells you
VarianceAverage squared deviation. Mathematically convenient — variances of independent variables add — but in squared units, so hard to interpret directly.
Standard deviations = √s²Typical distance of an observation from the mean, in the original units. This is the one to report.
Standard errorSE = s ÷ √nHow much the sample mean itself would vary across repeated samples. Shrinks as n grows. This is what confidence intervals are built from.

The distinction between the last two catches people out constantly. Standard deviation describes the spread of your data and does not shrink when you collect more of it — a taller sample of people is not a less variable one. Standard error describes the precision of your estimate and does shrink, proportional to √n. Quadrupling your sample size halves the standard error while leaving the standard deviation essentially unchanged.

The empirical rule

For data that is approximately normally distributed, standard deviation converts directly into proportions.

IntervalContains aboutOutside
x̄ ± 1s68.3%1 in 3
x̄ ± 2s95.4%1 in 22
x̄ ± 3s99.7%1 in 370

This is why "three sigma" became shorthand for a rare event and why control charts use three-standard-deviation limits. It only holds for roughly normal data — on a strongly skewed distribution the proportions are quite different. For any distribution at all, Chebyshev's inequality gives a weaker but universal guarantee: at least 75% of data lies within two standard deviations and at least 89% within three, whatever the shape.

Coefficient of variation

The calculator also reports the CV, which expresses the standard deviation as a percentage of the mean.

Coefficient of variation
CV = (s ÷ x̄) × 100%

This makes spread comparable across variables measured in different units or on wildly different scales. A standard deviation of 5 means something very different on data averaging 20 than on data averaging 5,000. The CV strips out the scale: 25% versus 0.1%.

Two cautions. The CV is meaningless when the mean is near zero, because you are dividing by something tiny, and it is not interpretable at all on data that can go negative or that sits on an interval rather than ratio scale — temperature in Celsius being the classic counterexample.

Frequently asked questions

Which should I use if I am not sure?
The sample formula. It is the safer default: if your data really is a full population, using n − 1 gives a slightly conservative (larger) figure, whereas using n on what is actually a sample understates the spread and makes everything downstream — confidence intervals, significance tests — look more precise and more significant than it is. Erring towards the sample formula errs towards caution.
Why do my deviations sum to zero?
Because the mean is defined as the balancing point of the data. Positive and negative deviations necessarily cancel exactly. That is precisely why the deviations are squared before summing — without squaring, every dataset would have a dispersion of zero. It is also a reliable arithmetic check: if your deviation column does not sum to zero, you have made an error in the mean.
Can standard deviation be negative?
No. It is a square root of a sum of squares, so it is zero or positive by construction. It equals exactly zero only when every value in the data set is identical. A negative result means an arithmetic mistake.
What does Excel's STDEV do?
Modern Excel offers STDEV.S (sample, n − 1) and STDEV.P (population, n). The legacy STDEV is the sample version and STDEVP the population one. Google Sheets follows the same naming. If a figure does not match, checking which function was used resolves it most of the time.
Should I remove outliers before calculating?
Only if you have a substantive reason to believe a value is erroneous — a transcription slip, a sensor fault, a respondent who misread the scale. Removing points because they are inconvenient is data manipulation. If genuine extreme values are dominating your standard deviation, that is a finding: report the median and IQR alongside, and say what you did.
How many decimal places should I report?
Conventionally one more than the precision of your raw data. If measurements were recorded to the nearest whole number, a standard deviation to one decimal place is appropriate. Reporting 1.9235294 from whole-number inputs implies a precision the data does not contain.
Is my data stored?
No. Everything runs in your browser. Nothing is transmitted to a server, logged or saved.

Next steps

With a mean and standard deviation you can measure how unusual any single observation is using the z-score calculator, or build an interval estimate for the population mean with the confidence interval calculator — which uses exactly the standard error this page reports. If you have not yet checked the shape of your data, the descriptive summary will tell you whether the mean is a fair centre in the first place.