Standard Deviation Calculator

Standard deviation calculator for a list of numbers.

Science Sample & population Bessel's correction
Rate this calculator · 5.0 (2)

Standard Deviation Calculator

sample & population standard deviation · variance · mean · min/max · n up to 10,000

Instructions — Standard Deviation Calculator

1

Paste your data set

Enter the numbers in the textarea — commas, spaces, semicolons and new lines all work as separators. Negative numbers and decimals are fine. The calculator strips anything that does not parse as a number, so pasting from a spreadsheet column with stray labels rarely breaks it.

2

Read both flavours of SD

The headline shows sample standard deviation (the n−1 form, also called s) and population standard deviation (the n form, also called σ). Use sample when your numbers are drawn from a larger population. Use population when your numbers are the entire group you care about.

3

Check the supporting stats

Count, mean, range and the two variances appear below. The sample variance s² equals s squared; the population variance σ² equals σ squared. The mean is the same in both cases — only the denominator of the variance changes.

Almost always pick sample. Unless you literally have every member of the population, n−1 is the right denominator. The bias correction is named after Friedrich Bessel.
Empirical rule: roughly 68% of values fall within 1 SD of the mean, 95% within 2 SD, and 99.7% within 3 SD — but only when the data is approximately normal.

Formulas

Standard deviation measures how far each value sits from the mean of the data. It is the square root of the variance, which is the average squared deviation from the mean. The difference between the sample and population forms is the denominator.

