CALCULATORCASTLE

Standard Deviation Calculator

Calculate mean, variance, and standard deviation for any data set.

About

Standard Deviation Calculator

Standard deviation measures how spread out a set of numbers is. A low value means the data sits close to its mean. A high value means it is scattered. The symbol is the Greek letter sigma, written σ when you have measured a whole population and s when you have a sample of one.

The mean on its own hides this completely. Two datasets can average 18 and look nothing alike: 17, 18, 18, 19 has almost no spread, while 2, 8, 28, 34 has the same mean and no useful centre at all. The standard deviation is what tells those two apart, and it is why almost no serious result is ever reported as an average by itself.

Population standard deviation

Use this when your numbers cover every member of the group you care about: all 30 students in one class, all 12 machines on a production line, every transaction last Tuesday.

σ=1NNi=1(xiμ)2

where xᵢ is each individual value, μ is the mean, and N is how many values there are. The summation notation looks worse than the arithmetic is. It says: take each value, subtract the mean, square the result, add all of those up, divide by N, take the square root.

Working through 1, 3, 4, 7, 8: the mean is 23 divided by 5, which is 4.6. The squared deviations are 12.96, 2.56, 0.36, 5.76 and 11.56, adding to 33.2. Dividing by 5 gives a variance of 6.64, and the square root of that is 2.577.

The squaring is doing real work. Deviations from the mean always sum to zero, since the positives and negatives cancel by construction, so an average of the raw deviations would be zero for every dataset ever collected. Squaring makes them all positive, and taking the root at the end returns the answer to the units you started in.

Sample standard deviation

Usually you cannot measure everyone. You take a sample and use it to estimate the spread of the population behind it. The formula changes in one place:

s=1N − 1Ni=1(xi)2

Dividing by N - 1 instead of N is called Bessel's correction, after Friedrich Bessel. The reason is that you are measuring deviations from the sample mean rather than the true population mean, and the sample mean is, by definition, the value that sits closest to your own data. That makes the squared deviations slightly too small every time, not on average but in every sample. Dividing by a smaller number pushes the estimate back up by exactly the right amount: the expected value of Σ(xᵢ - x̄)² works out to (N - 1)σ², so dividing by N - 1 gives an unbiased estimate of the variance.

The correction matters most when N is small. With 5 values, N - 1 raises the variance by 25%. With 500 it changes it by 0.2%, which is why the choice stops mattering on large datasets.

One subtlety worth knowing, because it is where most explanations stop. Bessel's correction makes s² an unbiased estimator of σ², but taking the square root does not preserve that: s still underestimates σ on average. The exact fix is a factor called c4, which is 0.9400 for 5 values, 0.9727 for 10 and 0.9949 for 50. Almost nobody applies it, which is fine for most work, and this is what a statistician means by calling the usual formula the "corrected sample standard deviation" rather than the unbiased one.

Reading the answer

For data that follows a normal distribution, the standard deviation converts directly into proportions. About 68.27% of values fall within one standard deviation of the mean, 95.45% within two, and 99.73% within three. That is the empirical rule, and it is where the familiar 68-95-99.7 shorthand comes from.

Those figures assume a bell curve. When the data is skewed or has heavy tails, use Chebyshev's inequality instead, which holds for any distribution with a finite variance: at least 75% of values lie within two standard deviations of the mean, and at least 88.9% within three. Weaker, but true regardless of shape.

The variance, σ², is the same measurement before the square root. It has better mathematical behaviour, particularly that variances of independent quantities add, which is why it dominates the theory. It is awkward to report, because its units are squared: a variance of 24 on a set of temperatures is 24 degrees squared, which means nothing to a reader. The standard deviation of 4.899 degrees does.

Margin of error and the standard error

If you took a different sample you would get a different mean. The standard error of the mean measures how much that mean would move about, and it shrinks as the sample grows:

s=sN

Multiplying the standard error by a figure for your chosen confidence level gives a margin of error. The common ones are 1.645 for 90%, 1.960 for 95% and 2.576 for 99%. A 95% confidence interval means that if you repeated the whole exercise many times, about 95% of the intervals built this way would contain the true population mean. It does not mean there is a 95% chance the true mean sits in the one interval you happen to have, which is the single most common misreading of the phrase.

The √N in the denominator sets the economics of sampling. Halving your margin of error takes four times the data, and cutting it to a tenth takes a hundred times as much. That relationship, more than any other, is why survey samples cluster around a thousand people rather than ten thousand.

Where standard deviation is used

