Standard Deviation Calculator

Paste your numbers to get the sample standard deviation (s) and the population standard deviation (σ) together with the variance, mean, standard error and a step-by-step solution.

Separate values with commas, spaces or new lines. Pasting a column from Excel or Google Sheets works.

Standard Deviation Formulas

Sample: s = √( Σ(xᵢ − x̄)² ÷ (n − 1) )

Population: σ = √( Σ(xᵢ − μ)² ÷ N )

Variance = standard deviation², so s² and σ² are the values under the roots

Standard error of the mean: SEM = s ÷ √n

Coefficient of variation: CV = s ÷ |x̄|

Both versions measure the typical distance between the values and their mean, in the same units as the data. They differ only in the divisor: the sample formula uses n − 1, the population formula uses N.

Sample or Population Standard Deviation?

  • Sample (s, divide by n − 1), your numbers are a subset used to learn about a larger group: a survey of 200 customers, ten test batches, a week of readings meant to describe a typical day. This is the right choice in most real work and the default in Excel’s STDEV.S, R’s sd() and the Sx value on a TI-84.
  • Population (σ, divide by N), your numbers are every member of the group you are describing: all 30 students in one class, every transaction in a closed account. Excel calls it STDEV.P and the TI-84 shows it as σx.

Why n − 1? A sample mean is computed from the same values, so the values sit closer to their own mean than to the true population mean. Dividing by n would underestimate the variance on average; dividing by n − 1 (Bessel’s correction) makes the sample variance unbiased. The two standard deviations differ by a factor of √(n ÷ (n − 1)): about 11.8% for n = 5, 1.7% for n = 30 and 0.5% for n = 100. If you are unsure, use the sample standard deviation. The full argument is in why we divide by n − 1.

How to Calculate Standard Deviation Step by Step

Take the data set 4, 8, 6, 5, 12 (n = 5):

xx − x̄(x − x̄)²
4−39
811
6−11
5−24
12525
Σ = 35Σ = 0Σ = 40
  1. Find the mean: (4 + 8 + 6 + 5 + 12) ÷ 5 = 35 ÷ 5 = 7.
  2. Subtract the mean from every value. The deviations always add up to zero, which is a handy check.
  3. Square each deviation (this removes the signs) and add them: SS = 9 + 1 + 1 + 4 + 25 = 40.
  4. Divide by n − 1 = 4 for the sample variance, s² = 10, or by n = 5 for the population variance, σ² = 8.
  5. Take the square root: s = √10 ≈ 3.1623 and σ = √8 ≈ 2.8284.

The median of these numbers is 6, a little below the mean of 7, because the one large value (12) pulls the mean up. The standard error of the mean is s ÷ √n = 3.1623 ÷ √5 ≈ 1.4142, and the coefficient of variation is 3.1623 ÷ 7 ≈ 45.18%.

Standard Deviation from a Frequency Table

When values repeat, list each distinct value once with its frequency f. Every value counts f times, so n = Σf, the mean is Σ(f · x) ÷ n and the sum of squares is Σ f · (x − x̄)². Choose Values with frequencies in the calculator and press Load example to see exam scores of 60 (twice), 70 (5 times), 80 (8 times), 90 (4 times) and 100 (once): n = 20, mean 78.5, sample standard deviation 10.3999 and population standard deviation 10.1366. Typing all twenty scores as a plain list gives exactly the same answer.

Standard Deviation in Excel, Google Sheets, TI-84, R and Python

ToolSample (s)Population (σ)
Excel=STDEV.S(A1:A5)=STDEV.P(A1:A5)
Google Sheets=STDEV(A1:A5) or =STDEV.S(A1:A5)=STDEVP(A1:A5) or =STDEV.P(A1:A5)
TI-84STAT → CALC → 1-Var Stats → SxSame screen → σx
Rsd(x)sqrt(mean((x - mean(x))^2))
Python (statistics)statistics.stdev(x)statistics.pstdev(x)
Python (NumPy)numpy.std(x, ddof=1)numpy.std(x)