Mean
$$ \bar{x} = \frac{1}{n}\sum_{i=1}^{n} x_i $$
Arithmetic mean of n values. Same definition for sample mean and population mean μ.
Sample standard deviation (s)
$$ s = \sqrt{\frac{1}{n-1}\sum_{i=1}^{n} (x_i - \bar{x})^2} $$
Divides by n−1 (Bessel's correction) to give an unbiased estimator of the population variance. This is what R's sd(), Python's statistics.stdev() and Excel's STDEV.S compute.
Population standard deviation (σ)
$$ \sigma = \sqrt{\frac{1}{n}\sum_{i=1}^{n} (x_i - \mu)^2} $$
Divides by n. Correct only when the numbers represent the whole population, not a sample. This is Excel's STDEV.P and NumPy's default np.std().
Variance (s², σ²)
$$ s^2 = \frac{\sum (x_i - \bar{x})^2}{n-1} \qquad \sigma^2 = \frac{\sum (x_i - \mu)^2}{n} $$
Variance is the SD squared. The sum of squared deviations stays the same; only the denominator changes.
Standard error of the mean
$$ SE = \frac{s}{\sqrt{n}} $$
How precisely the sample mean estimates the population mean. SE shrinks as the square root of n — a sample of 400 is twice as precise as one of 100, not four times.
Coefficient of variation
$$ CV = \frac{s}{\bar{x}} \times 100\% $$
A unit-free measure of relative spread. Useful when comparing variability across data sets on different scales. Undefined when the mean is zero.

Reference

Sample vs population — when to use which
SituationUseDenominator
30 students randomly picked from a school of 1,000Sample (s)n − 1
Closing prices of one stock over the last 250 trading daysSample (s)n − 1
Heights of every student in a single class of 28Population (σ)n
SAT scores of all test-takers in 2024Population (σ)n
50 quality-control samples drawn from a production lineSample (s)n − 1

The empirical (68–95–99.7) rule

For an approximately normal distribution, the fraction of values that fall within k standard deviations of the mean is fixed. NIST/SEMATECH calls this the "empirical rule" (sometimes the "three-sigma rule").

±kσ intervals (normal)
kP( |X − μ| ≤ kσ )
0.538.29%
1.068.27%
1.586.64%
2.095.45%
2.598.76%
3.099.73%
4.099.9937%
5.099.99994%
Typical CV values
CV (s/x̄)Interpretation
< 5%very low spread
5–15%moderate
15–30%noticeable
> 30%high — check for outliers

The calculator uses the same two-pass formula NIST/SEMATECH recommends: compute the mean first, then sum the squared deviations. One-pass formulas using only sums and sums-of-squares are faster but lose precision badly for large n with values close together.

Article — Standard Deviation Calculator

Standard deviation: a practical guide to measuring spread

A standard deviation calculator returns two related numbers from a list of values: the sample standard deviation (s, computed with the n minus one divisor) and the population standard deviation (sigma, computed with the n divisor). Sample is the right choice for almost every real data set. The calculator above uses the two-pass formula the NIST/SEMATECH e-Handbook of Statistical Methods recommends, the same approach used by R's sd function and SciPy's scipy.stats.tstd.

Standard deviation measures the typical distance between each value and the mean. Small means the data clusters tightly; large means it spreads. The units match the data, which is why SD is reported more often than variance.

What the standard deviation calculator does

Paste numbers into the textarea. Commas, spaces, semicolons and new lines all work as separators, so a copy out of a spreadsheet column or a comma-separated CSV row both parse cleanly. Negative numbers and decimals are fine; anything that does not parse is dropped silently. The headline shows sample SD first, population SD beneath. The grid below adds count, mean, sample variance, population variance, sum, range, min and max.

The calculation uses the two-pass formula: compute the mean, then sum the squared deviations, then divide. The one-pass form that uses only sum-of-values and sum-of-squared-values is faster but loses precision when values are large and close together. The two-pass form is what statistical software defaults to.

The math, in one line
mean = sum(x) / n
SS = sum((x - mean)^2)
s = sqrt(SS / (n-1)) sigma = sqrt(SS / n)

Sample vs population standard deviation

The two flavours differ by one in the denominator. Sample uses n minus one; population uses n. For 30 values the difference is about 1.7%; for 100 values, 0.5%; for 1,000 values, 0.05%. The distinction matters most for small samples, which is exactly when people most need it.

Use sample whenever the numbers are drawn from a larger group you cannot fully observe. A survey of 1,000 voters, 30 quality-control samples from a production run, daily returns of one stock over the last year — all should use s. Use the population form only when the data literally is the entire group: every student in one class of 28, every employee at a 50-person company.

Did you know

The annualised standard deviation of daily S&P 500 returns over the long run is approximately 16 percent. That is the headline volatility number used in option pricing, Sharpe ratios and value-at-risk models. Individual years swing widely: 2017 ran below 7 percent, while 2008 cleared 40 percent.

How to compute standard deviation by hand

For the values 2, 4, 4, 4, 5, 5, 7, 9 the mean is 40 divided by 8, which equals 5. The deviations from the mean are negative 3, negative 1, negative 1, negative 1, zero, zero, 2, 4. Squaring each gives 9, 1, 1, 1, 0, 0, 4, 16, which sum to 32.

For the population SD, divide 32 by 8 and take the square root: sigma equals 2 exactly. For the sample SD, divide 32 by 7 and take the square root: s equals approximately 2.138. These are the canonical "8 values, sigma = 2" example from introductory texts.

Do not round intermediate steps

Round the mean to two decimal places early and the squared-deviation sum drifts, sometimes by enough to change the SD at two decimal places. Always carry full precision through the calculation and round only the final SD. Statistical software does this automatically; spreadsheet calculations sometimes do not, especially when the mean is pasted as a value rather than referenced as a formula.

Bessel's correction and the n minus one divisor

Why n minus one instead of n for samples? Because the sample mean used in the deviation sum is itself an estimate. Using the same data to estimate the mean and then measure spread around that mean understates the spread, on average, by a factor of n minus one over n. Dividing by n minus one cancels that bias. The correction is named after Friedrich Bessel.

One way to see it: with two observations you have one degree of freedom in the spread. With n observations you have n minus one degrees of freedom for variance. The divisor counts degrees of freedom, not raw observations.

  • n = 2: sample SD overstates by factor of √2 over √1 = 1.414 vs the n-divisor form
  • n = 10: sample over population ≈ 1.054 (5.4% larger)
  • n = 30: ratio ≈ 1.017 (1.7% larger)
  • n = 100: ratio ≈ 1.005 (0.5% larger)
  • n = 1,000: ratio ≈ 1.0005 (0.05% larger)
  • n = 1: sample SD is undefined; population SD is zero

The empirical rule for spread

For normally distributed data, NIST/SEMATECH calls this the empirical rule: roughly 68 percent within plus or minus one SD, 95 percent within plus or minus two SD, 99.7 percent within plus or minus three SD. Six-sigma manufacturing programmes target 99.99966 percent in-spec parts.

The empirical rule fails for skewed distributions or heavy tails. A quick histogram check tells you whether to trust it. US household income is heavily right-skewed: the empirical rule would predict negative incomes within one SD below the mean, which is not what happens. Always look at the shape of the data, not just the summary.

±1σ
68.27%
of normal-distributed data
±2σ
95.45%
of normal-distributed data

Standard deviation in finance

Volatility in finance is the annualised standard deviation of asset returns. A daily SD of one percent on US equity returns scales to about 16 percent annual (multiply by √252 trading days). Bonds run 5 to 8 percent. Single stocks run 25 to 60 percent. Standard deviation enters the Sharpe ratio, the Black-Scholes option formula and value-at-risk: a one-day 99 percent VaR is roughly 2.33 times the daily SD under a normal assumption.

Tip

The Sharpe ratio divides excess return by SD. Long-run S&P 500 Sharpe ratios run around 0.4 to 0.5. A fund advertising a Sharpe of 2 or above is either exceptional or running with too short a track record. Be sceptical of Sharpe ratios from fewer than three years of monthly data.

Standard deviation in quality control

Manufacturing tolerances are expressed in sigma. A line targeting 100 mm parts with a tolerance of plus or minus one millimetre wants the process SD small enough that three sigma (99.7 percent of parts) falls inside the tolerance. The six-sigma methodology Motorola popularised in the 1980s targets a process where plus or minus six SD fits within the band, corresponding to 3.4 defects per million parts after allowing for drift.

Common mistakes when measuring spread

The most common error is using sigma (population) when s (sample) is correct. Excel's STDEV.P is population; STDEV.S is sample. NumPy's default np.std is population, while R's sd() and Python's statistics.stdev() default to sample. Compare carefully across tools.

The second common error is comparing SD across data sets on different scales. Weights in kg are not directly comparable to heights in cm; use the coefficient of variation (SD divided by mean) for unit-free comparison. The third is trusting the empirical rule on non-normal data — income and trade-size data are heavy-tailed and skewed, and the 68-95-99.7 percentages will mislead.

FAQ

Standard deviation is the square root of the variance. It measures the typical distance between each value in a data set and the mean. A small SD means the values cluster tightly around the mean; a large SD means they spread widely. SD has the same units as the data, which is why it is preferred over variance for reporting.
Population SD (σ) divides the sum of squared deviations by n. Sample SD (s) divides by n−1. The n−1 form, called Bessel's correction, gives an unbiased estimator of the population variance when your data is a sample. Use s in almost every real-world case — the only time to use σ is when your data covers the entire population.
Using the sample mean instead of the (unknown) population mean shrinks the sum of squared deviations slightly, which would bias variance downward if divided by n. Dividing by n−1 corrects that bias. The intuition: one degree of freedom was already "used up" to estimate the mean.
Variance is the average squared deviation from the mean. SD is its square root. Variance has units like dollars² or kg², which is hard to read; SD has the original units. Variance has nicer mathematical properties (it adds for independent variables), so theory uses variance and reports SD.
For an approximately normal distribution: 68.27% of values fall within ±1 SD of the mean, 95.45% within ±2 SD, and 99.73% within ±3 SD. The rule fails for skewed or heavy-tailed data — always check a histogram before relying on it. NIST/SEMATECH calls this the empirical rule.
No. SD is a square root, so it is always ≥ 0. SD equals exactly zero only when every value in the data set is identical — there is no spread to measure. If your software returns a tiny negative SD, that is floating-point noise on what should be zero.
In finance SD is the standard measure of volatility: the SD of an asset's returns. Annualized SD of S&P 500 daily returns runs around 16% historically. A portfolio with higher SD is more risky in the mean-variance sense. SD is one input to Sharpe ratio, value-at-risk, and Markowitz optimisation.
The calculator shows both. The first headline value is the sample SD (s, with n−1); below it is the population SD (σ, with n). For n = 1, sample SD is undefined — you cannot estimate spread from one observation.
Two is the strict minimum for sample SD. In practice, with n < 10 the estimate is very noisy; n = 30 is a common rule of thumb for an SD estimate stable enough for inference. The calculator handles up to 10,000 values.
SD has the same units as the data, so comparing the SD of weights in kg to the SD of heights in cm is meaningless. The coefficient of variation (CV = s / mean) is unit-free and compares well across scales. A CV of 15% means the SD is 15% of the mean.