Standard Deviation Calculator

Computes the standard deviation of a pasted list of numbers, as either a sample or a population, along with the variance, mean, count and standard error of the mean. The sample form divides the sum of squared deviations from the mean by n − 1 before taking the square root; the population form divides by n. Input accepts numbers separated by commas, spaces, tabs or line breaks, skipping anything non-numeric.

Data type
Standard deviation
Variance
Mean
Count
Standard error of the mean

Type or paste a list of numbers, tell the calculator whether they are a sample drawn from something larger or the entire population of interest, and it returns the standard deviation along with the variance, the mean, the count and the standard error of the mean. Separators are flexible: commas, spaces, tabs and line breaks all work, and anything that is not a number gets skipped, so a spreadsheet column pastes in without cleanup. The headline figure is read in the same units as the data. For the default list of six values the sample standard deviation is 1.8708 against a mean of 5.5, which says a typical value lands roughly 1.9 from the centre.

How the calculation works

Every version of the calculation starts the same way: find the mean, measure how far each value sits from it, square those distances so that positive and negative deviations stop cancelling, and average the squares. The only decision is what to divide by. For a sample, the divisor is one less than the count:

s = √( ((x1m)² + (x2m)² + … + (xnm)²) ÷ (n − 1) )

where m is the mean and n is the count. For a full population the divisor is plain n. The quantity under the square root is the variance, so the variance this calculator reports is simply the square of the standard deviation, matching whichever divisor the segmented control selects. The last output, the standard error of the mean, answers a different question — not how spread out the values are, but how uncertain the computed mean itself is:

SEM = s ÷ √n

It always uses the sample standard deviation, whichever mode is selected, and it shrinks as the count grows.

The default list, worked by hand

The default list — 4, 8, 6, 5, 3, 7 — is small enough to follow every step. The six values sum to 33, so the mean is 33 ÷ 6 = 5.5. The deviations from the mean are −1.5, 2.5, 0.5, −0.5, −2.5 and 1.5, their squares are 2.25, 6.25, 0.25, 0.25, 6.25 and 2.25, and those squares add up to 17.5. Treating the list as a sample divides by 5, giving a variance of 3.5 and a standard deviation of √3.5 = 1.8708. Treating it as a complete population divides by 6 instead, giving a variance of 2.9167 and a standard deviation of 1.7078. The standard error of the mean is 1.8708 ÷ √6 = 0.7638, so the estimate of 5.5 for an underlying mean carries an uncertainty of roughly three quarters of a unit. The sample figure is never the smaller of the two, since dividing by a smaller number cannot shrink the result; they coincide only when every value is identical and both read zero.

From astronomers' errors to Pearson's name

The quantity is far older than its name. It grew out of the theory of errors that astronomers built up through the eighteenth and nineteenth centuries, when the pressing problem was what to do with repeated observations of the same object that stubbornly refused to agree. Legendre published the method of least squares in 1805, in an appendix to a treatise on comet orbits; Gauss then claimed to have used it since 1795, and the resulting priority dispute was never settled. In Gauss's hands the theory of errors acquired a natural measure of an instrument's precision — a root-mean-square average of the errors, which he named the mean error in 1821 — in substance the same calculation this page performs, aimed at telescopes rather than data sets.

The name came from Karl Pearson, who introduced "standard deviation" while assembling the vocabulary of modern statistics. According to Jeff Miller's Earliest Known Uses of Some of the Words of Mathematics, which relies on the Dictionary of Scientific Biography for the detail, Pearson first used the term in a lecture of 31 January 1893, as a plainer substitute for older names like "root mean square error", and it reached print in his 1894 paper "Contributions to the Mathematical Theory of Evolution" in the Philosophical Transactions of the Royal Society. There, as the OED citation reproduced in Miller's list records, page 80 reads "Then σ will be termed its standard-deviation (error of mean square)". The exact lecture date rests on that single chain of sources, but the 1893 coinage itself is not in doubt. The companion terms came later: the same reference credits G. Udny Yule with introducing "standard error" in 1897 in his work on correlation theory, and R. A. Fisher with coining "variance" for the square of the standard deviation in a 1918 paper — "We shall term this quantity the Variance".

Why the sample formula divides by n − 1

The n − 1 divisor is known as Bessel's correction, after the astronomer Friedrich Bessel, though MathWorld, citing Kenney and Keeping, notes the correction is probably more properly attributed to Gauss, who used it in this connection as early as 1823. The reason it exists is a subtle bias. When the data is a sample, the true mean of the underlying population is unknown, so the deviations have to be measured from the sample's own mean instead — and the sample mean is, by construction, the value that sits closest to the sample. Deviations measured from it come out systematically smaller than deviations from the true mean would, so dividing by n understates the population variance on average. Dividing by n − 1 inflates the result by just enough to cancel that bias in the variance, and only in the variance: the square root is a concave function, so the sample standard deviation itself still runs slightly low on average. Another way to see it is through degrees of freedom: once the sample mean is fixed, only n − 1 of the deviations remain free to vary, because all of them must sum to zero. The correction matters most when samples are small — with six values the two divisors differ by 20 percent, with sixty values by under 2 percent — which is why the distinction fades from view in large data sets.

