Skip to content
DeviceCheckHub

Standard Deviation Calculator

The standard deviation and variance of your numbers, a frequency table or a probability distribution, sample and population side by side, with every step shown.

Your data

Examples:
Sample standard deviation s = 9.22632 for 8 values, with mean x̄ = 81.375.

s = 9.22632

Sample standard deviation · variance s² = 85.125 · mean x̄ = 81.375

Sample and population
SamplePopulation
Divide byn − 1 = 7N = 8
Variances² = 85.125σ² = 74.484375
Standard deviations = 9.226321044σ = 8.630433071
Count n
8
Sum Σx
651
Mean x̄
81.375
Sum of squares Σ(x − x̄)²
595.875
Standard error of the mean s / √n
3.261997088
Coefficient of variation s / |x̄|
11.34%
Minimum
66
Maximum
94
Range
28

How spread out the data is

x̄−1s+1s6694
Share of the data within 1, 2 and 3 standard deviations
RangeYour dataNormalAt least
x̄ ± 1s: 72.1487 to 90.601362.5%68.27%—
x̄ ± 2s: 62.9224 to 99.8276100%95.45%75%
x̄ ± 3s: 53.696 to 109.054100%99.73%88.89%

“Normal” is the share for a normal (bell-shaped) distribution; “At least” is the share Chebyshev’s inequality guarantees for any data.

Standard error and confidence intervals for the mean

Confidence level, t value, margin of error and interval for the mean
Confidencet*MarginInterval
80%1.4149± 4.6154876.7595 to 85.9905
90%1.8946± 6.1801175.1949 to 87.5551
95%2.3646± 7.713473.6616 to 89.0884
98%2.998± 9.7793171.5957 to 91.1543
99%3.4995± 11.415369.9597 to 92.7903
99.9%5.4079± 17.640563.7345 to 99.0155

Step by step

  1. Add the 8 values and divide by 8: x̄ = 651 ÷ 8 = 81.375.
  2. Square each value’s distance from the mean and add: Σ = (72 − 81.375)² + (85 − 81.375)² + (90 − 81.375)² + … = 595.875.
  3. Divide by n − 1 = 7 for the variance: s² = 595.875 ÷ 7 = 85.125.
  4. Take the square root: s = √85.125 = 9.226321.
Each value, its distance from the mean, that distance squared and its z-score
xx − x̄(x − x̄)²z
72−9.37587.8906−1.016
853.62513.14060.3929
908.62574.39060.9348
66−15.375236.391−1.666
853.62513.14060.3929
78−3.37511.3906−0.3658
9412.625159.3911.368
81−0.3750.140625−0.04064
Total595.875
In a spreadsheet (data in A2 down)
=STDEV.S(A2:A9)
In code
R: sd(x) Python: statistics.stdev(x)

How often each value appears

Each different value, how many times it appears and its share of all values
ValueCountShare
66112.5%
72112.5%
78112.5%
81112.5%
85225%
90112.5%
94112.5%

How to use the standard deviation calculator

  1. Choose what your data looks like: a list of numbers, values with how many times each occurs, or a probability table.
  2. Type or paste it in. A column copied from a spreadsheet works as it is; in a table, put each value and its count or probability on its own line.
  3. Say whether a list or table is a sample from a larger group or the whole population. The answer at the top follows your choice, and the table under it shows both.
  4. Read the chart and the share of your data within 1, 2 and 3 standard deviations, the confidence intervals for the mean, and the working step by step.

What the standard deviation tells you

The standard deviation measures how spread out numbers are around their mean. A small standard deviation means most values sit close to the average; a large one means they are scattered widely. Two classes can both average 70 on a test, but if one has a standard deviation of 3 points and the other of 15, the first class scored far more evenly. It is the most common way to describe spread because it is in the same units as the data: a standard deviation of a set of heights in centimeters is itself in centimeters.

The NIST/SEMATECH e-Handbook of Statistical Methods, from the US National Institute of Standards and Technology, describes the variance as roughly the arithmetic average of the squared distance from the mean, and notes that squaring gives more weight to values far from the mean: a point 2 units away adds 4 to the sum, while one 10 units away adds 100. The standard deviation is the square root of the variance, which, in the handbook’s words, restores the units of the spread to the original data units.

The formulas

For a sample of n values with mean x̄, NIST gives the variance and standard deviation as

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

s = √s²

For a whole population of N values with mean μ, the sum is divided by N instead: σ = √( Σ(xᵢ − μ)² ÷ N ). Dividing a sample by n − 1 corrects for the fact that a sample’s values sit a little closer to their own mean than to the true mean of the whole group, so dividing by n would understate the spread.

With a frequency table, each squared distance counts as many times as its value occurs: s² = Σf·(x − x̄)² ÷ (n − 1), where n is the counts added up. For grouped data in classes such as 20–30, each class is taken at its midpoint, so the answer is an estimate of the spread of the raw values. For a probability distribution, the mean is the expected value μ = Σx·p and the variance is σ² = Σp·(x − μ)².

