Standard Deviation Calculator

Enter any data set and get both standard deviations at once: the population σ and the sample s, plus variance, the margin of error and a table showing exactly how far every value sits from the mean.

What you get
  • σ and s side by sideBoth divisors computed at once, so no re-running.
  • Every deviation listedSee how far each value sits from the mean, squared and raw.
  • 95% margin of errorA ready-to-use confidence band around your mean.

Your data set

Results update as you type

Decimals and negative numbers are fine, so 4.75 and -12 both work. Values separated by tabs or line breaks paste straight in from a spreadsheet.
Both values are always calculated. This choice sets which one leads the results, which deviation view the chart shades, and which variance the deviation table breaks out. Rounding only changes how results are displayed. Every calculation runs at full precision.

Runs entirely in your browser. Nothing you paste is sent or saved

Standard deviation guide

What standard deviation is

Standard deviation answers one question: how far do the values in a data set typically sit from their average? A small standard deviation means the values cluster tightly around the mean; a large one means they scatter widely. It is written σ (sigma) for a whole population and s for a sample, and it always carries the same units as the data itself, which is what makes it so readable. A standard deviation of 8.7 points on a test whose average is 83.5 tells you that scores of 75 to 92 are entirely ordinary.

This page works through the example set 1, 3, 4, 7, 8 step by step, so you can check every figure against the calculator above.

The two formulas: population σ and sample s

Both versions start the same way: subtract the mean from every value, square each difference, and average the squares. That average is the variance, and its square root is the standard deviation. They differ only in the divisor:

σ = √[ Σ(xi - μ)2 ÷ N ]

Population standard deviation: divide by N, the total number of values, because the data covers the entire group you care about.

s = √[ Σ(xi - x̄)2 ÷ (N - 1) ]

Sample standard deviation: divide by N - 1. A sample's spread tends to run slightly smaller than the population it came from, because a small sample rarely catches the most extreme values. Dividing by N - 1 instead of N inflates the result just enough to correct that bias. The correction is called Bessel's correction, after the astronomer Friedrich Bessel.

Which one should you use? If your data includes every member of the group you are describing, use σ. If your data is a sample and you want to say something about the larger group, use s. Comparing the 30 students in one classroom against each other is a population question; estimating the average height of all students in the country from those 30 is a sample question.

A worked example: 1, 3, 4, 7, 8

Five values. The sum is 23, so the mean is 23 ÷ 5 = 4.6.

Step 1, the deviations. Subtract the mean from each value: -3.6, -1.6, -0.6, 2.4 and 3.4. They always add up to exactly zero, which is a handy check that the mean was computed correctly.

Step 2, the squared deviations. Squaring removes the minus signs and gives the big distances extra weight: 12.96, 2.56, 0.36, 5.76 and 11.56. Their sum is 33.2.

Step 3, divide and take the square root. For the population version, divide 33.2 by N = 5 to get a variance of 6.64, and take its square root: σ = √6.64 ≈ 2.577. For the sample version, divide 33.2 by N - 1 = 4 to get a variance of 8.3, so s = √8.3 ≈ 2.881. The sample figure is always the larger of the two.

Step 4, the margin of error. The standard error of the mean is s ÷ √5 ≈ 1.288, and the 95% margin of error is 1.96 × 1.288 ≈ 2.525. Read that as: if these five values were a random sample, the population mean would very likely fall somewhere between 2.07 and 7.13.

Where standard deviation is used

  • Quality control: a factory tracks a measurement such as fill volume or part width against its mean. Values drifting beyond two or three standard deviations signal that the process is slipping long before defective products reach customers.
  • Weather and climate: two cities can share a mean temperature of 75°F and be completely different places to live. A coastal city with a standard deviation of 6 degrees stays mild all year, while an inland city with 18 degrees swings from freezing winters to scorching summers. The same trick applies to test scores across schools and delivery times across couriers.
  • Finance: the standard deviation of an investment's returns is the standard yardstick of volatility, and therefore of risk. Two funds with the same average return are not equally attractive if one gets there with half the wobble; most financial websites quote volatility exactly this way.

How much data lies within k standard deviations?

For roughly bell-shaped data, the 68-95-99.7 rule gives dependable shares: about 68% of values within one standard deviation of the mean, 95% within two, and 99.7% within three. Those percentages belong to the bell curve, though, not to every data set. For data of any shape at all, Chebyshev's inequality sets a floor that always holds:

at least 1 - 1/k2 of values lie within k standard deviations of the mean

k is any number greater than 1 · within 2 SD: at least 75% · within 3 SD: at least 89% · within 5 SD: at least 96%

The practical reading: even when a distribution is skewed or lumpy, values more than three standard deviations from the mean are rare, at most about 1 in 9. When such a value shows up in your data, it deserves a second look before you let it into the average.

Standard deviation in Excel, Sheets and Python

The same two formulas hide behind different names in everyday software, and picking the wrong one is a common silent mistake:

  • Excel: =STDEV.S(range) computes the sample standard deviation and =STDEV.P(range) the population one. The older STDEV and STDEVP functions still work and behave the same way.
  • Google Sheets: =STDEV(range) is the sample version and =STDEVP(range) is the population version.
  • Python: NumPy's np.std(data) divides by N by default, so it returns σ; pass ddof=1 to get the sample version. Pandas is the opposite: df.std() divides by N - 1 by default.
  • Graphing calculators: the Sx and σx symbols on the one-variable statistics screen are exactly the sample and population figures reported above.