Manufacturing lives on it. Quality control sets tolerance limits as a number of standard deviations either side of target, and a process that drifts outside them gets stopped. The Six Sigma programme takes its name from putting the specification limits six standard deviations from the mean, which allows for 3.4 defective parts per million once a long-term drift of 1.5 sigma is assumed.

Climate makes the point vividly. Two cities can both average 75°F and be nothing alike. A coastal city sits between about 60 and 85 all year, because water has a high heat capacity and moderates the swings. An inland city with the same mean can run from 30 to 110. Same average, completely different place to live, and only the standard deviation shows it.

In finance the standard deviation of returns is what people mean by volatility. A stock averaging 7% a year with a standard deviation of 10% is a very different holding from one averaging 7% with a standard deviation of 50%, though the mean says they are identical. The second one can pay off much better, and can also lose far more, which is exactly what the wider spread is telling you. Daily volatility is normally annualised by multiplying by the square root of 252, the approximate number of trading days in a year, which gives about 15.87.

Beyond those, standard deviation is what a z-score is measured in, what test scores are scaled with, and how error bars on a scientific chart are drawn.

What it does not tell you

Standard deviation is sensitive to outliers, because squaring gives a distant point a great deal of weight. One mistyped value can double it. For data with genuine extremes, the interquartile range or the median absolute deviation describes the bulk of the distribution better.

It also says nothing about shape. Two datasets can share a mean and a standard deviation while one is symmetric and the other strongly skewed. Plot the numbers before drawing conclusions from any summary statistic, including this one.

Comparing spread between things measured on different scales needs the coefficient of variation, which is the standard deviation divided by the mean. A standard deviation of 5 is enormous on a mean of 10 and trivial on a mean of 10,000.

Notes on the calculator

Enter values separated by commas, spaces or new lines, and choose whether they are a population or a sample. The result panel gives the standard deviation with the count, sum, mean, variance, sum of squares and standard error. The step by step panel prints the working with your own numbers substituted, and the margin of error table runs eight confidence levels from 68.3% up to 99.9999%, each with an error bar drawn to scale. The frequency table underneath counts repeats, which is often where a data entry error shows up first.

Karl Pearson gave the measure its name in 1893. Before that it went by root mean square error, or Gauss's "mean error", and the concept had been in use for a century in astronomy and geodesy, where the whole problem was working out how much to trust a set of measurements that disagreed with each other.

Common questions

Frequently asked questions

Population if your numbers are the entire group you want to describe, such as the marks of all 30 students in one class when the class is the whole question. Sample if the numbers are a subset used to estimate something wider, such as 30 students standing in for a whole school. When in doubt choose sample: it gives the slightly larger, more cautious figure.

Because deviations are measured from the sample mean, which sits closer to your own data than the true population mean does. That makes the squared deviations too small every time. The expected value of the sum works out to (N - 1) times the population variance, so dividing by N - 1 rather than N corrects it exactly. This is the Bessel correction.

Variance is the average squared deviation from the mean; standard deviation is its square root. They carry identical information, but variance is in squared units, so a variance of 24 on temperature data is 24 degrees squared. The square root brings it back to 4.899 degrees, which a reader can actually use. Variance dominates the theory because variances of independent quantities add.

There is no universal threshold, because it depends entirely on the scale and the field. Compare it to the mean using the coefficient of variation, standard deviation divided by mean: 5 on a mean of 10 is huge, 5 on a mean of 10,000 is nothing. Compare it against typical values for the same kind of measurement rather than against an abstract cutoff.

No. It is a square root of a sum of squares, so the smallest possible value is zero, which happens only when every number in the set is identical. If a calculation produces a negative value, something has gone wrong, most often a variance computed as the mean of squares minus the square of the mean where floating point rounding has pushed a near-zero result below zero.

It shows how far the true mean could plausibly sit from your sample mean at each confidence level. The 95% row is the one most fields report. Read it as: repeat this whole study many times and about 95% of the intervals built this way would contain the real mean. It is a statement about the procedure, not a probability attached to your one interval.

Two is the arithmetic minimum for a sample standard deviation, since N - 1 has to be at least 1, but an estimate from a handful of values is very unstable. Below about 10 the figure carries a noticeable downward bias even with the Bessel correction, and 30 is the usual rule of thumb for the point where the estimate settles down. More is better, and the standard error falls with the square root of the count.

Only for data that is roughly normally distributed. For skewed data or anything with heavy tails, use the Chebyshev inequality, which holds for any distribution with a finite variance: at least 75% of values lie within two standard deviations and at least 88.9% within three. Plot the data first; a histogram tells you which of the two applies.