A worked example from Excel’s help

Microsoft’s help pages for STDEV.S and STDEV.P use the breaking strength of ten tools: 1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299. Press “Breaking strength” above to load them.

  1. The ten values add up to 13,286, so the mean is 1328.6.
  2. Square each value’s distance from the mean and add them up: the sum of squares is 6788.4.
  3. As a sample, divide by n − 1 = 9 and take the square root: s = 27.46391572, the same as the 27.46391572 Microsoft’s page gives for STDEV.S.
  4. As a whole population, divide by N = 10 instead: σ = 26.05455814, matching the 26.05455814 Microsoft gives for STDEV.P, “assuming only 10 tools are produced”.

Microsoft’s remarks say that STDEV.S assumes its arguments are a sample of the population and uses the “n-1” method, that STDEV.P assumes they are the entire population and uses the “n” method, and that for large sample sizes the two return approximately equal values.

Sample or population?

If you measured every member of the group you want to describe, such as all the employees of a small company or every game a team played this season, use the population standard deviation. If your numbers are a sample, such as 50 customers surveyed out of thousands, and you want to estimate the spread of the whole group, use the sample standard deviation. Software names them differently: in Excel, STDEV.P is the population version and STDEV.S the sample version; in Python’s statistics module they are pstdev and stdev.

The 68–95–99.7 rule and Chebyshev’s inequality

In a normal, bell-shaped distribution, about 68.27% of values lie within one standard deviation of the mean, 95.45% within two and 99.73% within three. Real data is often not normal, so the calculator counts how much of your data actually falls in each range and shows it next to the normal shares. Chebyshev’s inequality gives a floor that holds for any data at all: at least 75% of values lie within two standard deviations and at least 88.9% within three. If your data has far less within one standard deviation than 68%, or a few values beyond three, it is skewed or has outliers, and the median and interquartile range from the average calculator may describe it better.

Standard error and confidence intervals

The standard error of the mean, s ÷ √n, describes how precisely a sample mean estimates the true mean; it shrinks as the sample grows. NIST’s handbook defines the confidence limits for the mean as x̄ ± t × s ÷ √n, where t is the 100(1 − α/2) percentile of the t distribution with n − 1 degrees of freedom. The calculator shows the interval at 80% to 99.9% confidence. Using t rather than the normal value 1.96 matters for small samples: with 8 values, t at 95% confidence is 2.365, so the interval is about 21% wider. For a full interval tool with proportions and differences, see the confidence interval calculator.

z-scores

The last column of the step-by-step table is each value’s z-score: its distance from the mean in standard deviations, (x − mean) ÷ standard deviation. A z-score of 2 means the value is two standard deviations above the mean; −0.5 means half a standard deviation below. The z-score calculator turns z-scores into percentiles and probabilities.

Accuracy

Numbers are read exactly as typed, as decimals, and the sums are done in exact whole-number arithmetic before the final division and square root. So the calculator stays accurate where a shortcut formula fails, such as values like 10000000.1 and 10000000.2 that differ only in their last digits. NIST publishes nine Statistical Reference Datasets with certified values for testing exactly this, from “lower” to “higher” difficulty. On all nine, this calculator’s mean and standard deviation agree with the certified values to 15 significant digits, about the most an ordinary computer number holds. The “Large numbers” example is NIST’s NumAcc1 data set, whose certified standard deviation is exactly 1.

Your data stays on your device

Everything is worked out in your browser. Nothing you type is sent anywhere or stored.

Frequently asked questions

Should I use the sample or the population standard deviation?

Use the population standard deviation when your numbers are the whole group you care about, such as the scores of every student in one class. Use the sample standard deviation when your numbers are a sample used to estimate a larger group. It divides by n − 1 instead of n, which makes it slightly larger. When unsure, the sample version is the usual choice.

What is the difference between variance and standard deviation?

Variance is the average squared distance from the mean, so it is in squared units: square centimeters for lengths in centimeters. The standard deviation is its square root, which brings it back to the units of your data.

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

Choose “Values and counts” and enter each value and how many times it occurs on its own line, such as “3 12”. For grouped data, enter each class as a range, such as “20-30 5”; the calculator uses the class midpoints.

Can it find the standard deviation of a probability distribution?

Yes. Choose “A probability table” and enter each value with its probability as a decimal, a percent or a fraction such as 3/8. It finds the expected value μ, the variance and σ.

Why does my calculator or textbook give a slightly different answer?

Most often one of you used the sample formula (n − 1) and the other the population formula (N). Both are shown in the table under the answer. Rounding the mean before squaring the distances also changes the last digits; this calculator keeps every digit until the end.

How do I enter my numbers?

Type or paste them separated by spaces, commas, semicolons or new lines; a column copied from a spreadsheet works as it is. Write 1500 rather than 1,500, as a comma between numbers separates them.

Is anything I type sent anywhere?

No. Everything is worked out in your browser, and nothing you type is sent anywhere or stored.

Last updated · About DeviceCheckHub