Whichever tool you use, the habit is the same: decide first whether your data is a population or a sample, then choose the function that matches.

Using the calculator well

  • Pick the divisor deliberately: the results show both σ and s at all times, and the Highlight option just chooses which one leads. Report whichever one matches how you will use the number, and say which one you used.
  • Check the deviations table: a single mistyped value, a salary of 100000 instead of 10000, produces a huge squared deviation and drags the standard deviation up with it. The table makes the culprit obvious at a glance.
  • Read it relative to the mean: a standard deviation of 5 means something very different on a mean of 10 than on a mean of 1,000. Comparing spread across data sets with different scales calls for the coefficient of variation, SD divided by the mean.
  • Remember the 68-95-99.7 rule: for roughly bell-shaped data, about 68% of values fall within one standard deviation of the mean, 95% within two, and 99.7% within three. The shaded band in the chart marks that first zone.
  • Small samples: with fewer than about 10 values, s is a rough estimate, and with exactly one value it is undefined (there is no N - 1 to divide by). The calculator falls back to σ in that case.

Standard deviation vs standard error

The two sound alike and answer different questions. The standard deviation describes the data you have: how widely individual values scatter around their mean. The standard error describes how precisely your sample mean estimates the true mean: it is the sample SD divided by √n, and it shrinks as the sample grows. For the example set, s is 2.881 while the standard error is 2.881 ÷ √5 = 1.288.

A useful slogan: the standard deviation answers "how spread out are the observations?", while the standard error answers "how much would the average move if I repeated the sample?" Error bars drawn on a mean in a research chart are usually the standard error, not the standard deviation, and confusing the two makes results look far more precise than they are.

A short history

The mathematics behind standard deviation was worked out in the late 1700s and early 1800s by Carl Friedrich Gauss and Pierre-Simon Laplace, who needed a way to measure the scatter in repeated astronomical observations. Gauss's method of least squares, published in 1809, is the direct ancestor of the formula in every statistics textbook today, along with the bell curve that gives the 68-95-99.7 rule its meaning.

The name came much later. In 1894, Karl Pearson delivered a lecture to the Royal Society in which he first used the phrase "standard deviation" for what had previously been called the modulus or the error of mean square. His terminology stuck, and so did the symbol σ. The N - 1 correction for samples is older still: it appears in work from the 1830s, but it became standard practice only after 1900, when statistical methods spread into biology, agriculture and industry through Pearson's laboratory and R. A. Fisher's writings.

Common questions

They use the same formula with one different divisor: σ divides the squared deviations by N and describes the entire group of interest, while s divides by N - 1 and estimates that spread from a sample. The sample value is always slightly larger. Use σ when your data is the whole population, and s when your data stands in for a bigger group.

Because a sample systematically underestimates the population's spread: small samples rarely contain the most extreme values, and the deviations are computed from the sample mean rather than the true one. Dividing by N - 1, a step called Bessel's correction, inflates the estimate by exactly the amount needed to remove that bias on average. With large samples the difference becomes negligible.

It is 1.96 times the standard error, which is the sample SD divided by the square root of n. If your data is a random sample, the true population mean very likely lies within that margin of your sample mean. It shrinks as your sample grows, because averages of bigger samples wobble less. This quick normal-based figure is most trustworthy when n is at least 30.

There is no absolute threshold, because the figure has the units of your data: 5 minutes is tiny for a flight delay and enormous for a microwave timer. The fair yardstick is relative. Compare it to the mean itself (the coefficient of variation) or to the range of values that matters in your context, such as a tolerance in manufacturing or a passing grade on a test.

It is never negative, because it is the square root of a sum of squares. It equals exactly zero when every value is identical, meaning there is no spread at all. Beyond that it can be any nonnegative number, and it grows quickly when outliers appear, because squaring gives large distances outsized influence.

No. Variance is the average of the squared deviations from the mean, and the standard deviation is its square root. They measure the same spread, but variance is in squared units (square dollars, square points), which is hard to interpret, while the standard deviation is back in the original units. That is why reports quote the SD and treat variance as an intermediate step.

With a single value there is nothing to divide by: the sample formula uses N - 1, which would be zero, and the spread of one value cannot be estimated from itself. The calculator shows the population figures instead, which remain defined. Enter at least two values to get a sample standard deviation.

Adding a constant leaves it untouched, and multiplying scales it by the same factor. Converting temperatures from Celsius to Fahrenheit does both: adding 273.15 kelvin-style changes nothing about the spread, while multiplying by 1.8 multiplies the standard deviation by 1.8, so 10 degrees of spread in Celsius is 18 degrees of spread in Fahrenheit. That is why unit-free comparisons use the coefficient of variation.

Never. A result called Popoviciu's inequality caps the standard deviation at half the range: the widest possible spread for values spanning R occurs when the data splits between the two extremes, and even then the SD only reaches R/2. In the worked example, s is 2.881 against a range of 7, comfortably inside the cap. If your computed SD ever exceeds half the range, a calculation or typo is to blame.

Quote the SD when you are describing the data itself, and the standard error, usually with a confidence interval, when you are estimating a population mean from a sample. Style guides such as the APA's ask for both: the mean with its SD to describe the sample, plus a confidence interval for the estimate. Label every figure explicitly, because readers routinely assume the wrong one.

No. Every calculation runs in your browser. Nothing is stored or transmitted.

Know the average? Now measure the spread.

Browse all math calculators