NumPy’s std divides by N unless you pass ddof=1, a common source of mismatches with Excel and R. More calculator-screen walkthroughs are in the TI-84 statistics functions guide.

How to Interpret Standard Deviation

  • A standard deviation of 0 means every value is identical; the larger it is, the more spread out the data.
  • It has the same units as the data, so compare it with the mean: a spread of 5 points means something very different for an exam average of 80 than for one of 10. The coefficient of variation expresses that ratio as a percentage.
  • For bell-shaped data, about 68%, 95% and 99.7% of values lie within 1, 2 and 3 standard deviations of the mean (the empirical rule). For any distribution, at least 75% lie within 2 and at least 88.9% within 3 (Chebyshev’s inequality).
  • The z-score of a value is how many standard deviations it lies above or below the mean.
  • Do not confuse it with the standard error: the standard deviation describes individual values, while the standard error s ÷ √n describes how precisely the sample mean is known. See standard error vs standard deviation.

When Standard Deviation Can Mislead

  • Outliers. Deviations are squared, so one extreme value can dominate. Check for them with the outlier calculator and compare the result with and without them.
  • Skewed data. The mean ± standard deviation summary assumes a roughly symmetric shape; for skewed data the median with the interquartile range or the mean absolute deviation is often more informative.
  • Small samples. With five values the estimate of the spread is very rough; it settles down at around 20–30 observations.
  • Mixed groups. Combining two different populations inflates the spread. To combine the spreads of separate groups correctly, use the pooled standard deviation.

Frequently Asked Questions

Should I use the sample or the population standard deviation?

Use the sample standard deviation (divide by n − 1) when your numbers are a sample drawn from a larger group, which is the usual case for surveys, experiments and quality checks. Use the population standard deviation (divide by N) only when your numbers include every member of the group you are describing. If you are unsure, use the sample version. This calculator shows both at once.

Why does the sample formula divide by n − 1?

The sample mean is calculated from the same values, so the values are on average closer to it than to the true population mean, and dividing by n would underestimate the variance. Dividing by n − 1 (Bessel's correction) makes the sample variance an unbiased estimate of the population variance. The sample standard deviation is still very slightly low on average, but the gap shrinks quickly as n grows.

How do I find the standard deviation of a frequency table?

Set the data format to "Values with frequencies" and enter one value and its frequency per line, such as "80 8" for eight scores of 80. Each value is treated as if it appeared that many times: n is the sum of the frequencies, the mean is Σ(f · x) ÷ n, and the sum of squares is Σ f · (x − x̄)². The result is identical to typing every repeated value out.

What is the difference between standard deviation and variance?

Variance is the standard deviation squared. Both measure spread, but variance is in squared units (square metres, points squared), while the standard deviation is in the same units as the data, which makes it easier to interpret. Variance is convenient in formulas because variances of independent quantities add.

What is the difference between standard deviation and standard error?

The standard deviation describes how spread out individual values are. The standard error of the mean, s ÷ √n, describes how precisely the sample mean estimates the population mean, and it shrinks as the sample grows while the standard deviation does not.

What counts as a high or low standard deviation?

There is no universal cut-off, because the standard deviation carries the units of the data. Compare it with the mean (the coefficient of variation) and with similar data sets: a standard deviation of 2 cm is large for a 10 cm part and tiny for a 2 m beam. A standard deviation of exactly 0 means all the values are the same, and it can never be negative.

How do outliers affect standard deviation?

Strongly, because each deviation is squared before averaging. One extreme value can inflate the result far more than it moves the median or the interquartile range. Calculate the statistic with and without suspected outliers, and consider reporting the median and interquartile range for skewed data.

How many values do I need?

The sample standard deviation needs at least two values, and the population standard deviation is defined for one (it is 0). Spread estimates from very few values are unstable; around 20 to 30 observations give a noticeably more reliable picture than 5.

Embed This Calculator

Add this free calculator to your course page or LMS.

Adjust the height value to fit your page.