Quick answer: The standard deviation measures how spread out a set of numbers is around its mean. Find the mean, subtract it from every value, square those differences, average the squares, and take the square root. Divide by n for a whole population, or by n minus 1 for a sample. Paste your numbers above and this calculator does every step for you — and shows the working, so you can check it line by line.
How to use this standard deviation calculator
Step 1 — Paste your data. Type or paste your numbers into the box, separated by commas, spaces or new lines. A column copied from a spreadsheet works as-is, because each line break is treated as a separator. Anything that is not a number is ignored, so a stray label in a pasted column does not break the calculation, though you should still scan the count in the results to be sure every value you intended was read.
Step 2 — Read both standard deviations. The headline figure is the population standard deviation, marked with the Greek letter sigma. Directly beneath it sit the sample standard deviation, the mean and the count, and below those the sum and both variances. Nothing needs configuring: both versions are calculated on every run, because choosing between them is a judgement about your data, not a setting.
Step 3 — Check the working. The table lists every value, its deviation from the mean, and its squared deviation. If you are answering a textbook question, this is the layout to copy into your own solution: it is the standard presentation examiners expect, and it makes arithmetic slips easy to spot, because the deviations column must always add up to zero (within rounding).
Step 4 — Save your result. Download, copy or email the summary, which records your data set alongside every statistic, so the numbers can be reproduced later. Your data stays on your device: the calculation runs entirely in your browser, and nothing is uploaded or stored.
Population vs sample standard deviation
In short: if your numbers are the entire group you are describing, divide by n — that is the population standard deviation. If your numbers are a sample used to estimate a larger group, divide by n minus 1 — that is the sample standard deviation, and it is always the larger of the two.
The distinction is about what the numbers represent, not about size. The marks of every student in one class, used to describe that class, are a population — all 30 of them are present, nothing is being estimated. The marks of 30 students sampled from a whole school, used to talk about the school, are a sample: the other students exist but were not measured, and the statistic is an estimate of the spread the full school would show.
Why does the sample version divide by one less? Because a sample almost always hugs its own mean a little more tightly than it hugs the true population mean — the sample mean is calculated from the very same values, so it sits as close to them as any point can. Measured against that fitted mean, the spread comes out slightly too small, systematically. Dividing the squared deviations by n minus 1 instead of n inflates the result just enough to correct that bias on average. The fix is called Bessel’s correction, and it matters most for small samples: with n equal to 8 it changes the divisor from 8 to 7, a difference of about 7 percent in the final standard deviation, while with n equal to 800 it is barely visible.
Exam questions usually tell you which one they want, in words if not in symbols: “the standard deviation of these marks” for a complete listed set means population; “estimate the standard deviation” from sampled data means sample. Software makes the same distinction — Excel and Google Sheets offer STDEV.P for population and STDEV.S for sample — and the software section below maps each function to the figures on this page.
How to calculate standard deviation, step by step
The five steps: (1) add up the values and divide by the count to get the mean; (2) subtract the mean from every value to get its deviation; (3) square every deviation; (4) average the squared deviations — dividing by n for a population or n minus 1 for a sample — which gives the variance; (5) take the square root of the variance. That root is the standard deviation.
Each step exists for a reason. Deviations are squared for two reasons at once: squaring makes every deviation positive, so values above and below the mean stop cancelling each other out — the raw deviations of any data set always sum to exactly zero — and squaring gives larger deviations more than proportional weight, so a value far from the mean counts heavily, which is what a spread measure should do. The final square root then undoes the squaring of the units: if your data is in centimetres, the variance is in square centimetres, a unit nobody can picture, while the standard deviation is back in centimetres, directly comparable with the data itself and with the mean.
In symbols, the population standard deviation is sigma equals the square root of the sum of (x minus the mean) squared, divided by n. The sample version, written s, is identical except the divisor is n minus 1. This calculator follows exactly that definition — no shortcut computational formula, no rounding of intermediate steps — which is why its results match a careful hand calculation to the last digit, as the worked example shows.
A note on rounding: carry full precision through the steps and round only the final answer, as this page does. Rounding the mean to one decimal before computing deviations is the single most common cause of a hand calculation disagreeing with a calculator in the second decimal place.
Worked example: the data set with an SD of exactly 2
The data set 2, 4, 4, 4, 5, 5, 7, 9 is the classic textbook example — it is the pre-filled data in the calculator above, and it is worth working once by hand, because its population standard deviation comes out at exactly 2.
| Value (x) | Deviation (x − mean) | Squared deviation |
|---|---|---|
| 2 | −3 | 9 |
| 4 | −1 | 1 |
| 4 | −1 | 1 |
| 4 | −1 | 1 |
| 5 | 0 | 0 |
| 5 | 0 | 0 |
| 7 | 2 | 4 |
| 9 | 4 | 16 |
| Sum = 40 | Sum = 0 | Sum = 32 |
The mean is 40 divided by 8, which is 5. The deviations sum to zero, as they must — that is your first check. The squared deviations sum to 32. For the population: variance is 32 divided by 8, which is 4, and the standard deviation is the square root of 4, exactly 2. For the sample: variance is 32 divided by 7, which is 4.571 to three decimal places, and the standard deviation is the square root of that, 2.138 to three decimal places. Type the data set into the calculator and you will see count 8, sum 40, mean 5, population SD 2 and sample SD 2.138 — the tool and the hand calculation agree completely.
Read the result in plain words: a typical value in this set sits about 2 units from the mean of 5. The 9 is doing noticeable work in that figure — its squared deviation of 16 is half the entire sum of squares — which previews an important property covered below: standard deviation is sensitive to outliers, because squaring amplifies distant values.
How to read a standard deviation: the 68–95–99.7 rule
A standard deviation is only useful compared with something: the mean, another data set, or a requirement. The most famous comparison is the empirical rule for bell-shaped (normally distributed) data: about 68 percent of values fall within one standard deviation of the mean, about 95 percent within two, and about 99.7 percent within three. So exam marks with a mean of 70 and an SD of 10 would place roughly two thirds of students between 60 and 80, and almost everyone between 40 and 100.
The same number reads very differently at different scales. An SD of 2 means tight clustering when the mean is 200 — a coefficient of variation of just 1 percent — and wild scatter when the mean is 5, as in the worked example, where it is 40 percent of the mean. Always report the mean alongside the SD, and be suspicious of any comparison of two SDs whose means are far apart until you have compared them relative to those means.
There is no universal “good” standard deviation. Low is better when consistency is the goal — a machine filling bottles, a process hitting a target. Low is not better when the spread is the information: a class where everyone scores identically may have sat a test that was too easy to distinguish anyone, and income or house-price data naturally carries a large SD because the underlying reality is unequal. The statistic describes; it does not grade.
Finally, the empirical rule assumes a roughly bell-shaped distribution. For skewed data — incomes, waiting times, city sizes — the percentages inside one, two and three SDs differ, sometimes sharply, and a large SD mostly signals a long tail of big values. The calculation on this page is correct for any data set; the interpretation rules of thumb are the part that depends on shape.
Standard deviation and variance: the square-root relationship
Variance and standard deviation are the same measurement at two stages of the same calculation: the variance is the average squared deviation, and the standard deviation is its square root. Every figure in the results above comes in both forms for exactly this reason — sigma squared beside sigma, s squared beside s.
Statisticians often prefer to calculate with variance, because variances of independent quantities add together neatly, which makes theory and further formulas simpler. Everyone else usually prefers the standard deviation, because it is expressed in the original units of the data and can be drawn on a chart as a distance from the mean. Neither is more correct; they answer the same question in different units, and converting is one square root or one squaring.
Standard deviation also sits in a family of spread measures worth knowing, especially since mean, median, mode and range questions travel with it in every school syllabus. The range — largest minus smallest — is the crudest spread measure and uses only two values. The interquartile range uses the middle half of the data and resists outliers. The mean absolute deviation averages the unsigned deviations without squaring, which many students find more intuitive, but it lacks the standard deviation’s convenient mathematical properties, which is why the squared version won. Knowing which measure a question wants is half the marks; the calculation itself is the easy half.
Spreadsheets and code: STDEV.P, STDEV.S and ddof
If you cross-check this page against software, the names differ but the two versions are always there. In Excel and Google Sheets, STDEV.P divides by n and matches the population figures here; STDEV.S divides by n minus 1 and matches the sample figures. The older STDEV function, still accepted for compatibility, is the sample version. In Python, the statistics module offers pstdev and stdev with the same population/sample split, while NumPy’s std function exposes the choice as a parameter called ddof — delta degrees of freedom: ddof of 0 gives the population result and ddof of 1 gives the sample result, and NumPy defaults to 0, which surprises many people whose statistics course taught the sample version as the default.
When two tools disagree about a standard deviation, this naming maze is almost always why: one divided by n and the other by n minus 1. The disagreement is largest for tiny samples and shrinks as n grows — at n equal to 100 the two differ by half a percent. The fix is never to average the two answers; it is to decide, from what your data represents, which divisor your question intends, and use that figure consistently through the whole piece of work.
Common mistakes
Dividing by the wrong n. Using n for a sample or n minus 1 for a population is the classic error, and it changes the answer by a factor that matters at small sample sizes. Decide population or sample before you calculate, and write the decision into your working.
Forgetting the square root. Stopping at the variance and reporting it as the standard deviation is the second classic. A variance of 4 is an SD of 2; if your “standard deviation” looks suspiciously large and carries squared units, you probably stopped one step early.
Rounding the mean too early. A mean of 5.333 rounded to 5.3 before the deviations are computed shifts every deviation and compounds into the final figure. Carry full precision to the end and round once, as this calculator does.
Averaging standard deviations. The SD of two combined groups is not the average of their SDs, because the groups may also differ in their means. Combine the raw data and calculate once — paste both lists together here — rather than combining finished statistics.
Expecting the deviations to be the answer. The raw deviations always sum to zero; that is a property of the mean, not a result. If your deviations do not sum to zero (within rounding), your mean is wrong, and every later step inherits the error.
Honest limits: what this calculator does not do
This calculator computes the standard deviation and variance of a single list of numbers you provide — exactly, and with the working shown. It does not draw histograms or test whether your data is normally distributed, it does not compute z-scores, confidence intervals or hypothesis tests, and it does not handle grouped or frequency-table data directly: for a frequency table, the repeated values must be listed out (or the calculation done by a weighted method elsewhere). It also cannot tell you whether the population or sample version is the right one for your purpose — that judgement depends on what your data represents, and the guide above gives you the reasoning to make it.
Two further cautions. The standard deviation is sensitive to outliers by design, because deviations are squared: one extreme value can dominate the result, as the 9 does in the worked example, so for heavily skewed data a median-based spread may describe your data better. And a standard deviation computed from two or three values is arithmetically correct but statistically fragile — treat small-sample results as rough descriptions, not precise measurements.
What it does promise: the textbook definition, computed at full precision, both versions side by side, with every intermediate step visible so any result can be verified by hand — in your browser, free, with nothing uploaded.
Sources and References
- Wikipedia — Standard deviation — the definition, formulas for population and sample, and the properties used throughout this guide.
- Wikipedia — Variance — the squared-deviation measure of which the standard deviation is the square root.
- Wikipedia — Bessel’s correction — why the sample formula divides by n minus 1, explained in full.
- NIST/SEMATECH e-Handbook of Statistical Methods — Measures of spread — the US National Institute of Standards and Technology reference on variance and standard deviation.
- Wolfram MathWorld — Standard Deviation — the formal mathematical treatment, including moment notation.
- Wikipedia — Normal distribution — the bell curve behind the 68–95–99.7 empirical rule.
- Wikipedia — Mean — the arithmetic mean, the centre from which every deviation on this page is measured.