Standard Deviation Calculator
Sample or population standard deviation and variance of a list of numbers, with every step and a deviation table.
Results
Sample standard deviation
0.703
8 values, mean 10.450. If they are the whole population (÷ N): 0.658.
- Mean
- 10.450Σx ÷ n = 83.6 ÷ 8
- Variance
- 0.494s², in squared units of the data
- Sum of squares (SS)
- 3.460Σ(x − x̄)²
- Standard error of the mean
- 0.249s ÷ √n
- Coefficient of variation
- 6.73%s ÷ x̄, as a percentage
- Range
- 2.1from 9.5 to 11.6
| Measure | Sample | Population |
|---|---|---|
| Divide SS by | n − 1 = 7 | N = 8 |
| Variance | 0.494 | 0.433 |
| SD | 0.703 | 0.658 |
| Excel SD | STDEV.S | STDEV.P |
| Excel variance | VAR.S | VAR.P |
You chose sample. For 8 values the sample SD is √(8 ÷ 7) = 1.069 times the population SD; the gap shrinks as n grows.
How this was calculated
- Count: n = 8 values
- Sum: Σx = 9.8 + 10.4 + 11.1 + 9.5 + 10.9 + 10.2 + 11.6 + 10.1 = 83.6
- Mean: x̄ = Σx ÷ n = 83.6 ÷ 8 = 10.450
- Squared deviations from the mean: (9.8 − 10.450)² = 0.423, (10.4 − 10.450)² = 0.003, (11.1 − 10.450)² = 0.423, … one for each value (see the table)
- Sum of squares: SS = Σ(x − x̄)² = 0.423 + 0.003 + 0.423 + … = 3.460
- Variance: s² = SS ÷ (n − 1) = 3.460 ÷ 7 = 0.494
- Standard deviation: s = √s² = √0.494 = 0.703
- Standard error of the mean: SE = s ÷ √n = 0.703 ÷ √8 = 0.249
- Coefficient of variation: CV = s ÷ x̄ × 100 = 0.703 ÷ 10.450 × 100 = 6.73%
- In a spreadsheet, with the values in cells A1 to A8: =STDEV.S(A1:A8) returns 0.703 and =VAR.S(A1:A8) returns 0.494
| # | Value (x) | Deviation (x − x̄) | Squared (x − x̄)² | z-score |
|---|---|---|---|---|
| 1 | 9.8 | -0.650 | 0.423 | -0.92 |
| 2 | 10.4 | -0.050 | 0.003 | -0.07 |
| 3 | 11.1 | +0.650 | 0.423 | +0.92 |
| 4 | 9.5 | -0.950 | 0.903 | -1.35 |
| 5 | 10.9 | +0.450 | 0.203 | +0.64 |
| 6 | 10.2 | -0.250 | 0.063 | -0.36 |
| 7 | 11.6 | +1.150 | 1.323 | +1.64 |
| 8 | 10.1 | -0.350 | 0.123 | -0.50 |
| Total | 83.6 | 0.000 | 3.460 | — |
A z-score: How many standard deviations a value lies above or below the mean: z = (x − mean) ÷ standard deviation. A z-score of −1.5 is one and a half standard deviations below the mean. Source: OpenStax, Introductory Statistics 2e is a deviation divided by the standard deviation (s = 0.703): how many standard deviations the value lies from the mean. No value is more than 2 standard deviations from the mean.
Each dot is a value; equal values stack. Solid line: mean (10.450). Darker band: mean ± 1 s; lighter band: mean ± 2 s.
| Within | Values inside | If normal | From – to |
|---|---|---|---|
| ±1 SD | 6 of 8 (75%) | 68.27% | 9.747 to 11.153 |
| ±2 SD | 8 of 8 (100%) | 95.45% | 9.044 to 11.856 |
| ±3 SD | 8 of 8 (100%) | 99.73% | 8.341 to 12.559 |
“If normal” is the share a Normal distribution: The symmetric, bell-shaped distribution set by its mean and standard deviation. About 68% of values lie within one standard deviation of the mean, 95% within two and 99.7% within three. Source: OpenStax, Introductory Statistics 2e puts within each band (the 68–95–99.7 rule), for comparison only: your values need not be bell-shaped, and with few values the shares move in big steps.
Assumptions
- Sample: SS is divided by n − 1 (Bessel's correction), which makes s² an unbiased estimate of the variance of the whole group. s itself still tends to come out slightly low, most of all for small samples.
- The mean comes first and then each squared deviation from it (a two-pass method with compensated sums), so values such as 1,000,000,004 keep their precision; the one-pass shortcut Σx² − (Σx)² ÷ n can lose every digit for them. Values are double-precision numbers, good to about 15 significant digits.
- Results and steps are shown to 3 decimal places, two more than the most precise value (at least 2); the calculation keeps full precision, so redoing a step from the rounded figures can differ in the last digit.
- The standard error assumes the values are independent, randomly chosen members of the group.
- The coefficient of variation divides by the size of the mean. It only means something for data with a true zero (lengths, weights, times, counts), not for temperatures in °F or °C or data with negative values.
Calculated in your browser. This site doesn't send the numbers you enter anywhere. “Continue in” links pass them to the next calculator within this browser tab only.
What this calculator answers
How spread out a list of numbers is around its mean. Paste or type the values and choose whether they are a sample or the whole population; you get the standard deviation and variance, the mean, the sum of squared deviations, the standard error of the mean and the coefficient of variation, with every step written out using your numbers. Both versions of the standard deviation are always shown, so you can see how much the sample-or-population choice changes the answer.
How to use it
- Data: the values, separated by commas, spaces, tabs or new lines. A column copied from a spreadsheet works as it is, and a heading on its first line (such as “Exam score”) is skipped. Type
85:3for three values of 85, which is quicker for a frequency table. A comma counts as a thousands separator only when every comma sits between groups of three digits and there is more than one entry, as in a column of1,200,950and2,300; otherwise commas separate values, so95,100,105is three values and0,100,0is 0, 100 and 0. The line under the box says how many values were read, and when it read commas as thousands separators. Entries that aren’t numbers, such asN/A, are named by position; tick Leave out entries that aren’t numbers to calculate without them. - Sample or population: Sample (n − 1) is the default and fits most class, survey and lab data. Choose Population (N) only when the list holds every value you care about (see below).
Results update as you type and are shown with two more decimal places than your most precise value (at least 2); the calculation itself is never rounded. The Try buttons load a staff of ten salaries treated as a population, a pasted spreadsheet column with a heading, 30 ratings typed as value:count, five identical values and a single value. Download CSV under the deviation table saves every value with its deviation, square and z-score. Continue in the Mean, Median and Mode Calculator carries the same values over for the median and quartiles.
How to calculate standard deviation step by step
The standard deviation is the square root of the variance, and the variance is the average squared distance from the mean, with one difference between the two versions: a sample divides by n − 1, a population by N.
- is each value, and (sample) or (population) is how many there are.
- or is the mean: the sum of the values divided by the count.
- is the sum of squares (SS): each value’s deviation from the mean, squared, then added up.
- and , the quantities under the square root, are the sample and population variances.
- Add the values and divide by how many there are to get the mean.
- Subtract the mean from each value. The deviations always add up to 0.
- Square each deviation and add the squares: that is SS.
- Divide SS by n − 1 for a sample, or by N for a population: that is the variance, in squared units (hours², points²).
- Take the square root to get the standard deviation, back in the data’s own units.
The calculator shows these steps with your numbers, and a last step gives the spreadsheet formula that returns the same result: =STDEV.S(A1:A8) for a sample or =STDEV.P(A1:A8) for a population, with VAR.S and VAR.P for the variance.
Worked example: battery life of 8 phones
A reviewer runs the same video playback test on 8 phones of one model and records how many hours each battery lasts: 9.8, 10.4, 11.1, 9.5, 10.9, 10.2, 11.6 and 10.1. The 8 phones stand in for every phone of that model, so they are a sample.
- Mean: 9.8 + 10.4 + 11.1 + 9.5 + 10.9 + 10.2 + 11.6 + 10.1 = 83.6 hours, and 83.6 ÷ 8 = 10.45 hours.
- Deviations and their squares:
| Value (hours) | Deviation (x − 10.45) | Squared |
|---|---|---|
| 9.8 | −0.65 | 0.4225 |
| 10.4 | −0.05 | 0.0025 |
| 11.1 | 0.65 | 0.4225 |
| 9.5 | −0.95 | 0.9025 |
| 10.9 | 0.45 | 0.2025 |
| 10.2 | −0.25 | 0.0625 |
| 11.6 | 1.15 | 1.3225 |
| 10.1 | −0.35 | 0.1225 |
| Total | 0 | 3.46 |
- Sum of squares: SS = 3.46.
- Sample variance: s² = 3.46 ÷ (8 − 1) = 3.46 ÷ 7 ≈ 0.494 hours².
- Sample standard deviation: s = √0.494 ≈ 0.703 hours.
Treated as a population, the same numbers give σ² = 3.46 ÷ 8 = 0.4325 and σ ≈ 0.658 hours: the sample figure is √(8 ÷ 7) ≈ 1.069 times larger. The standard error of the mean is 0.703 ÷ √8 ≈ 0.249 hours, and the coefficient of variation is 0.703 ÷ 10.45 ≈ 6.73%. Six of the 8 phones lie within one standard deviation of the mean (9.747 to 11.153 hours); only 9.5 and 11.6 fall outside it.
The calculator shows these results to 3 decimal places, because the data have one.
Sample vs. population standard deviation: which one to use
Use the sample standard deviation when your values are a subset of a bigger group you want to describe: a class survey standing in for all students, 8 phones standing in for the model, lab repeats standing in for every measurement you could make. That covers most homework and nearly all real data.
Use the population standard deviation only when the list is the entire group and you don’t want to generalize beyond it: every employee of one small company, every game a team played this season, all the scores in a class when the class is all you are reporting on.
When in doubt, the sample version is the safer default: it is slightly larger, so it doesn’t understate the spread. For large lists the two barely differ:
| Values (n) | Sample SD ÷ population SD, √(n ÷ (n − 1)) |
|---|---|
| 2 | 1.414 |
| 5 | 1.118 |
| 10 | 1.054 |
| 30 | 1.017 |
| 100 | 1.005 |
Why the sample formula divides by n − 1
The deviations in a sample are measured from the sample’s own mean, which sits in the middle of those particular values. The squared distances to it are therefore a little smaller, on average, than the distances to the true mean of the whole group, which you don’t know. Dividing by n − 1 instead of n (Bessel’s correction) enlarges the result just enough that the sample variance is right on average.
Another way to see it: the deviations always add up to 0, so once you know n − 1 of them the last one is fixed. Only n − 1 of them carry independent information about the spread.
The correction makes the variance unbiased, not the standard deviation: taking the square root still leaves s slightly low on average, most noticeably for very small samples. The usual formula is kept anyway, because it is the one textbooks and Excel’s STDEV.S use.
Reading the result
- The headline is the standard deviation you chose, in the units of your data. The line under it gives the count, the mean and the other version of the standard deviation.
- Variance is the standard deviation squared, in squared units, so it is hard to read on its own; it is what the formulas add and compare.
- Sum of squares (SS) is the total of the squared deviations, the number both versions divide.
- Standard error of the mean (sample only) and coefficient of variation are explained below. For a population, a count takes the standard error’s place.
- Sample vs. population for these values puts both versions side by side with the spreadsheet functions that match each.
- Deviations from the mean lists every value with its deviation, square and z-score (up to 100 values), with a CSV download. A z-score of +1.64 means 1.64 standard deviations above the mean.
- Your values around the mean draws each value as a dot, with bands at 1 and 2 standard deviations either side of the mean.
- Values within 1, 2 and 3 standard deviations counts how many values fall in each band, next to the share a normal distribution would have there.
What a high or low standard deviation tells you
A standard deviation is only high or low compared with the mean and with what you expected. In the battery example, 0.703 hours on a mean of 10.45 hours says the phones behave much alike: six of the eight last within about 42 minutes of the average.
For data that are roughly bell-shaped, about 68% of values lie within one standard deviation of the mean, about 95% within two and about 99.7% within three. The last table on the result compares your data with those shares. A big gap is informative: skewed data or a few extreme values can make the standard deviation a poor summary.
Extreme values pull hard, because deviations are squared. Take the ten salaries in the Try button, in thousands of dollars: 38, 41, 44, 46, 48, 52, 55, 59, 64 and 310, treated as a whole staff. The population standard deviation is 78.47 on a mean of 75.7, and the band of one standard deviation runs from −2.77 to 154.17, below zero for a salary, which is impossible. Without the 310 the standard deviation is 8.07. When one value dominates like this, describe the data with the median and quartiles instead, or report both versions.
Standard error and coefficient of variation
The standard error of the mean, s ÷ √n, measures how much the mean of a sample would vary from one sample to the next, not how much individual values vary. It shrinks as the sample grows: quadrupling the sample halves it. Report the standard deviation to describe the spread of the values and the standard error to show how precisely you have pinned down their mean. It is shown for samples only; for a whole population the mean is known exactly.
The coefficient of variation (CV) is the standard deviation as a percentage of the mean. It compares spreads on different scales, for example the variation in battery life (6.73%) with the variation in charging time. Use it only for data with a true zero, such as lengths, weights, times and counts. It means nothing for temperatures in °C or °F, and it becomes huge and unstable when the mean is close to 0, which is why the calculator leaves it out when the mean is 0 and flags it when some values are 0 or negative.
Very large numbers and precision
The calculator finds the mean first and then each deviation from it (a two-pass method). A common shortcut formula works in one pass instead, the sum of the squares minus the squared sum divided by n, and it cancels away the digits that matter when values are large and close together. For 1,000,000,004, 1,000,000,007, 1,000,000,013 and 1,000,000,016, the true sample variance is 30 (the deviations are −6, −3, 3 and 6), but the shortcut in double-precision arithmetic returns −170.67, a negative variance. This page returns 30, with a standard deviation of 5.48.
Assumptions and limitations
- Every value counts once, exactly as typed.
85:3counts as three values of 85; there are no weights. - Nothing is removed as an outlier. The standard deviation includes every value you enter, so a typo or a pasted total row changes it.
- For data grouped into ranges (10–19, 20–29), entering each range’s midpoint with its count (
15:4) gives only an estimate of the true standard deviation. - The standard error assumes the values are independent observations drawn at random from the group.
- The normal-distribution shares are a reference, not a test of normality; with a handful of values the shares move in large steps.
- Up to 10,000 values, each between −1,000,000,000,000,000 and 1,000,000,000,000,000 and, other than 0, at least 10⁻¹⁰⁰ in size. The deviation table lists up to 100 values.
- Results are rounded for display only. The steps show rounded intermediate figures, so redoing a step from them can differ in the last digit.
Common mistakes
- Using the population formula for sample data. A class of 30 students’ test scores used to judge the course is a sample; dividing by n instead of n − 1 understates the spread.
- Reporting the variance as the standard deviation. The variance is in squared units; take its square root. In the example, 0.494 hours² is the variance and 0.703 hours the standard deviation.
- Rounding the mean before subtracting. Using 10.5 instead of 10.45 in the example gives a sum of squares of 3.48 instead of 3.46 and a standard deviation of 0.705 instead of 0.703. Keep the mean’s full precision, as the calculator does.
- Pasting a total or average row with the data. A “Total” line at the bottom of a spreadsheet column is read as one more value and inflates the result. The heading is skipped, but totals are not.
- Typing decimal commas.
12,5is read as two values, 12 and 5, and a note under the box says so. Use a decimal point:12.5. - Comparing standard deviations of data on different scales. A spread of 5 on a mean of 20 is large; on a mean of 2,000 it is tiny. Compare coefficients of variation instead.
Questions
Why is my answer different from Excel or my textbook?
Almost always because one side used the sample formula and the other the population formula. Excel’s STDEV.S divides by n − 1; STDEV.P divides by n. Check which one the question or the spreadsheet uses, and compare with the matching column in the sample vs. population table. Excel also ignores text such as N/A, empty cells and error values inside a cell range without saying so, while this calculator stops and names the entry, so a count that differs by one or two is worth checking too.
Can a standard deviation be negative or zero?
It can’t be negative. Every deviation is squared before it is added, so the variance is 0 or more and its square root is too. It is exactly 0 only when every value is the same, and any difference at all makes it positive. A negative variance from a hand-built one-pass formula is a rounding failure, not a real result.
What is the standard deviation of a single number?
As a population, 0, because one value can’t vary. As a sample it is not defined, because the sample formula divides by n − 1, which is 0; one observation says nothing about how much the group varies. Add at least one more value, or treat the value as a population if it really is the whole group.
Sources
- 1.3.5.6 Measures of Scale NIST/SEMATECH e-Handbook of Statistical Methods The variance as the sum of squared deviations from the mean divided by N − 1, the standard deviation as its square root in the data’s own units, and the variance’s sensitivity to values in the tails.
- 2.7 Measures of the Spread of the Data OpenStax, Introductory Statistics 2e Sample standard deviation dividing by n − 1 and population standard deviation dividing by N, the variance in squared units, and grouped frequency tables, where interval midpoints give only an estimate of the standard deviation.
- 6.1 The Standard Normal Distribution OpenStax, Introductory Statistics 2e z-scores as the number of standard deviations from the mean, and the empirical rule (about 68%, 95% and 99.7% within 1, 2 and 3 standard deviations of a normal distribution).
- 7.1 The Central Limit Theorem for Sample Means (Averages) OpenStax, Introductory Statistics 2e The standard error of the mean, the standard deviation divided by the square root of the sample size.
- Coefficient of Variation (Dataplot reference manual) National Institute of Standards and Technology CV as the standard deviation divided by the mean, used only for ratio-scale data (a meaningful zero), not for temperatures in °C or °F, and unreliable when the mean is near zero.
- STDEV.S function Microsoft Support Estimates the standard deviation from a sample with the n − 1 method, ignoring text and logical values in references; STDEV.P is for an entire population.
- STDEV.P function Microsoft Support Standard deviation of an entire population.
- VAR.S function Microsoft Support Variance estimated from a sample.
- VAR.P function Microsoft Support Variance of an entire population.
- Bessel’s correction Wikipedia Squared deviations from the sample mean are too small on average, more so for small samples, and the deviations sum to 0; dividing by n − 1 makes the sample variance unbiased, while its square root, the sample standard deviation, is still biased downward.
- Algorithms for calculating variance Wikipedia The one-pass formula (sum of squares minus the squared sum over n) loses precision through cancellation; for 10⁹ + 4, 10⁹ + 7, 10⁹ + 13 and 10⁹ + 16 it gives −170.67 where the two-pass method gives the correct 30.
Smart Financial Calc: https://smartfinancialcalc.com/math/standard-deviation-calculator/