Choosing sample or population, and why not the range

The choice between the two modes is a question about the data's ambition, not its size. Choose population when the list in the box is everything there is to talk about: the scores of one specific class, the ages of a committee's members, one year's twelve monthly revenue figures. Choose sample — the default — when the values stand in for something larger: a batch of measurements meant to characterise a process, survey responses meant to describe a wider group, or any case where the interest lies in the whole from which the list was drawn. At small sizes the choice matters: the same six numbers read 1.8708 as a sample and 1.7078 as a population, a difference of almost 10 percent. When in doubt, sample is the safer answer, since it errs on the side of admitting uncertainty rather than overstating precision.

The standard deviation also earns its keep against the simpler alternative. The range — largest value minus smallest, 8 − 3 = 5 for the default list — is quicker to compute but depends on only two values, the most extreme ones, and a single outlier rewrites it completely. The standard deviation lets every value vote: appending one wild reading to a long, tight list barely moves it, while the range can triple on the spot. That resistance to being captured by two data points is what makes the standard deviation the default measure of spread, and the variance that sits underneath it is the quantity that statistical theory is actually built on, since variances of independent quantities add where standard deviations do not.

Assumptions worth knowing

The parser splits the input on commas and any whitespace, accepts anything JavaScript reads as a number, including scientific notation such as 2e3, and silently skips the rest, so units and stray labels do no harm. If nothing in the box parses as a number, the calculator says so rather than guessing. Sample mode needs at least two values, because dividing by n − 1 is impossible with one; population mode accepts a single value and reports a standard deviation of zero, with the standard error shown as a dash, since that is a sample-based quantity with no meaning for one observation. Values larger in magnitude than 10 billion are rejected with an error naming the offending entry — a ceiling that keeps results displaying cleanly — while a value of exactly 10 billion still passes. All arithmetic runs at full floating-point precision and the displayed figures are rounded to four decimal places, so a result shown as 1.8708 carries more digits underneath, and the variance shown can differ in its last digit from the square of the rounded standard deviation.

Frequently asked questions

What is the difference between sample and population standard deviation?

Both start from the same squared deviations from the mean; the sample version divides their sum by n − 1 before taking the square root, while the population version divides by n. For the list 4, 8, 6, 5, 3, 7 that gives 1.8708 as a sample and 1.7078 as a population. Use sample when the values stand in for a larger group, and population when the list is the entire set of interest.

Why does standard deviation divide by n minus 1?

Deviations are measured from the sample's own mean, which by construction sits closer to the sample values than the true population mean does, so the raw average of squared deviations understates the population variance. Dividing by n − 1, known as Bessel's correction after Friedrich Bessel, removes that bias from the variance; MathWorld, citing Kenney and Keeping, notes the correction is probably more properly attributed to Gauss, who used it as early as 1823. The adjustment matters most for small samples and fades as the count grows.

What is the standard error of the mean?

It is the sample standard deviation divided by the square root of the count, and it measures how uncertain the computed mean is rather than how spread out the data is. For the default six values it comes to 1.8708 divided by the square root of 6, about 0.7638. The term standard error is credited to G. Udny Yule in 1897 by Jeff Miller's Earliest Known Uses of Some of the Words of Mathematics.

Who invented the standard deviation?

The calculation predates the name: the theory of errors that astronomers developed, notably in the hands of Gauss, already used a root-mean-square measure of observational scatter. The name standard deviation was coined by Karl Pearson in the early 1890s; according to Jeff Miller's Earliest Known Uses of Some of the Words of Mathematics, drawing on the Dictionary of Scientific Biography, Pearson first used it in a lecture on 31 January 1893, and it appeared in print in 1894.

Is standard deviation better than the range?

For most purposes, yes. The range uses only the largest and smallest values, so one outlier rewrites it completely, while the standard deviation weighs every value and moves only a little when a single extreme reading joins a long list. The range is still a quick first look; for the default list 4, 8, 6, 5, 3, 7 it is 8 − 3 = 5, against a sample standard deviation of 1.8708.

What does a standard deviation of 2 mean?

It means a typical value sits about 2 units from the mean, in the same units as the data itself. A standard deviation near zero says the values bunch tightly around the mean; a larger one says they spread out. Whether 2 counts as large depends entirely on the scale of the data, so read it alongside the mean: 2 against a mean of 5 is substantial spread, 2 against a mean of 500 is barely any.