Standard deviation calculator. Sample s and population σ from a pasted data set.
A standard deviation calculator measures how far the values in a data set sit from their own mean, in the same units as the data. Paste your numbers, pick whether they are a sample or a whole population, and it returns that figure alongside the mean, the variance behind it and every squared deviation that built it.
What Is Standard Deviation?
Standard deviation is the typical distance between a value in a data set and the mean of that set. It is the square root of the variance, and that square root is what makes it readable: the NIST/SEMATECH e-Handbook puts it as “the standard deviation restores the units of the spread to the original data units (the variance squares the units).” A group with a mean weight of 70 kg and a standard deviation of 8 kg is a group where the typical person is about 8 kg away from 70 — some at 62, some at 78. The variance behind that figure, 64 kg², carries the same information in units nobody thinks in.
This page loads eight values so the shape of the answer is visible before you type anything: 10, 12, 23, 23, 16, 23, 21, 16. They add to 144, so the mean is 18. Each value's gap from 18, squared and then added up, comes to 192 — the sum of squares. Divide 192 by 7 and the sample variance is 27.4286, whose square root is 5.23723, the sample standard deviation. Divide the same 192 by 8 and the population figures appear instead: variance 24, standard deviation 4.89898.
Those two answers differ because they answer different questions. If the eight numbers are what you managed to collect from a bigger group — eight scores out of a class of 200 — the sample form with the divisor 7 is the honest estimate, and Excel calls it STDEV.S. If the eight numbers are the entire group, the population form with the divisor 8 is exact, and Excel calls it STDEV.P. The calculator prints both figures whatever you pick, and names the matching spreadsheet function under the cards, so the choice never turns into a silent mismatch with the sheet you copied the column from.
One relationship holds for every data set: the sample figure is the larger of the two, because dividing by a smaller number produces a bigger quotient. The single exception is a data set whose values are all identical, with at least two of them, where the sum of squares is zero and both figures come back as zero.
Standard Deviation Formula
s=n−1∑i=1n(xi−xˉ)2
s = Sample standard deviation — the figure on the main card, in the units of your data
σ = Population standard deviation — the same calculation with n as the divisor
xi = The i-th value in the data set
xˉ = The mean: the sum of the values divided by how many there are
n = How many values the data set holds
∑ = Add up what follows, once for every value in the set
The population form changes the divisor and nothing else:
σ=n∑i=1n(xi−xˉ)2
Both start from the same quantity, the sum of squares:
SS=i=1∑n(xi−xˉ)2
For the eight values above, SS is 192. Dividing it produces a variance — 192 ÷ 7 = 27.4286 on the sample basis, 192 ÷ 8 = 24 on the population basis — and the standard deviation is the square root of that variance, 5.23723 or 4.89898. Stopping at the division is the most common slip on a marked worksheet, because a variance is a plausible-looking number wearing the wrong units.
The n − 1 in the sample form is Bessel's correction. You subtract the sample's own mean, not the unknown mean of the population, and a sample's values always sit slightly closer to their own mean than to the population's. Dividing by n would inherit that bias; dividing by n − 1 cancels it. Microsoft's documentation states the same thing about the spreadsheet function this basis matches: STDEV.S “is calculated using the ‘n-1’ method”, and anyone holding a complete population is sent to STDEV.P instead.
How to Calculate Standard Deviation by Hand
Five steps produce the figure, and the calculator's table lays out steps 2 to 4 so the arithmetic can be copied onto a worksheet. Worked here on the eight values the page loads with.
2. Subtract the mean from each value. That gives −8, −6, +5, +5, −2, +5, +3, −2. Add this column before going further: −8 − 6 + 5 + 5 − 2 + 5 + 3 − 2 = 0. The deviations from a correct mean always cancel out, which is why they cannot be averaged as they are, and why a non-zero total means the mean is wrong.
4. Add the squares: 192. That total is the sum of squares, and it is the Total row of the step-by-step table on this page.
5. Divide by the right divisor and take the square root. For a sample, 192 ÷ 7 = 27.4286 and √27.4286 = 5.23723. For a population, 192 ÷ 8 = 24 and √24 = 4.89898.
The table under the results carries exactly those columns — Value (xᵢ), xᵢ − x̄ and (xᵢ − x̄)² — with 192 in the Total row, and the caption spells the last step out in full: the divisor is 7, so the sample variance is 192 ÷ 7 = 27.4286, and the standard deviation is its square root, 5.23723. On long data sets the table lists the first 30 rows and says how many values it left out; the Total row still covers all of them, so the sum of squares is never partial.
Pasting Your Data: Separators, Decimal Marks and Rejected Entries
The data field is one box that takes a whole column at once. It holds up to 5,000 characters, which is a spreadsheet column of several hundred numbers, and line breaks count as separators — so copying a column straight out of Excel, Sheets, Numbers or a CSV works without reformatting.
Two segmented controls sit under the field. The first picks the basis, Sample (n − 1) or Population (n), and it changes which figure is the headline and which spreadsheet function gets named. The second picks the decimal mark, labeled 1.5 and 1,5, and it changes what a comma means:
1. With the decimal mark set to 1.5, the separators are spaces, line breaks, tabs, semicolons and commas. Thousands grouping is not recognized in this mode, so 1,234.5 is read as two values, 1 and 234.5 — which is the reason the Values (n) card is worth a glance after any paste.
2. With the decimal mark set to 1,5, the comma is a decimal point and no longer separates. Spaces, line breaks, tabs and semicolons split the list, and a period is treated as a thousands group, so 1.234,5 is one value, 1234.5. Pasting 1,5 2,7 3,1 gives three values in this mode and six in the other one.
Negative values and scientific notation both survive: a minus sign in front of a number is kept, and 1.5e3 is read as 1500. Anything that is not a number is set aside rather than swallowed, and the first few of the entries that were dropped are listed by name under the results, so a stray header row or an “n/a” cell shows up as a line of text on screen instead of moving the mean behind your back.
Sample Basis or Population Basis: What Changes
Figure
Sample basis
Population basis
Divisor applied to the sum of squares (n = 8)
7
8
Variance on the eight-value example
27.4286
24
Standard deviation on the same data
5.23723
4.89898
Excel and Google Sheets function
STDEV.S
STDEV.P
Legacy Excel name, kept for compatibility
STDEV
STDEVP
Pick it when
your numbers are part of a bigger group
your numbers are the whole group
Result from a single value (n = 1)
does not exist
0
Worked Examples
The Eight Values the Page Loads With
The data set 10, 12, 23, 23, 16, 23, 21, 16 on the sample basis returns a sample standard deviation of 5.23723, with the sample variance 27.4286 printed under it, and the population standard deviation 4.89898 on the card beside it. The mean is 18 and n is 8. The figures block adds the rest: population variance 24, sum of squares 192, sum 144, median 18.5, minimum 10, maximum 23, range 13, standard error of the mean 1.85164 and coefficient of variation 29.1%. Under the cards, one line states the basis in words and names the function: reading these numbers as a sample, the same figure in Excel is STDEV.S.
The Same Data, Read as a Population
Switching the basis to Population (n) swaps the cards over. The headline becomes the population standard deviation 4.89898 with the population variance 24 under it, and 5.23723 moves to the secondary card. The line under the cards now names STDEV.P. Nothing in the figures block moves, because the mean, the sum of squares, the median, the range and the rest do not depend on the basis — only the divisor does, and the step-by-step caption updates to show 192 ÷ 8 = 24 rather than 192 ÷ 7 = 27.4286. That is the fastest way to see how much of a difference n − 1 makes on your own n: here it is about 7% on the deviation.
Five Decimal Readings from a Lab Sheet
Paste 2.5, 3.1, 4.8, 5.2, 6.0 and the sample standard deviation is 1.46867, with the sample variance 2.157 under it and the population standard deviation 1.31362 beside it. The mean is 4.32 and n is 5. The rest of the figures: population variance 1.7256, sum of squares 8.628, sum 21.6, median 4.8, minimum 2.5, maximum 6, range 3.5, standard error of the mean 0.65681 and coefficient of variation 34%. The coefficient of variation is the figure to carry across data sets: 34% here against 29.1% for the eight-value example says the five readings are the more scattered pair relative to their own mean, even though 1.46867 is the smaller standard deviation of the two.
The Data Set Built to Break Calculators
NIST publishes nine univariate reference data sets with certified values so that software can be checked against them. The smallest is NumAcc1: the three integers 10000001, 10000003 and 10000002, whose certified mean is exactly 10000002 and whose certified sample standard deviation is exactly 1. Paste those three numbers, with the decimal mark on 1.5 so the commas separate, and the mean comes back as 10,000,002 and the standard deviation as exactly 1. The point of a set like this is that the arithmetic is trivial while the floating-point behavior is not: seven identical leading digits leave almost nothing for the subtraction to hold on to, which is what NIST calls stiffness.
Mistakes That Change the Answer
Handing in the variance instead of the standard deviation — 192 ÷ 7 = 27.4286 is the variance, and the standard deviation is its square root, 5.23723. Dividing the sum of squares is the second-to-last move; taking the root is the last one. A figure that is the square of the one you wanted — 27.4286 where 5.23723 belongs — in units that are the square of your data's, is this mistake almost every time.
Averaging the deviations rather than their squares — the raw gaps from the mean cancel out by construction: −8 − 6 + 5 + 5 − 2 + 5 + 3 − 2 = 0. The squares are what get averaged, which is also why the answer comes back in squared units and needs the root.
Choosing the basis by habit instead of by what the data is — the population form is only exact when the numbers in the box are the entire group. For a subset, it understates the spread: 4.89898 against 5.23723 on the same eight values. The test that settles it: if someone could have measured more of the same thing, what you have is a sample, and Microsoft's own documentation sends only complete populations to STDEV.P.
Pasting thousands-grouped numbers with the decimal mark on 1.5 — 1,234.5 becomes two values, 1 and 234.5, so n climbs and the mean collapses. Check the Values (n) card against the count you expected before reading anything else, or switch the decimal mark and let the period do the grouping.
Reporting the standard error as the standard deviation — on the eight-value example they are 1.85164 and 5.23723. The standard error describes how precisely the mean is pinned down; the standard deviation describes how scattered the individual values are. Swapping them makes data look about three times tidier than it is.
Rounding in the middle — round the deviations to two decimals and the errors accumulate through the squaring and the division. The page carries six significant figures so the rounding can happen once, at the end, at whatever precision the measurements justify.
Getting a Figure You Can Defend
Read the Values (n) card first — it is the fastest check that the paste was parsed the way you meant. If n is bigger than your row count, a comma is separating something you meant as a decimal; if it is smaller, values are stuck together. The line naming the discarded entries answers the rest.
Add the middle column of the step table — the deviations must total zero (−8 − 6 + 5 + 5 − 2 + 5 + 3 − 2 = 0 on the default data). It is the one self-check in the whole procedure that catches a wrong mean before it propagates into the squares.
Never quote the deviation without its mean — 5.23723 means one thing next to a mean of 18 and something else entirely next to a mean of 1,800. Report the pair, as “18 ± 5.24”, or report the coefficient of variation alongside.
Use the coefficient of variation to compare across units — it is the deviation as a percentage of the mean, 29.1% for the eight-value example. Two data sets measured in different units can be compared that way; their raw standard deviations cannot. There is no universal cut-off for a high coefficient — the threshold belongs to the field you are working in.
Match the basis to the spreadsheet before you compare figures — if a colleague's sheet says 4.89898 and this page says 5.23723, the disagreement is the divisor, not an error. The line under the cards names STDEV.S or STDEV.P precisely so that conversation ends in one glance.
Switch to the variance page when the next step needs squared units — analysis of variance, error propagation and the variances of independent quantities all add in squared units, and the sister page puts the variance on the card with the deviation underneath.
Keep the standard error for statements about the mean — s ÷ √n is 1.85164 here, and it shrinks as you collect more data while the standard deviation does not. Error bars around a mean use the standard error; a claim about how much the individual values scatter uses the standard deviation.
What This Calculator Does Not Do
The page is descriptive. It reports what your numbers do and makes no claim about the process that produced them: no significance test, no confidence interval, no normality check, no distribution fitting and no chart. Rules of thumb that turn a standard deviation into a share of the data assume a bell-shaped distribution, and nothing here tests whether yours is one.
There is no mode and there are no quartiles. What is present beyond the two deviations and the two variances is the mean, the count, the sum, the sum of squares, the median, the minimum, the maximum, the range, the standard error of the mean and the coefficient of variation.
The field accepts 5,000 characters. The step-by-step table lists the first 30 values and states in its caption how many it left out — the Total row still covers every value, so the sum of squares is complete even when the table is not.
“Does not exist” is treated as a distinct answer from zero. A single value read as a sample shows a dash for the sample deviation and the sample variance, with a line explaining that a sample standard deviation needs at least two values, while the population figures show 0 — correct, because one value has no spread, and there is no n − 1 to divide by. A data set whose mean is exactly zero shows a dash for the coefficient of variation and prints the reason underneath, since dividing by a zero mean has no meaning.
Key Terms
Sum of squares (SS)
The total of every squared gap between a value and the mean, written Σ(xᵢ − x̄)². It is 192 for the data set this page loads with, and it is the quantity both variances divide.
Divisor (degrees of freedom)
What the sum of squares is divided by: n − 1 on the sample basis, n on the population basis. With eight values that is 7 or 8, and it is the only number that changes between the two answers.
Bessel's correction
Using n − 1 rather than n for a sample. It compensates for the fact that a sample's values sit closer to their own mean than to the unknown population mean, which would otherwise make the spread look smaller than it is.
Variance
The sum of squares divided by the divisor, in the square of the data's units. The standard deviation is its square root: variance 27.4286 gives a deviation of 5.23723.
Standard error of the mean
The sample standard deviation divided by √n — 1.85164 for the eight-value example. It measures how precisely the mean is estimated, not how far the individual values scatter.
Coefficient of variation
The sample standard deviation as a percentage of the mean, 29.1% for the eight-value example. It lets data sets in different units be compared, and it is undefined when the mean is zero.
Stiffness
NIST's term for how many leading digits a data set holds constant. As stiffness rises the data grows more nearly constant and, in NIST's words, “accurate computation of standard deviations becomes increasingly difficult”.
Sample and population
A sample is a subset of the group you want to describe, estimated with STDEV.S; a population is the complete group, described exactly with STDEV.P. The same numbers can be either, depending on the question.
Frequently Asked Questions About Standard Deviation
Should I use the sample or the population standard deviation?
Use the sample basis when your numbers are part of a larger group you want to describe, and the population basis when they are the whole group. If someone could have measured more of the same thing, what you have is a sample — which is the basis this page opens on.
Which Excel function matches this calculator?
STDEV.S on the sample basis and STDEV.P on the population basis, and the line under the cards names whichever one is in play. Google Sheets uses the same two names. The older Excel names STDEV and STDEVP compute the same two figures and Microsoft keeps them for backward compatibility, while warning they may not survive in future versions of Excel.
Why does my spreadsheet give a different standard deviation than this calculator?
Two causes cover almost every case. The first is the basis: STDEV.P divides by n and STDEV.S by n − 1, which on the eight-value example is the gap between 4.89898 and 5.23723. The second is what each tool ignores. Microsoft documents that STDEV.S ignores empty cells, text and logical values inside a referenced range, and the sheet shows nothing on screen to say it did; this page lists every entry it could not read, by name, under the results.
Why divide by n − 1 instead of n?
Because the mean you subtract came from the sample itself. A sample's values sit closer to their own mean than to the population's, so dividing by n would understate the spread. Dividing by n − 1 removes that bias, which is what Bessel's correction means.
What is the standard deviation of a single number?
On the population basis it is 0: one value has no spread. On the sample basis it does not exist, because the divisor n − 1 is zero. The calculator shows 0 for the first and a dash for the second, rather than treating both as the same answer.
My numbers use commas as decimal points. Will the calculator read them?
Yes, once you set the decimal mark control to 1,5. In that mode the comma is a decimal point and stops separating, while spaces, line breaks, tabs and semicolons split the list and a period is read as a thousands group, so 1.234,5 is the single value 1234.5. Pasting 1,5 2,7 3,1 gives three values in that mode and six in the 1.5 mode.
Is a standard deviation of 5.23723 high or low?
Neither, until it is compared with the mean. On a mean of 18 it is 29.1% of the average value, which the coefficient of variation reports; on a mean of 1,800 the same figure would be a rounding error. Compare the coefficient of variation across your own data sets, or against a benchmark from your field, rather than judging the raw number.
What do I do with the sum of squares?
It is the number a marked worksheet usually wants to see, and it is the quantity both variances divide, so quoting it lets anyone reproduce either figure. It also carries forward: analysis of variance, regression and error propagation all operate on sums of squares and variances rather than on standard deviations, which is why the sister variance page keeps the squared units on the card.
Is the standard error the same as the standard deviation?
No. The standard error of the mean is the sample standard deviation divided by √n — 1.85164 against 5.23723 on the eight-value example. The standard deviation describes how scattered the individual values are; the standard error describes how precisely their mean is known, and it shrinks as the data set grows.
How accurate is this calculator?
It makes two passes over the data — the mean first, then the squared gaps from it — instead of the one-line shortcut Σx² − (Σx)²/n. On NIST's certified reference sets the difference is measurable. NumAcc1, whose certified sample standard deviation is exactly 1, comes back as exactly 1 either way. On NumAcc2 the shortcut lands about four orders of magnitude further from the certified 0.1. On NumAcc4 — the only one of NIST's nine univariate sets graded higher difficulty — the shortcut's subtraction goes negative and its square root is not a number at all, while the two-pass result matches the certified 0.1 to eight significant figures.
How many values can I paste at once?
The field takes 5,000 characters, which is a few hundred numbers from a spreadsheet column. Every value counts toward the statistics. The step-by-step table shows the first 30 rows and says how many it left out, and its Total row is the sum of squares over the whole data set, not over the rows on display.
Can I get the variance instead of the standard deviation?
The variance for the basis in play is already printed under the main card — 27.4286 for the eight-value sample — and both variances appear in the figures block. If the variance is the figure you are reporting rather than a step along the way, the variance calculator is the same engine with the squared units on the card and the deviation underneath.
Why is the coefficient of variation showing a dash?
Because the mean of your data is exactly zero, which happens whenever the values balance around zero, and the coefficient of variation divides by the mean. The calculator prints the reason under the figure. Every other statistic on the page still applies.
Is this standard deviation calculator free to use?
Yes. It runs in any browser on a phone, tablet or computer, with nothing to install and no cap on how many data sets you work through. The figures recompute as you type or paste, so switching the basis or the decimal mark updates every card and the step-by-step table immediately.