Standard Deviation Calculator

Paste a data set to get the standard deviation, variance, mean, median, and range, with the choice between sample and population formulas and the working shown.

Separate values with commas, spaces, or line breaks. At least two values are needed.

Data set type

Sample standard deviation

7.111359

n = 7, mean = 21.714286

  • Count (n)7
  • Sum152
  • Mean21.714286
  • Median22
  • Variance50.571429
  • Minimum12
  • Maximum31
  • Range19
  • Coefficient of variation32.75%
  • Standard deviation7.111359

How this was calculated

mean = 152 ÷ 7 = 21.714286

Σ(x − mean)² = 303.428571

variance = 303.4286 ÷ 6 = 50.571429

σ = √50.5714 = 7.111359

What standard deviation tells you

Standard deviation measures how spread out a set of numbers is around its mean. A small value means the data clusters tightly; a large value means it is dispersed. Because it is expressed in the same units as the original data, it is directly interpretable in a way variance is not.

Two data sets can share an identical mean and behave completely differently. The sets {48, 49, 50, 51, 52} and {10, 30, 50, 70, 90} both average 50, but the first has a standard deviation near 1.6 and the second near 31.6. Reporting a mean without a measure of spread hides most of what is interesting about the data.

A worked example

Take the eight values 2, 4, 4, 4, 5, 5, 7, 9. Their mean is 5. Subtract the mean from each value, square the differences, and add them up; the population variance is that sum divided by 8, and the standard deviation is its square root. The sample version divides by 7 instead.

Deviations from the mean of 5
ValueDeviationSquared deviation
2-39
4-11
4-11
4-11
5+00
5+00
7+24
9+416
Sum = 40Sum = 0Sum = 32

Sample versus population, and why n−1

The population formula divides the sum of squared deviations by n. The sample formula divides by n−1. Use the population formula only when your data covers every member of the group you care about — the test scores of all 30 students in a class, if the class is the whole subject of interest. Use the sample formula when your data is a subset used to estimate a larger group, which is the more common situation.

The n−1 adjustment is Bessel's correction. A sample's own mean is, by construction, the value that minimizes the squared deviations within that sample, so deviations measured from it are systematically smaller than deviations from the true population mean. Dividing by n−1 rather than n compensates for this bias. The difference matters most with small samples: at n=5 it inflates the estimate by about 12%, while at n=1000 it is negligible.

Sample and population formulas side by side
SamplePopulation
Divide byn − 1n
Use whenData are a subset standing in for a larger groupData are the whole group of interest
Symbolsσ
EffectSlightly larger; corrects the downward bias of using the sample meanExact for the data in hand
For the example (8 values)√(32 ÷ 7) = 2.1381√(32 ÷ 8) = 2.0000

The empirical rule

For roughly bell-shaped data, about 68% of values fall within one standard deviation of the mean, about 95% within two, and about 99.7% within three. This is what makes standard deviation useful for judging whether an individual observation is unusual.

With a mean of 100 and a standard deviation of 15, a value of 130 sits two standard deviations above the mean, placing it above roughly 97.5% of the distribution. The rule assumes approximate normality, so it should not be applied to strongly skewed data or distributions with heavy tails.

The 68–95–99.7 rule for a normal distribution
WithinShare of valuesOutside
±1σ68.27%31.73%
±2σ95.45%4.55%
±3σ99.73%0.27%

Related measures

Variance is the square of the standard deviation. It has useful mathematical properties — variances of independent variables add — but its units are squared, so a variance of 25 square-dollars is hard to interpret directly.

The coefficient of variation, standard deviation divided by the mean and expressed as a percentage, allows comparison of spread between data sets with different scales or units. It is only meaningful for data with a true zero and a positive mean. For skewed data, the interquartile range often describes spread better than standard deviation, because it is not pulled around by outliers.

Measures of spread compared
MeasureDefinitionNotes
VarianceMean squared deviationSquared units; variances of independent variables add
Standard deviation√varianceSame units as the data
Coefficient of variationσ ÷ mean × 100%Compares spread across different scales; needs a positive mean
Standard error of the means ÷ √nHow precisely the sample mean estimates the population mean
Interquartile rangeQ3 − Q1Spread of the middle half; robust to outliers
Rangemax − minCrude; driven entirely by the two extremes

Frequently asked questions

Should I use sample or population standard deviation?

Use the sample formula (dividing by n−1) when your data is a subset being used to estimate a larger group, which covers most real analyses. Use the population formula (dividing by n) only when your data includes every member of the group you are describing.

Why does the sample formula divide by n−1?

It is Bessel's correction. Because deviations are measured from the sample's own mean, they are systematically smaller than deviations from the true population mean, which would bias the estimate downward. Dividing by n−1 corrects for that. The effect is largest for small samples.

What is the difference between variance and standard deviation?

Standard deviation is the square root of variance. Variance is in squared units, which makes it awkward to interpret, while standard deviation is in the same units as the data. Variance is preferred in mathematical work because variances of independent variables add together.

What does a standard deviation of zero mean?

Every value in the data set is identical. There is no spread at all, so every observation equals the mean.

How do I interpret a standard deviation?

Compare it to the mean and the context. For bell-shaped data, roughly 68% of values lie within one standard deviation of the mean and 95% within two. A standard deviation that is large relative to the mean indicates highly variable data; a small one indicates consistency.

What is a z-score?

How many standard deviations a value sits from the mean: z = (value − mean) ÷ standard deviation. A z of 2 means two standard deviations above the mean, which for bell-shaped data is higher than about 97.7% of values. It puts observations from different data sets on one comparable scale.

Last reviewed . Results are estimates for informational purposes only.