HomeDescriptive StatisticsStandard Deviation Calculator - Sample & Population

Standard Deviation Calculator – Sample & Population

Standard Deviation Calculator - Sample & Population

Standard Deviation Calculator

Get the sample and population standard deviation side by side, so you never pick the wrong one by accident. Works from raw data, grouped frequencies, or summary statistics, and reports variance, standard error, coefficient of variation, a confidence interval and a robust MAD comparison.

0. Quick Answer

The standard deviation is the average distance of your values from their mean. A small SD means the data cluster tightly; a large one means they are spread out. It is in the same units as your data, which is what makes it more useful than the variance.

Sample standard deviation
s
s = √[ Σ(x − x̄)² / (n − 1) ]
Divides by n − 1. Use this when your data are a sample from a larger group, which is nearly always. Excel STDEV.S, R sd().
Population standard deviation
σ
σ = √[ Σ(x − μ)² / N ]
Divides by N. Use this only when you measured every member of the group. Excel STDEV.P, NumPy default.
Which one do you need? Ask whether you would be happy to generalise beyond the numbers in front of you. If yes, you have a sample: divide by n − 1. If the numbers are the entire group, for instance all 40 employees in a company when you only care about that company, divide by N. When in doubt use the sample version, because it is the safer, slightly larger estimate. This calculator always shows both.

Key takeaways

  • The n − 1 is called Bessel's correction. Dividing by n would systematically underestimate the spread, because the sample mean sits closer to your own data than the true population mean does.
  • The two versions converge quickly. At n = 5 the sample SD is 12% larger than the population SD; at n = 30 it is 1.7%; at n = 100 it is 0.5%. The choice matters most on small samples.
  • Standard deviation is not standard error. SD measures the spread of individual values; SE measures the precision of the mean and equals SD divided by the square root of n. Confusing them is the single most common error in reporting.
  • One extreme value can dominate it. Both formulas square the deviations, so an outlier has an outsized effect. The calculator reports the median absolute deviation alongside so you can see when this is happening.
  • The old "computational formula" can fail badly. On large values it loses so much precision that it can return a variance of zero when the true answer is one. This tool uses a numerically stable method instead.
  • The SD itself is an estimate with its own uncertainty. From 12 observations, a standard deviation of 5.67 has a 95% confidence interval running from 4.02 to 9.63. That is far wider than most people expect.

📚 1. What Is Standard Deviation?

1.1 The idea, built up from scratch

You want a single number describing how spread out your data are. The obvious first attempt is the average distance from the mean, but that fails immediately: deviations above the mean and below it cancel exactly, and the answer is always zero.

So you square each deviation first, which makes everything positive, then average those squares. That gives the variance. The problem with variance is its units: if you measured heights in centimetres, the variance is in square centimetres, which is meaningless. Take the square root and you are back in centimetres. That is the standard deviation.

SD = √variance  ·  variance = SD²

So the standard deviation is best read as a typical distance from the mean, expressed in the same units as your measurements. If a set of exam marks has a mean of 53 and an SD of 5.7, most marks sit within about 6 points of 53.

1.2 Why divide by n minus 1?

This is the question everyone asks and most pages answer badly. Here is the honest version.

To measure spread you need a centre to measure from. When you only have a sample, you do not know the true population mean, so you use the sample mean instead. But the sample mean is calculated from those very numbers, so it sits closer to them than the true population mean would. The sum of squared deviations comes out too small, every single time, and dividing by n would carry that bias straight through.

Dividing by n − 1 corrects for it exactly. The reason it is exactly one, rather than some other adjustment, is that computing the mean uses up one degree of freedom: once you know the mean and any n − 1 of your values, the last one is determined. Only n − 1 of the deviations are genuinely free to vary.

A subtlety worth knowing. Bessel's correction makes the variance an unbiased estimator, not the standard deviation. Because the square root is a non-linear function, s is still very slightly biased downwards as an estimate of σ. The bias is small, it shrinks as n grows, and essentially nobody corrects for it in practice, but it is why careful texts say "n − 1 gives an unbiased variance" rather than an unbiased SD.

1.3 How much difference does it actually make?

nSample SD relative to population SDDifference
2√(2/1) = 1.41441.4% larger
5√(5/4) = 1.11811.8% larger
10√(10/9) = 1.0545.4% larger
30√(30/29) = 1.0171.7% larger
100√(100/99) = 1.0050.5% larger
1,000√(1000/999) = 1.00050.05% larger

The choice matters enormously on tiny samples and hardly at all on large ones. That is a useful thing to know, because it tells you where to spend your attention: if two people disagree about an SD computed from n = 8, the divisor is very likely the reason.

1.4 What the standard deviation tells you about your data

If the data are roughly bell-shaped, the empirical rule gives you quick landmarks: about 68% of values fall within one SD of the mean, about 95% within two, and about 99.7% within three. So an SD of 5.7 around a mean of 53 says most values live between 47 and 59, and almost all between 42 and 64.

If the data are not bell-shaped, those percentages do not hold, but Chebyshev's inequality still guarantees a weaker version for any distribution: at least 75% of values lie within two SDs of the mean and at least 89% within three. That guarantee is loose, but it is unconditional.

1.5 Standard deviation versus its relatives

MeasureWhat it describesFormulaUnits
Standard deviationSpread of individual values around the mean√varianceSame as the data
VarianceThe same thing, before taking the rootSD²Squared
Standard errorPrecision of the mean, not of the dataSD / √nSame as the data
Coefficient of variationSpread relative to the size of the meanSD / meanUnitless, often a %
RangeDistance from smallest to largestmax − minSame as the data
Interquartile rangeSpread of the middle halfQ3 − Q1Same as the data
MADRobust spread, immune to outliersmedian of |x − median|Same as the data
The most consequential confusion on this list. Standard deviation and standard error are not interchangeable. A paper reporting "mean 53 ± 1.64" when that 1.64 is a standard error is describing something four times narrower than "mean 53 ± 5.67" with a standard deviation. Error bars on a chart are ambiguous unless the caption says which one they are, and readers routinely assume the wrong one.

🧮 2. Set Up Your Calculation

Paste your numbers and the calculator returns both standard deviations, the variance, the standard error, the coefficient of variation, a confidence interval and a robust MAD comparison.

One column is loaded by default. Press Add cluster to compare groups.
Only used for the finite population correction on the standard error.
📁 Or upload a CSV / Excel file
Supports .csv, .txt, .xlsx and .xls. Every column you click becomes its own cluster.

For data already summarised into classes or repeated values. Enter either class midpoints or the values themselves, with a frequency for each.

If you only have summary figures, enter what you have. This is common when checking a published result or working from a textbook exercise.

Two different questions here, and they have different answers. Pooled SD estimates a shared within-group spread and is what a t-test uses. Combined SD is the spread you would get by merging all the data into one pile, which is larger because it includes the gap between the group means.

Enter each group's sample size, mean and standard deviation. The SDs must be sample SDs, computed with n − 1.

Move between the four quantities that all describe the same spread. Give any one plus the sample size and the calculator fills in the rest.

Needed for anything involving the standard error.
Needed for the coefficient of variation.

Both are always calculated and shown. This only decides which one headlines.

📊 3. Results

Enter your numbers above and press Calculate Standard Deviation. Both standard deviations, the variance, the spread picture, charts and reporting sentences will appear here.

🧠 4. Interpretation of Results, In Detail

Run the calculator to fill this section with your own numbers. The ten sub-sections below explain every part of the output.

4.1 Reading the number itself

The standard deviation is a typical distance from the mean, in your original units. If exam marks have a mean of 53 and an SD of 5.7, a typical mark sits about 6 points away from 53 in one direction or the other. If component lengths have a mean of 12.1 mm and an SD of 0.29 mm, parts typically deviate by about three tenths of a millimetre.

It is not the average absolute deviation, which would be a slightly smaller number, because squaring gives extra weight to the larger deviations. That is a real property, not a flaw: it is why the SD is sensitive to outliers, and why it is the right measure when large deviations matter more than small ones.

4.2 Sample or population, decided properly

The question is not how many values you have. It is whether those values are the entire group you want to describe.

If you weighed every one of the 40 penguins in a colony and only want to describe that colony, you have a population: divide by N. If you weighed 40 penguins in order to say something about penguins in general, you have a sample: divide by n − 1. The same 40 numbers, two different answers, because the question changed.

When in doubt use the sample version. It is slightly larger, which makes it the conservative choice, and it is what every statistical procedure downstream expects.

4.3 Standard deviation is not standard error

This is the most damaging confusion in applied statistics, and it appears constantly in published figures.

The standard deviation describes your data. It tells you how spread out individual observations are. Collecting more data does not shrink it: if heights vary by 8 cm, they vary by 8 cm whether you measure 30 people or 3,000.

The standard error describes your estimate. It tells you how precisely you know the mean, and it equals the SD divided by the square root of n. Collecting more data does shrink it, because averages of larger samples are more stable.

So "mean 53 ± 5.67" and "mean 53 ± 1.64" can describe exactly the same dataset of 12 values. The first uses the SD and describes the spread of marks; the second uses the SE and describes how well the average is pinned down. Error bars on a chart are ambiguous unless the caption says which they are, and readers who assume the wrong one will draw wrong conclusions about variability.

4.4 When one value is doing all the work

Because deviations are squared, a single extreme observation can dominate the standard deviation completely. The results table shows each value's share of the total sum of squares, and on clean data no value contributes much more than its fair share of 1/n. When one contributes 40% or more, the SD is largely describing that one point.

The calculator reports a robust alternative alongside: 1.4826 times the median absolute deviation, scaled so that it matches the standard deviation for normally distributed data. When the classical SD is much larger than this robust estimate, you have a strong signal that outliers are inflating it. A ratio above about 1.6 is worth investigating.

That does not automatically mean the outlier should go. It means you should look at it, decide deliberately, and say what you decided.

4.5 The standard deviation is itself an estimate

People treat the SD as a fact about the data, but when your data are a sample it is an estimate of an unknown population value, and it carries real uncertainty.

From 12 observations, a standard deviation of 5.67 has a 95% confidence interval running from about 4.02 to 9.63. The upper limit is more than twice the lower one. That is far wider than most people expect, and it has a practical consequence: comparing two standard deviations from small samples almost never establishes anything.

The interval narrows slowly. You need roughly 200 observations before the 95% interval for an SD is within about 10% of the estimate. Note also that this particular interval assumes normality more strongly than most procedures do, so treat it as indicative rather than exact.

4.6 What the SD tells you about shape, which is nothing

Two datasets can share a mean and a standard deviation while looking entirely different. One might be symmetric and bell-shaped; the other might be strongly skewed with a long tail; a third might be bimodal with nothing at all near the mean.

The empirical rule (about 68% within one SD, 95% within two, 99.7% within three) only holds for roughly bell-shaped data. On skewed data the actual coverage can be quite different, which is why the calculator reports your observed coverage next to what a normal distribution would predict. If those two disagree markedly, the mean and SD are a poor summary and you should report the median and interquartile range as well.

Chebyshev's inequality gives a guarantee that holds for any distribution: at least 75% of values within two SDs, at least 89% within three. It is much weaker than the empirical rule, but it is unconditional.

4.7 The old computational formula, and why this tool does not use it

Textbooks often teach a shortcut for the sum of squares: Σx² − (Σx)²/n. It is algebraically identical to the definition and it needs only one pass through the data, which mattered enormously when calculations were done by hand or on early machines.

On a computer it is dangerous. Both terms can be enormous while their difference is tiny, so nearly all the significant digits cancel away. Take the three values 100000001, 100000002 and 100000003. The true sum of squared deviations is 2. The shortcut formula, evaluated in standard double precision, returns 0, implying a standard deviation of zero for three clearly different numbers.

This calculator uses Welford's method, which updates the mean and the sum of squares one observation at a time and never forms those huge intermediate values. It is exact to within rounding on any data you are likely to have. The calculator also runs the shortcut formula in the background purely to check, and warns you when the two disagree, which is a warning no other standard deviation page will give you.

4.8 Grouped data is an approximation

When you only have a frequency table, every observation in a class has to be treated as sitting exactly at the class midpoint. That discards the variation inside each class, so the result is close but not exact.

The error is usually small when classes are narrow and roughly symmetric within themselves, and it grows with wider classes. Open-ended classes such as "60 and over" are the worst case, because you have to invent a midpoint and your choice directly changes the answer. If the raw values still exist anywhere, use them instead.

4.9 Reading the four charts

Chart 1 plots your observations with the mean and the one and two standard deviation bands drawn across them, which is the fastest way to see whether the SD is describing the bulk of your data. Chart 2 shows each value's squared deviation, so a single dominant bar tells you immediately that one observation is driving the result. Chart 3 shows how the sample and population versions converge as n grows, with your own sample size marked. Chart 4 compares the SD against the range, the interquartile range, the robust MAD estimate and the standard error, all in your original units.

Chart 2 is the one to look at first when something seems wrong. On well-behaved data the bars are of broadly similar height; when one towers over the rest, the standard deviation is telling you about that point rather than about your data.

4.10 A quick sanity check you can do in your head

The range rule of thumb says the standard deviation is roughly the range divided by four, because most data span about four standard deviations. For a dataset running from 45 to 63, that gives 18/4 = 4.5 against an actual SD of 5.67. Close enough to confirm you have not misplaced a decimal point.

The rule is crude and it breaks down badly on skewed data or with outliers, where the range inflates and the estimate becomes too high. But if your computed SD differs from range/4 by a factor of five or more, check your arithmetic before you check your data.

5. How to Write Your Results in Research

▶ Run the analysis above to auto-fill all five examples with your results.

Example 1, Full Sentence for a Paper
Run the calculator to generate this sentence from your data.
📌 Key conventions for this style
  • Italicise M, SD and n in APA style.
  • Always give the sample size. An SD without n cannot be judged.
  • State whether it is a sample or population SD if there is any chance of ambiguity.
  • Report the SD to one more decimal place than the raw data, no more.
Example 2, Compact Inline Format
Run the calculator to generate this snippet.
📌 Key conventions for this style
  • For tables, figure captions and parenthetical use.
  • The convention M = 53.17, SD = 5.67 is understood everywhere.
  • Never write 53.17 ± 5.67 without saying what the ± represents.
Example 3, Plain-Language Summary
Run the calculator to generate this summary.
📌 Key conventions for this style
  • Never write "standard deviation" for a general audience.
  • "Most values fall between X and Y" is understood by everyone.
  • Give the range in original units, which is what people actually picture.
  • Do not imply the interval is exact when the data may be skewed.
Example 4, Methods Note
Run the calculator to generate this methods note.
📌 Key conventions for this style
  • State explicitly whether you used n or n − 1.
  • State whether error bars show SD, SE or a confidence interval. Journals increasingly require this.
  • If the data were grouped, say so and note that the figure is an approximation.
  • If you excluded outliers, say which, how many and on what rule.
Example 5, Robustness or Precision Note
Run the calculator to generate this statement.
📌 Key conventions for this style
  • Reviewers increasingly ask what a dispersion estimate is sensitive to.
  • Report the robust MAD-based figure alongside when outliers are present.
  • Give the confidence interval for the SD when comparing dispersion between groups.
  • Avoid claiming one group is "more variable" than another from small samples without a formal test.

6. Formulas Used

Sample Standard Deviation
s = √[ Σ(xᵢ − x̄)² / (n − 1) ]
The sample mean
n − 1Bessel's correction. One degree of freedom is used up estimating the mean
Use whenYour data are a sample from a larger group. This is the usual case
SoftwareExcel STDEV.S, R sd(), NumPy ddof=1
UndefinedIf n = 1, because n − 1 is zero
Population Standard Deviation
σ = √[ Σ(xᵢ − μ)² / N ]
μThe population mean, known exactly because you measured everyone
NThe full population size, not a sample size
Use whenThe values you have ARE the entire group you want to describe
SoftwareExcel STDEV.P, NumPy default ddof=0
Relationships = σ × √(n / (n − 1)), so s is always the larger
Variance, and Its Relationship to the SD
s² = Σ(x − x̄)² / (n − 1)  ·  s = √(s²)
UnitsSquared. Centimetres become square centimetres, which is why the SD is reported instead
Why it existsVariances of independent quantities add. Standard deviations do not
Never negativeIt is a sum of squares. A negative variance always means an arithmetic error
Grouped Frequency Data
x̄ = Σfx / Σf  ·  s = √[ Σf(x − x̄)² / (Σf − 1) ]
xThe class midpoint, (lower limit + upper limit) / 2
fThe frequency of that class
ΣfThe total number of observations, which plays the role of n
ApproximationEvery value in a class is treated as sitting at the midpoint
Worst caseWide classes, or open-ended classes with no defined midpoint
Pooled Standard Deviation
sₚ = √[ Σ(nᵢ − 1)sᵢ² / (N − k) ]
kThe number of groups
NTotal observations across all groups
AssumesAll groups share one underlying variance
Used byStudent's t-test, ANOVA, and the denominator of Cohen's d
Not the same asThe SD of all the data merged together, which is larger
Combined Standard Deviation (Merging Groups)
sᶜ² = [ Σ(nᵢ−1)sᵢ² + Σnᵢ(x̄ᵢ − x̄)² ] / (N − 1)
First termWithin-group variation, the same numerator the pooled SD uses
Second termBetween-group variation, from how far the group means sit from the grand mean
The grand mean, weighted by group size
AlwaysGreater than or equal to the pooled SD. Equal only when all group means match
Related Measures Derived from the SD
SE = s / √n  ·  CV = s / x̄  ·  robust SD ≈ 1.4826 × MAD
SEStandard error. Precision of the MEAN, not spread of the data
CVCoefficient of variation. Unitless, and only valid on a ratio scale
MADMedian absolute deviation, median of |x − median|
1.4826Scales the MAD so it matches s for normally distributed data
Range rules ≈ range / 4, a rough sanity check only
Confidence Interval for the Standard Deviation
√[ (n−1)s² / χ²α/2 ]  to  √[ (n−1)s² / χ²1−α/2 ]
χ²Chi-square critical values on n − 1 degrees of freedom
AsymmetricThe interval is not centred on s, because the chi-square distribution is skewed
At n = 12An SD of 5.67 gives a 95% interval of 4.02 to 9.63
WarningHighly sensitive to non-normality. Treat it as indicative
Welford's Method, Used by This Calculator
μₖ = μₖ₋₁ + (xₖ − μₖ₋₁)/k  ·  M₂,ₖ = M₂,ₖ₋₁ + (xₖ − μₖ₋₁)(xₖ − μₖ)
M₂Accumulates the sum of squared deviations, one observation at a time
WhyIt never forms the huge intermediate values that the shortcut formula relies on
The shortcutΣx² − (Σx)²/n is algebraically equal but numerically unstable
Failure caseOn 100000001, 100000002, 100000003 the shortcut returns a variance of 0 instead of 1

📝 7. How to Use This Calculator

  1. Paste your numbers into the data column. From my data opens first with one column ready. Enter values comma-separated exactly as the placeholder shows, and the calculator returns both standard deviations, the variance, the standard error, the coefficient of variation and a robust comparison.
  2. Read both standard deviations, then pick one. They are shown side by side deliberately, because choosing the wrong divisor is the most common mistake on this topic. Use the sample version unless the numbers you entered are the entire group you care about.
  3. Load a sample dataset to see the edge cases. Nine are built in, including one with a single dominant outlier, one that is strongly skewed, one where every value is identical, and one with values large enough to break the old textbook shortcut formula.
  4. Add clusters to compare groups. Each gets its own mean, SD, variance, SE and CV in a comparison table. Every column has its own Clear and Remove button, and Remove is disabled on the last remaining column. You can also upload a CSV or Excel file and click the columns you want.
  5. For a frequency table, use the grouped tab. Enter class midpoints or class limits with a frequency for each. Remember the result is an approximation, because every observation is treated as sitting at its class midpoint.
  6. If you only have summary figures, use the third tab. It accepts n with Σx and Σx², or n with the sum of squared deviations, or a variance you want converted back to a standard deviation.
  7. To combine groups, use the pooled tab. It reports both the pooled SD, which describes within-group spread and is what a t-test uses, and the combined SD, which describes the merged dataset. They answer different questions and the tab shows both so you cannot quote the wrong one by accident.
  8. To move between measures, use the convert tab. Give it any one of the standard deviation, variance, standard error or coefficient of variation plus the sample size, and it fills in the others.
  9. Press Calculate Standard Deviation. Nothing is computed until you do, and changing any input clears the results so you never read stale numbers.
  10. Check the warnings and the robust comparison before reporting. If the classical SD is much larger than the MAD-based estimate, one or two values are inflating it, and the per-value contribution table will show you which.

📊 8. How to Calculate Standard Deviation in Excel

Excel gives you one function for each version, and choosing between them is the whole difficulty. Below is the complete workflow in ten steps, each with a picture of what your sheet should look like.

The two functions that matter. STDEV.S divides by n − 1 and is what you want almost always. STDEV.P divides by N and is only correct when your data are the entire population. Everything else on this page is built from those two.
Xstandard-deviation.xlsx - ExcelA1fxValueABCD1ValueStatisticResult252Mean348Sample SD (n-1)455Population SD (N)561Sample variance647Count n758Std error850CV963

Step 1. Put your data in one column with a header, and set aside a block for the statistics. Twelve values are in A2:A13 here, only the first eight are visible.

Xstandard-deviation.xlsx - ExcelD2fx=AVERAGE(A2:A13)ABCD1ValueStatisticResult252Mean53.1667348Sample SD (n-1)455Population SD (N)561Sample variance647Count n758Std error850CV963

Step 2. AVERAGE gives the mean, 53.1667. The standard deviation measures distance from this value.

Xstandard-deviation.xlsx - ExcelD3fx=STDEV.S(A2:A13)ABCD1ValueStatisticResult252Mean53.1667348Sample SD (n-1)5.6702455Population SD (N)561Sample variance647Count n758Std error850CV963

Step 3. STDEV.S divides by n minus 1 and gives 5.6702. This is the SAMPLE standard deviation and the one you want in almost every situation.

Xstandard-deviation.xlsx - ExcelD4fx=STDEV.P(A2:A13)ABCD1ValueStatisticResult252Mean53.1667348Sample SD (n-1)5.6702455Population SD (N)5.4288561Sample variance647Count n758Std error850CV963

Step 4. STDEV.P divides by N and gives 5.4288, about 4.4% smaller. Only use it when your data are the complete population.

Xstandard-deviation.xlsx - ExcelD5fx=VAR.S(A2:A13)ABCD1ValueStatisticResult252Mean53.1667348Sample SD (n-1)5.6702455Population SD (N)5.4288561Sample variance32.1515647Count n12758Std error850CV963

Step 5. VAR.S is the variance, which is simply the SD squared. Note it is in squared units, so it is not directly comparable to your data.

Xstandard-deviation.xlsx - ExcelD7fx=D3/SQRT(D6)ABCD1ValueStatisticResult252Mean53.1667348Sample SD (n-1)5.6702455Population SD (N)5.4288561Sample variance32.1515647Count n12758Std error1.6369850CV963

Step 6. The standard error, s divided by the square root of n. This describes the precision of the MEAN, not the spread of the data. Do not confuse the two.

Xstandard-deviation.xlsx - ExcelD8fx=D3/D2*100ABCD1ValueStatisticResult252Mean53.1667348Sample SD (n-1)5.6702455Population SD (N)5.4288561Sample variance32.1515647Count n12758Std error1.6369850CV10.6650963

Step 7. The coefficient of variation as a percentage. Useful for comparing spread across different scales, but only meaningful on a ratio scale.

Xstandard-deviation.xlsx - ExcelF1fx=SUM(C2:C13)ABCDEF1Valuex - mean(x-mean)^2Sum of squares353.6667252-1.16671.3611348-5.166726.69444551.83333.36115617.833361.3611647-6.166738.02787584.833323.3611

Step 8. The long way, if you want to see the working. Column B is each deviation, column C squares it, and the sum of column C is the sum of squares, 353.6667.

Xstandard-deviation.xlsx - ExcelB4fx=B2/(B3-1)AB1QuantityValue2Sum of squares353.66673n124Sample variance32.15155Sample SD5.67026

Step 9. Divide the sum of squares by n minus 1 to get the variance, then take the square root for the standard deviation. This reproduces STDEV.S exactly.

Xstandard-deviation.xlsx - ExcelD2fx=B2*(A2-24)^2ABCD1MidpointFrequencyf*xf(x-mean)^2253151083.03157105567.04251230012.05356210726.0645290882.07

Step 10. Grouped data has no single-function shortcut. Build the columns yourself: mean = SUM(C)/SUM(B) = 24.0, then SD = SQRT(SUM(D)/(SUM(B)-1)) = 10.6188.

The complete function reference

What you wantExcel formulaResult on the example
Sample SD=STDEV.S(A2:A13)5.6702
Population SD=STDEV.P(A2:A13)5.4288
Sample variance=VAR.S(A2:A13)32.1515
Population variance=VAR.P(A2:A13)29.4722
Mean=AVERAGE(A2:A13)53.1667
Count=COUNT(A2:A13)12
Sum of squared deviations=DEVSQ(A2:A13)353.6667
Standard error of the mean=STDEV.S(A2:A13)/SQRT(COUNT(A2:A13))1.6369
Coefficient of variation=STDEV.S(A2:A13)/AVERAGE(A2:A13)0.1067, or 10.67%
Median absolute deviation=MEDIAN(ABS(A2:A13-MEDIAN(A2:A13)))4.5 (array formula)
Robust SD estimate=1.4826*MAD6.6717
SD ignoring text and logicals=STDEV.S(range)the default behaviour
SD including text as zero=STDEVA(range)rarely what you want
SD with a condition=STDEV.S(IF(B2:B13="A",A2:A13))array formula, Ctrl+Shift+Enter in older Excel
CI lower bound for the SD=SQRT((n-1)*VAR.S(r)/CHISQ.INV.RT(0.025,n-1))4.0168
CI upper bound for the SD=SQRT((n-1)*VAR.S(r)/CHISQ.INV.RT(0.975,n-1))9.6274

Grouped data, which has no single function

StepFormulaResult
Column C: f × x=B2*A2fill down
Total frequency N=SUM(B2:B6)30
Mean=SUM(C2:C6)/SUM(B2:B6)24.0000
Column D: f(x − mean)²=B2*(A2-$F$2)^2fill down
Sample SD=SQRT(SUM(D2:D6)/(SUM(B2:B6)-1))10.6188
Population SD=SQRT(SUM(D2:D6)/SUM(B2:B6))10.4403
One-cell version=SQRT(SUMPRODUCT(B2:B6,(A2:A6-mean)^2)/(SUM(B2:B6)-1))10.6188

Seven mistakes that catch people out

  • Using STDEV.P because it sounds more official. The P stands for population, not precise. Unless you measured everyone, you want STDEV.S.
  • Using the legacy STDEV or STDEVP. They still work for backward compatibility, but the modern names make the divisor explicit and are far less error-prone.
  • Confusing STDEVA with STDEV.S. The A version treats text as zero and logical values as 0 or 1, which will silently distort your answer if the range contains anything non-numeric.
  • Including the header row in the range. Excel ignores text, so it will not error, but if a header is numeric it will be treated as data.
  • Blank cells versus zeros. Blanks are excluded; zeros are included and pull the mean down. If missing data were entered as 0, your SD is wrong.
  • Reporting error bars without saying what they are. Excel's default error bars are the standard error, not the standard deviation. Label them.
  • Building the SD by hand with Σx² − (Σx)²/n. Algebraically correct, numerically fragile. On large values it can return a negative number under the square root. Use DEVSQ or STDEV.S.
Google Sheets. Every formula above works unchanged. Sheets also accepts the legacy STDEV and STDEVP. The MAD array formula needs ARRAYFORMULA(...) wrapped around it.
A visible trap. Excel's status bar shows an average and a count when you select a range, but it does not show a standard deviation by default. Right-click the status bar to add it, and note that the one it adds is STDEV.S.

📈 9. How to Calculate Standard Deviation in R

R has one function, sd(), and it always divides by n − 1. There is no argument to change that, which is either a helpful safeguard or an irritation depending on what you need.

The one trap in R. sd() has no ddof or population argument. If you genuinely need the population standard deviation you must convert it yourself: sd(x) * sqrt((n - 1) / n). Many people assume a hidden argument exists, do not find it, and quietly report the wrong thing.
R, base packages only
# Standard Deviation Calculator in R (base R, no packages)

# ---- 1. Your data -----------------------------------------------------
x <- c(52, 48, 55, 61, 47, 58, 50, 63, 45, 56, 54, 49)
n <- length(x)

# ---- 2. Both standard deviations --------------------------------------
m     <- mean(x)
s     <- sd(x)                        # SAMPLE: R ALWAYS divides by n - 1
sigma <- sd(x) * sqrt((n - 1) / n)    # POPULATION: you must convert manually
var_s <- var(x)                       # sample variance, also n - 1
var_p <- var(x) * (n - 1) / n         # population variance

# ---- 3. Related measures ----------------------------------------------
se        <- s / sqrt(n)              # standard error OF THE MEAN
cv        <- s / m * 100              # coefficient of variation, %
robust_sd <- mad(x)                   # NOTE: R's mad() ALREADY includes 1.4826
raw_mad   <- median(abs(x - median(x)))   # the unscaled version

# ---- 4. Confidence interval for the SD --------------------------------
alpha <- 0.05
lo <- sqrt((n - 1) * var_s / qchisq(1 - alpha/2, n - 1))
hi <- sqrt((n - 1) * var_s / qchisq(alpha/2,     n - 1))

# ---- 5. Grouped frequency data ----------------------------------------
mids  <- c(5, 15, 25, 35, 45)
freqs <- c(3,  7, 12,  6,  2)
N_g    <- sum(freqs)
mean_g <- sum(freqs * mids) / N_g
sd_g   <- sqrt(sum(freqs * (mids - mean_g)^2) / (N_g - 1))

# ---- 6. Pooled standard deviation --------------------------------------
ns   <- c(10, 10); ms <- c(53.5, 70.5); sds <- c(6.096447, 3.979112)
within  <- sum((ns - 1) * sds^2)
N_tot   <- sum(ns); k <- length(ns)
pooled  <- sqrt(within / (N_tot - k))
grand   <- sum(ns * ms) / N_tot
between <- sum(ns * (ms - grand)^2)
combined <- sqrt((within + between) / (N_tot - 1))

cat(sprintf("n = %d   mean = %.6f\n", n, m))
cat(sprintf("SAMPLE SD     s = %.10f   (R default, n - 1)\n", s))
cat(sprintf("POPULATION SD s = %.10f   (converted manually)\n", sigma))
cat(sprintf("  s is %.4f%% larger, exactly sqrt(n/(n-1))\n", (s/sigma - 1)*100))
cat(sprintf("variance: sample %.6f, population %.6f\n", var_s, var_p))
cat(sprintf("SE = %.6f   CV = %.4f%%   mad() = %.6f\n", se, cv, robust_sd))
cat(sprintf("95%% CI for the SD: %.6f to %.6f\n", lo, hi))
cat(sprintf("GROUPED  N = %d, mean = %.4f, sample SD = %.6f\n", N_g, mean_g, sd_g))
cat(sprintf("POOLED   %.6f   COMBINED %.6f\n", pooled, combined))

# ---- 7. One figure ----------------------------------------------------
plot(seq_len(n), x, pch = 19, cex = 1.5, col = "#0f766e", bty = "n",
     xlab = "observation number", ylab = "value",
     ylim = range(c(x, m - 2.4*s, m + 2.4*s)),
     main = sprintf("Data with SD bands   n=%d, mean=%.2f, s=%.2f", n, m, s))

# shade the +/- 1 and +/- 2 SD bands behind the points
rect(0, m - 2*s, n + 1, m + 2*s, col = adjustcolor("#0369a1", 0.10), border = NA)
rect(0, m - 1*s, n + 1, m + 1*s, col = adjustcolor("#0f766e", 0.18), border = NA)
points(seq_len(n), x, pch = 19, cex = 1.5, col = "#0f766e")
abline(h = m, lwd = 2, col = "#0f172a")
abline(h = c(m - s, m + s), lty = 2, col = "#0f766e")
abline(h = c(m - 2*s, m + 2*s), lty = 3, col = "#0369a1")

legend("topright", bty = "n", cex = 0.85,
       legend = c(sprintf("mean = %.2f", m),
                  sprintf("+/- 1 SD = %.2f", s),
                  "+/- 2 SD"),
       col = c("#0f172a", "#0f766e", "#0369a1"),
       lwd = c(2, NA, NA), lty = c(1, 2, 3))

What the script prints

n = 12   mean = 53.166667
SAMPLE SD     s = 5.6702306083   (R default, n - 1)
POPULATION SD s = 5.4288324916   (converted manually)
  s is 4.4466% larger, exactly sqrt(n/(n-1))
variance: sample 32.151515, population 29.472222
SE = 1.636855   CV = 10.6650%   mad() = 6.671700
95% CI for the SD: 4.016764 to 9.627360
GROUPED  N = 30, mean = 24.0000, sample SD = 10.618786
POOLED   5.147815   COMBINED 10.057728

These are the same numbers the Python script produces and the same numbers the calculator at the top of this page produces.

Line-by-line explanation

  • Block 1 and 2 show the manual conversion R forces on you. Note that var() also uses n − 1, so the population variance needs the same correction factor.
  • Block 3 contains a genuine trap. R's mad() already multiplies by 1.4826 by default, so it returns 6.6717 directly, not the raw MAD of 4.5. If you write 1.4826 * mad(x) you will double-scale it. The unscaled version is shown for comparison.
  • Block 4 builds the confidence interval from the chi-square distribution. Note the reversal: the upper chi-square quantile gives the lower bound of the interval, because the quantity is in the denominator.
  • Block 5 handles grouped data, which R has no built-in function for. Weighting by frequency is straightforward with vectorised arithmetic.
  • Block 6 computes both the pooled and the combined SD, showing that they answer different questions. The gap between 5.15 and 10.06 here is entirely the difference between the two group means.
  • Block 7 draws the SD bands behind the points, which is the single most useful diagnostic plot for a standard deviation.

Useful one-liners

TaskRNote
Sample SDsd(x)always n − 1
Population SDsd(x)*sqrt((length(x)-1)/length(x))no built-in
Sample variancevar(x)also n − 1
Standard errorsd(x)/sqrt(length(x))no built-in se()
Coefficient of variationsd(x)/mean(x)multiply by 100 for a %
Robust SDmad(x)already scaled by 1.4826
Raw MADmad(x, constant = 1)the unscaled version
SD of every columnapply(df, 2, sd)or sapply(df, sd)
SD by grouptapply(x, g, sd)or aggregate(x ~ g, FUN = sd)
Ignore missing valuessd(x, na.rm = TRUE)otherwise NA propagates
Weighted SDsqrt(sum(w*(x-weighted.mean(x,w))^2)/(sum(w)-1))for frequency data
Full summarysummary(x); sd(x)summary() omits the SD
Rolling SDzoo::rollapply(x, 5, sd)needs the zoo package

🐍 10. How to Calculate Standard Deviation in Python

NumPy has one function with a switch, and the switch defaults to the version most people do not want. The script below was run before being published, so the output shown underneath is the real console output.

The trap that catches almost everyone. np.std(x) defaults to ddof=0, which is the population standard deviation. R's sd() and Excel's STDEV.S both give the sample version. So the same data can produce two different answers depending on the language, and the difference is largest exactly when your sample is smallest. Write ddof=1 explicitly whenever your data are a sample. Note that pandas goes the other way: df.std() defaults to ddof=1.
Python 3, NumPy + SciPy + Matplotlib
# Standard Deviation Calculator in Python
# Sample and population SD, grouped data, pooled SD, and a stability check.
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from scipy import stats

# ---- 1. Your data -----------------------------------------------------
x = np.array([52, 48, 55, 61, 47, 58, 50, 63, 45, 56, 54, 49], dtype=float)
n = x.size

# ---- 2. Both standard deviations --------------------------------------
mean   = x.mean()
s      = x.std(ddof=1)      # SAMPLE: divides by n-1. Excel STDEV.S, R sd()
sigma  = x.std(ddof=0)      # POPULATION: divides by N. This is NumPy's DEFAULT
var_s  = x.var(ddof=1)
var_p  = x.var(ddof=0)

# ---- 3. Related measures ----------------------------------------------
se  = s / np.sqrt(n)        # standard error OF THE MEAN, not of the data
cv  = s / mean * 100        # coefficient of variation, %
med = np.median(x)
mad = np.median(np.abs(x - med))
robust_sd = 1.4826 * mad    # scaled to match s for normal data

# ---- 4. Confidence interval for the SD (chi-square) -------------------
alpha = 0.05
lo = np.sqrt((n - 1) * var_s / stats.chi2.ppf(1 - alpha/2, n - 1))
hi = np.sqrt((n - 1) * var_s / stats.chi2.ppf(alpha/2,     n - 1))

# ---- 5. Grouped frequency data ----------------------------------------
mids  = np.array([5, 15, 25, 35, 45], dtype=float)
freqs = np.array([3,  7, 12,  6,  2], dtype=float)
N_g    = freqs.sum()
mean_g = (freqs * mids).sum() / N_g
ss_g   = (freqs * (mids - mean_g)**2).sum()
sd_g   = np.sqrt(ss_g / (N_g - 1))

# ---- 6. Pooled standard deviation --------------------------------------
groups = [(10, 53.5, 6.096447), (10, 70.5, 3.979112)]   # (n, mean, sd)
within = sum((g[0] - 1) * g[2]**2 for g in groups)
N_tot  = sum(g[0] for g in groups)
k      = len(groups)
pooled = np.sqrt(within / (N_tot - k))
grand  = sum(g[0] * g[1] for g in groups) / N_tot
between = sum(g[0] * (g[1] - grand)**2 for g in groups)
combined = np.sqrt((within + between) / (N_tot - 1))

# ---- 7. Why the textbook shortcut is dangerous ------------------------
big = np.array([100000001, 100000002, 100000003], dtype=float)
shortcut_ss = (big**2).sum() - big.sum()**2 / big.size    # algebraically right
correct_ss  = ((big - big.mean())**2).sum()               # numerically right

print(f"n = {n}   mean = {mean:.6f}")
print(f"SAMPLE SD     s = {s:.10f}   (ddof=1, Excel STDEV.S)")
print(f"POPULATION SD s = {sigma:.10f}   (ddof=0, NumPy DEFAULT)")
print(f"  s is {(s/sigma - 1)*100:.4f}% larger, exactly sqrt(n/(n-1))")
print(f"variance: sample {var_s:.6f}, population {var_p:.6f}")
print(f"SE = {se:.6f}   CV = {cv:.4f}%   robust SD (1.4826*MAD) = {robust_sd:.6f}")
print(f"95% CI for the SD: {lo:.6f} to {hi:.6f}")
print(f"GROUPED  N = {N_g:.0f}, mean = {mean_g:.4f}, sample SD = {sd_g:.6f}")
print(f"POOLED   {pooled:.6f}   COMBINED {combined:.6f}")
print(f"SHORTCUT on large values: {shortcut_ss}   CORRECT: {correct_ss}")
print(f"  the shortcut is WRONG by {abs(shortcut_ss - correct_ss)} here")

# ---- 8. One figure ----------------------------------------------------
fig, ax = plt.subplots(figsize=(9, 5))
ax.scatter(range(1, n + 1), x, s=70, color="#0f766e", zorder=4, label="observations")
ax.axhline(mean, color="#0f172a", lw=2, label=f"mean = {mean:.2f}")
for k_sd, col, a in [(1, "#0f766e", .22), (2, "#0369a1", .12)]:
    ax.axhspan(mean - k_sd*s, mean + k_sd*s, color=col, alpha=a,
               label=f"±{k_sd} SD" if k_sd == 1 else f"±{k_sd} SD")
ax.set_xlabel("observation number")
ax.set_ylabel("value")
ax.set_title(f"Data with SD bands   n={n}, mean={mean:.2f}, s={s:.2f}")
ax.legend(frameon=False, fontsize=9, loc="upper right")
ax.spines[["top", "right"]].set_visible(False)
fig.tight_layout()
fig.savefig("standard_deviation.png", dpi=150)
print("saved standard_deviation.png")

Actual output from running the script

n = 12   mean = 53.166667
SAMPLE SD     s = 5.6702306083   (ddof=1, Excel STDEV.S)
POPULATION SD s = 5.4288324916   (ddof=0, NumPy DEFAULT)
  s is 4.4466% larger, exactly sqrt(n/(n-1))
variance: sample 32.151515, population 29.472222
SE = 1.636855   CV = 10.6650%   robust SD (1.4826*MAD) = 6.671700
95% CI for the SD: 4.016764 to 9.627360
GROUPED  N = 30, mean = 24.0000, sample SD = 10.618786
POOLED   5.147815   COMBINED 10.057728
SHORTCUT on large values: 0.0   CORRECT: 2.0
  the shortcut is WRONG by 2.0 here

Line-by-line explanation

  • Block 2 computes both versions side by side with the ddof argument made explicit in each case, which is the habit worth forming. The printed ratio confirms the relationship s = σ × √(n / (n − 1)).
  • Block 3 derives the standard error, the coefficient of variation and the robust MAD-based estimate. Unlike R, NumPy has no built-in mad(), so there is no double-scaling trap here, but you must remember the 1.4826 yourself.
  • Block 4 builds the confidence interval for the standard deviation from the chi-square distribution. Note the reversal: the upper chi-square quantile produces the lower bound.
  • Block 5 handles grouped frequency data by weighting, which vectorises cleanly in NumPy.
  • Block 6 computes both the pooled and the combined standard deviation from group summaries alone, without needing the raw data.
  • Block 7 is the important one. It runs the textbook shortcut formula alongside the correct calculation on three large values, and prints the result: the shortcut returns 0.0 where the true answer is 2.0. Both terms are around 3 × 1016, so their difference falls below the precision of a double. This is why this calculator uses Welford's method internally.
  • Block 8 plots the data with the one and two standard deviation bands shaded behind it.

Useful one-liners

TaskPythonNote
Sample SDnp.std(x, ddof=1)you must ask for it
Population SDnp.std(x)the NumPy default
Sample variancenp.var(x, ddof=1)same switch
Pandas SDdf['col'].std()defaults to ddof=1, unlike NumPy
Pandas population SDdf['col'].std(ddof=0)the opposite switch
Standard errorstats.sem(x)SciPy, uses ddof=1
Coefficient of variationstats.variation(x, ddof=1)returns a proportion
Robust SDstats.median_abs_deviation(x, scale='normal')applies the 1.4826
Raw MADstats.median_abs_deviation(x)unscaled
Ignore missing valuesnp.nanstd(x, ddof=1)or pandas, which skips NaN by default
SD by groupdf.groupby('g')['x'].std()ddof=1
SD of every columndf.std()ddof=1
Rolling SDdf['x'].rolling(5).std()ddof=1
Weighted SDnp.sqrt(np.average((x-np.average(x,weights=w))**2, weights=w))population form
Numerically safe by defaultnp.std, statistics.stdevboth use a two-pass method
Cross-checking. statistics.stdev(x) from the standard library gives the sample SD and statistics.pstdev(x) the population version, with no ambiguous default. They are slower than NumPy on large arrays but they are unambiguous, which makes them useful for verifying a result you are unsure about.

📋 11. Reference Tables

11.1 How much the divisor actually matters

The ratio between the sample and population standard deviation is exactly √(n / (n − 1)). This table tells you when the choice is worth arguing about and when it is not.

nn − 1s / σ ratioHow much larger s is
211.41421441.421%
321.22474522.474%
431.15470115.470%
541.11803411.803%
651.0954459.545%
871.0690456.904%
1091.0540935.409%
12111.0444664.447%
15141.0350983.510%
20191.0259782.598%
25241.0206212.062%
30291.0170951.710%
40391.0127391.274%
50491.0101531.015%
100991.0050380.504%
2001991.0025090.251%
5004991.0010020.100%
10009991.0005000.050%
The practical reading. Below about n = 20 the choice can visibly change a reported figure. Above n = 100 it changes the third decimal place. If two people disagree about a standard deviation computed from a small sample, check the divisor first.

11.2 How uncertain is your standard deviation?

Multiply your SD by the two factors to get its 95% confidence interval. This is the table that surprises people most.

n95% CI lower95% CI upperUpper / lowerInterval width
30.5207 × s6.2847 × s12.07×576.4% of s
50.5991 × s2.8736 × s4.80×227.4% of s
100.6878 × s1.8256 × s2.65×113.8% of s
150.7321 × s1.5771 × s2.15×84.5% of s
200.7605 × s1.4606 × s1.92×70.0% of s
300.7964 × s1.3443 × s1.69×54.8% of s
500.8353 × s1.2461 × s1.49×41.1% of s
1000.8780 × s1.1617 × s1.32×28.4% of s
2000.9107 × s1.1089 × s1.22×19.8% of s
5000.9416 × s1.0662 × s1.13×12.5% of s
10000.9580 × s1.0459 × s1.09×8.8% of s

At n = 12 with s = 5.6702, the interval is 5.6702 × 0.7084 = 4.0168 to 5.6702 × 1.6979 = 9.6274. The upper bound is 2.4 times the lower one. You need roughly n = 200 before the interval is within about 10% either side, which is why claims that one small group is "more variable" than another are usually unsupportable.

11.3 The empirical rule, and the guarantee that always holds

The middle columns apply only to roughly bell-shaped data. Chebyshev's inequality on the right holds for any distribution whatsoever, which makes it much weaker but completely safe.

WithinNormal distributionOutsideChebyshev, any distribution
±0.5 SD38.29%61.71%no guarantee
±1 SD68.27%31.73%no guarantee
±1.5 SD86.64%13.36%at least 55.6%
±1.96 SD95.00%5.00%at least 74.0%
±2 SD95.45%4.55%at least 75.0%
±2.5 SD98.76%1.24%at least 84.0%
±3 SD99.73%0.27%at least 88.9%
±4 SD99.99%0.01%at least 93.8%
Do not use the empirical rule on skewed data. For a strongly right-skewed variable such as income, the mean minus two standard deviations can easily be negative, which is impossible for the quantity being measured. That is a sign the summary is a poor fit, not that the arithmetic is wrong.

11.4 Chi-square values behind the SD confidence interval

ndfχ² 0.025χ² 0.975χ² 0.05χ² 0.95
540.484411.14330.71079.4877
1092.700419.02283.325116.9190
12113.815721.92004.574819.6751
15145.628726.11896.570623.6848
20198.906532.852310.117030.1435
252412.401239.364113.848436.4150
302916.047145.722317.708442.5570
403923.654358.120125.695454.5722
504931.554970.222433.930366.3386
605939.661982.117442.339377.9305
1009973.3611128.422077.0463123.2252

Note the reversal when you use these: the upper chi-square quantile gives the lower bound of the interval for the standard deviation, because the quantity sits in the denominator.

11.5 Measures of spread compared

MeasureFormulaRobust to outliers?Same units?Best used for
Standard deviation√[Σ(x−x̄)²/(n−1)]NoYesRoughly symmetric data, and anything feeding a parametric test
VarianceSD²NoNo, squaredMathematical work, because variances add
Standard errorSD / √nNoYesDescribing how precisely the mean is known
Coefficient of variationSD / meanNoUnitlessComparing spread across different scales
Rangemax − minNo, very sensitiveYesQuick checks and quality control limits
Interquartile rangeQ3 − Q1YesYesSkewed data, boxplots
MADmedian of |x − median|Yes, veryYesData with outliers you cannot remove
Robust SD1.4826 × MADYesYesA drop-in replacement for the SD when outliers are present

11.6 Software defaults, which do not agree

ToolFunctionDefault divisorHow to get the other one
ExcelSTDEV.S / STDEV.Pyou choose explicitlyswitch function
Google SheetsSTDEV / STDEVPyou choose explicitlyswitch function
Rsd()n − 1multiply by √((n−1)/n)
Python, NumPynp.std()Nddof=1
Python, pandas.std()n − 1ddof=0
Python, statisticsstdev() / pstdev()you choose explicitlyswitch function
SPSSDESCRIPTIVESn − 1not directly offered
Statasummarizen − 1not directly offered
SASPROC MEANSn − 1VARDEF=N
Most calculatorsσn-1 and σn keysboth providedseparate keys
Read the NumPy and pandas rows together. They are the same language and they disagree. np.std(df['x']) and df['x'].std() on identical data return different numbers, and neither raises a warning. This single inconsistency causes more reproducibility failures than any other default in scientific Python.

11.7 What a standard deviation means in familiar contexts

ContextTypical meanTypical SDCVInterpretation
IQ scores1001515%Fixed by construction, not measured
Adult male height (UK)175 cm7 cm4%Very consistent, as biology often is
Adult body weight75 kg15 kg20%Considerably more variable than height
Resting heart rate70 bpm10 bpm14%Moderate individual variation
Exam marks601525%Deliberately spread to discriminate
Household incomevarieslarge60% or moreStrongly skewed, so the SD is a poor summary
Machined part toleranceto spectinyunder 1%Process control aims to minimise it
Daily stock returnnear 01% to 2%enormousThe SD itself is the quantity of interest, called volatility

The coefficient of variation column is the useful one for cross-context comparison, because the standard deviations themselves are in incompatible units. Note the income row: when the CV exceeds about 60% the distribution is usually skewed enough that the mean and SD together mislead.

11.8 Quick reference for common tasks

You want toUseWatch out for
Describe the spread of a sampleSample SD, n − 1Not the population version
Describe a complete populationPopulation SD, NAre you sure it is complete?
Say how precise your mean isStandard errorLabel it clearly, it is not the SD
Compare spread across different unitsCoefficient of variationRatio scale only
Handle data with outliers1.4826 × MAD, or the IQRR's mad() already scales
Summarise skewed dataMedian and IQRThe SD will mislead
Feed a t-test or ANOVAPooled SDNot the combined SD
Compute Cohen's dPooled SDSame caution
Work from a frequency tableGrouped formulaIt is an approximation
Work from a published mean and SDSummary statistics tabCheck which divisor they used

💡 12. Eight Worked Examples

Every number below was computed with the calculator on this page and cross-checked against Python. Each example has its own colour and its own figure. Examples 3 and 6 are the two worth studying closely: one shows a single value hijacking the result, the other shows a formula from most textbooks returning a standard deviation of zero for three different numbers.

1📝 Example 1, The Basic Calculation, Both Versions

Setup: 52, 48, 55, 61, 47, 58, 50, 63, 45, 56, 54, 49

mean53.17-1 SD47.5+1 SD58.84-2 SD41.83+2 SD64.51SD = 5.67Exam marks, n = 12sample SD 5.6702, population SD 5.4288
Figure 1. Every observation plotted, with the one and two standard deviation bands shaded behind them.
n12
Mean53.1667
Sum of squared deviations353.6667
Sample SD (divide by 11)5.6702
Population SD (divide by 12)5.4288
Sample variance32.1515
Population variance29.4722
Ratio s / sigma1.044466 = √(12/11)
Standard error1.6369
Coefficient of variation10.6650%

Reading it: The sample version is 5.6702 and the population version is 5.4288, a difference of 4.45%. That gap is exactly √(12/11), and it exists because the sample mean sits closer to these twelve numbers than the true population mean would. Use 5.6702 unless these twelve marks are the entire group you care about. Note the standard error of 1.6369 is a completely different quantity: it describes how precisely the mean is known, not how spread out the marks are.

2⚖ Example 2, When the Population Version Is Correct

Setup: The same twelve marks, but now they are every student in the class, and you only want to describe that class.

5.67Sample SD (n-1)5.429Population SD (N)1.637Standard error6.672Robust (MAD)Four numbers from the same twelve valuesall in the same units
Figure 2. The quantities compared directly, drawn to scale.
Question askedHow spread out is THIS class?
Is this a sample?No, it is the whole group of interest
Correct choicePopulation SD = 5.4288
If you generalised to all studentsSample SD = 5.6702
Difference0.2414 marks
Standard errorNot meaningful here, there is nothing to generalise to
Rule of thumbAsk whether you would generalise beyond these numbers

Reading it: Nothing about the data changed. The correct answer changed because the question changed. If these twelve marks are the entire class and you only want to describe that class, you have a population and 5.4288 is right. If you are using the class to say something about students in general, you have a sample and 5.6702 is right. This is also why the standard error is meaningless in the first case: there is no wider population for the mean to be an estimate of.

3🚨 Example 3, One Value Doing All the Work

Setup: 120, 118, 125, 119, 122, 121, 117, 124, 123, 119, 126, 116, 121, 120, 118, 180

robust ±1 SDmean124.3-1 SD109.2+1 SD139.4-2 SD94.07+2 SD154.6SD = 15.12Heart rate in bpm, n = 16, one extreme valueclassical SD 15.12 vs robust 3.71
Figure 3. Every observation plotted, with the one and two standard deviation bands shaded behind them.
n16
Mean124.3125
Classical SD15.1205
SD without the 1802.9472
Median120.5
MAD2.5
Robust SD (1.4826 × MAD)3.7065
Ratio classical / robust4.08
The outlier's share of the sum of squares90.4%

Reading it: A single value has more than quintupled the standard deviation, from 2.95 to 15.12. The reason is visible in the contribution table: that one observation accounts for 90.4% of the entire sum of squares. The robust MAD-based estimate of 3.71 ignores it entirely and describes the other fifteen readings honestly. A ratio of 4.08 between the classical and robust figures is a loud signal. This does not automatically mean you delete the 180, but you must look at it and decide deliberately.

4📈 Example 4, Grouped Data, and What It Costs You

Setup: Ages in five 10-year classes with midpoints 5, 15, 25, 35, 45 and frequencies 3, 7, 12, 6, 2.

357151225635245Frequency by class midpoint, N = 30mean 24.00, SD 10.6188
Figure 4. The quantities compared directly, drawn to scale.
Total frequency N30
Classes5
Σfx720.0
Mean24.0000
Σf(x − mean)²3270.0000
Sample SD10.6188
Population SD10.4403
What was assumedevery person in a class is exactly at its midpoint
What was lostall variation inside each class

Reading it: Grouped data gives 10.6188, which is an approximation rather than the truth. Every one of the twelve people in the 20 to 30 class has been treated as if aged exactly 25, which discards the real variation inside that class. The error is usually modest with narrow, symmetric classes and grows with wider ones. The worst case is an open-ended class such as "60 and over", where you must invent a midpoint and your invention directly changes the answer. If the raw ages exist anywhere, use them.

5📏 Example 5, Pooled Is Not the Same as Combined

Setup: Site A: 52, 48, 55, 61, 47, 58, 50, 63, 45, 56 (mean 53.5)
Site B: 71, 68, 75, 66, 73, 70, 69, 77, 64, 72 (mean 70.5)

6.096Site A SD3.979Site B SD5.148Pooled SD10.06Combined SDTwo groups: within-group spread vs merged spreadthe gap is the difference in means
Figure 5. The quantities compared directly, drawn to scale.
Site A: n, mean, SD10, 53.5, 6.0964
Site B: n, mean, SD10, 70.5, 3.9791
Within-group sum of squares477.0000
Pooled SD5.1478
Grand mean62.0
Between-group sum of squares1445.0000
Combined SD (all 20 merged)10.0577
Ratio1.95 times larger

Reading it: The pooled SD of 5.1478 says that within either site, values typically sit about 5 units from that site's own mean. The combined SD of 10.0577 says that if you ignore which site a value came from, the spread is nearly twice as large. Both are correct; they answer different questions. The entire gap comes from the 17-point difference between the two site means, which the combined figure absorbs and the pooled figure excludes. Use pooled for a t-test or Cohen's d, and combined when describing the merged dataset. Quoting the wrong one is invisible to a reader.

6🧩 Example 6, Where the Textbook Shortcut Breaks

Setup: Three values: 100000001, 100000002, 100000003. The true standard deviation is exactly 1.

2Correct sum of squares0Shortcut formula result1Correct SD0Shortcut SDThe computational formula on large valuesthe shortcut returns zero
Figure 6. The quantities compared directly, drawn to scale.
Values100000001, 100000002, 100000003
Mean100000002
True sum of squared deviations2
Σx²30000001200000014
(Σx)² / n30000001200000012
Shortcut result0 (should be 2)
Shortcut SD0 (should be 1)
Whyboth terms are about 3 × 1016, so their difference falls below double precision
What this tool usesWelford's method, which never forms those large terms

Reading it: This is the most important example on the page and no other standard deviation calculator will show it to you. The formula Σx² − (Σx)²/n is algebraically identical to the definition and is taught in most textbooks because it needs only one pass through the data. On a computer it is unsafe: here both terms are around 30 quadrillion, and their true difference of 2 is smaller than the rounding error in either one, so the answer comes out as exactly zero. Three visibly different numbers get a standard deviation of zero. This calculator runs both methods and warns you whenever they disagree.

7📊 Example 7, How Uncertain Is a Standard Deviation?

Setup: The same twelve exam marks, with s = 5.6702. How precisely do we actually know the spread?

2.274n = 50.989n = 120.548n = 300.284n = 1000.125n = 500Width of the 95% interval for the SD, as a multiple of sit narrows very slowly
Figure 7. The quantities compared directly, drawn to scale.
Sample SD5.6702
n12
Degrees of freedom11
χ² at 0.0253.8157
χ² at 0.97521.9200
95% CI lower4.0168
95% CI upper9.6274
Upper / lower2.40 times
n needed for a ±10% intervalabout 200

Reading it: The standard deviation is itself an estimate, and from twelve observations it is a very rough one. The 95% confidence interval runs from 4.02 to 9.63, with the upper limit 2.4 times the lower. Notice the interval is not symmetric around 5.67, because the chi-square distribution behind it is skewed. The practical consequence is that comparing two standard deviations from small samples almost never establishes anything, and the bar chart shows how slowly the interval narrows: you need roughly 200 observations before it sits within about 10% either side.

8🔄 Example 8, Same Mean, Very Different Data

Setup: Group A: 48, 50, 52, 54, 53, 51, 49, 55
Group B: 30, 70, 45, 58, 62, 38, 66, 42

mean51.38-1 SD36.83+1 SD65.92-2 SD22.28+2 SD80.47SD = 14.55Group B: mean 51.375, SD 14.79Group A has the same mean but SD 2.45
Figure 8. Every observation plotted, with the one and two standard deviation bands shaded behind them.
Group A mean51.5000
Group B mean51.3750
Group A SD2.4495
Group B SD14.5498
Ratio5.94 times more variable
Group A CV4.76%
Group B CV28.32%
Group A range7
Group B range40

Reading it: Both groups average almost exactly 51, and a report quoting only the mean would call them identical. Group A is tightly clustered with an SD of 2.45; Group B is scattered from 30 to 70 with an SD of 14.55, six times larger. If these were delivery times, treatment responses or machine outputs, that difference would matter far more than the average does. This is the whole case for reporting a measure of spread alongside every mean, and for plotting your data rather than trusting any pair of summary numbers.

📋 13. Data Collection Protocol

A standard deviation is only as meaningful as the measurements behind it. Most of what makes it trustworthy is decided long before you open a calculator.

  1. Decide first whether you have a sample or a population. Write the answer into your protocol. It determines the divisor, and it is far harder to argue about honestly after you have seen the number.
  2. Use one measurement protocol throughout. Same instrument, same units, same conditions, same operator instructions. Mixing two methods inflates the standard deviation with measurement noise that has nothing to do with the thing you are studying.
  3. Calibrate and check drift. An instrument that slowly wanders adds variability that looks exactly like real spread. Record calibration checks alongside the data.
  4. Record raw values at full resolution. Rounding before computing changes the standard deviation, and coarse rounding can turn genuine variation into apparent ties. Round at the reporting stage only.
  5. Never record missing data as zero. A zero is a measurement; a blank is not. Zeros pull the mean down and inflate the SD, and nothing in the output will tell you it happened.
  6. Watch for values at a measurement limit. Readings recorded as "below detection" or capped at an instrument maximum compress the tails and understate the true spread.
  7. Keep the observations independent. Repeated measurements of the same subject, or several plants from the same pot, are not independent observations. Treating them as such understates the real variability between subjects.
  8. Log every exclusion when it happens, with a reason. If you removed an outlier, say which one, how many, and by what rule. Reviewers compare your stated n against your tables.
  9. Plot the data before summarising it. Thirty seconds with a dot plot or histogram will reveal skew, bimodality or a stray value that the mean and SD together will hide completely.
  10. Collect enough observations to pin the SD down. Section 11.2 shows the confidence interval by sample size. If comparing dispersion between groups is one of your aims, you need considerably more data than you would for comparing means.
  11. Store the mean, SD and n together. A standard deviation without its sample size cannot be judged, and without its mean it cannot be interpreted relative to scale.
  12. State the divisor in your write-up. One sentence saying you used n − 1 removes an entire class of ambiguity for anyone trying to reproduce your work.
The failure that quietly ruins the most standard deviations. Pooling measurements taken under different conditions and reporting a single SD. If half your readings came from a warm morning and half from a cold afternoon, the SD you compute is dominated by that difference rather than by the variability you meant to measure. Record the conditions, then check whether the spread within each condition is smaller than the spread overall.

🎯 14. When to Use Standard Deviation, and When Not To

Use the standard deviation when

  • Your data are roughly symmetric and you want a single number for the spread in the original units.
  • You are reporting a mean. A mean without a measure of spread is close to useless, and the SD is the conventional partner.
  • You are feeding a parametric procedure. t-tests, ANOVA, regression, confidence intervals and effect sizes are all built on it.
  • You are doing quality control. Control limits are almost always expressed in standard deviations from a target.
  • You need to standardise. Z-scores, and every machine learning method that scales features, divide by the standard deviation.
  • Large deviations should count for more than small ones. Squaring is a feature here, not a bug.

Do not rely on it when

  • The data are strongly skewed. The mean minus two SDs can fall outside the possible range, which is a sign the summary does not fit. Report the median and interquartile range instead.
  • Outliers are present and you cannot remove them. One extreme value can dominate, as Example 3 shows. Use the MAD-based estimate or the IQR.
  • The data are ordinal. Likert responses, rankings and grades have no meaningful arithmetic mean, so they have no meaningful standard deviation either.
  • The distribution is bimodal. When the data form two clusters, the mean sits in the empty gap between them and the SD describes a spread nothing actually has.
  • You want to describe the precision of a mean. That is the standard error, and confusing the two is the most common reporting error in applied statistics.
  • The sample is tiny. Below about n = 5 the SD is so imprecise that quoting it to two decimals implies a confidence you do not have.
  • You are comparing spread across different units or scales. Use the coefficient of variation, which is unitless.

What to use instead

SituationBetter choiceWhy
Skewed dataInterquartile range with the medianNeither is distorted by a long tail
Outliers present1.4826 × MADThe median cannot be moved by an extreme value
Ordinal dataFrequencies, mode, or the range of ranksArithmetic on ordinal codes is not meaningful
Comparing different scalesCoefficient of variationUnitless, so comparison is possible
Precision of an estimateStandard error or a confidence intervalAnswers a different question entirely
Bimodal dataReport the two groups separatelyA single summary describes neither
Counts or ratesPoisson or negative binomial dispersionVariance is tied to the mean for count data
Very small samplesReport the raw values and the rangeHonest, and the reader can see everything
Proportions√[p(1−p)/n], the standard error of a proportionThe SD of a binary variable is determined by p

🔧 15. Troubleshooting

SymptomCauseFix
Your answer differs from a colleague's in the second decimalOne of you used n and the other n − 1Agree on sample or population, and say which in the write-up
NumPy and R give different answersnp.std() defaults to N, sd() uses n − 1Write ddof=1 in NumPy
NumPy and pandas give different answersThey have opposite defaults in the same languageSet ddof explicitly in both
The standard deviation is zeroEvery value is identicalArithmetically correct. Check the data were not rounded or copied
The SD is larger than the meanHighly variable positive data, or negative values presentLegitimate. But check the data are on a ratio scale before quoting a CV
The SD is enormous compared with the dataOne value in the wrong unit, or a typo adding a digitSort the data and look at the extremes
Excel returns #DIV/0!Fewer than two numeric values in the rangeSTDEV.S needs at least two
Your manual calculation gives a negative varianceThe Σx² shortcut has lost precisionUse the definition, or DEVSQ, or this calculator
The SD does not match the softwareBlank cells, text, or missing values handled differentlyCheck how each tool treats non-numeric entries
Error bars look too small in a chartThey are standard errors, not standard deviationsExcel's default is the SE. Label them either way
Grouped result differs from the raw-data resultGrouping is an approximationExpected. Use raw data when available
R's mad() gives a much larger number than expectedIt already multiplies by 1.4826Use mad(x, constant = 1) for the raw MAD
Pooled SD does not match the SD of the merged dataThey are different quantitiesCorrect behaviour. See Example 5
The SD changed a lot after adding one observationSmall sample, or the new value is extremeCheck the per-value contribution table
Two groups look equally variable but the SDs differSmall samples give imprecise SDsSee the confidence interval in section 11.2 before claiming a difference
The empirical rule does not hold on your dataThe data are not bell-shapedReport the median and IQR alongside

16. Assumptions and Limitations

What the standard deviation assumes

The arithmetic itself assumes almost nothing. It will happily produce a number for any set of values. The assumptions are about whether that number means what you want it to mean.

AssumptionNeeded forWhat happens if it failsHow to check
Interval or ratio scaleThe number to mean anythingAn SD of Likert codes is arithmetic on labelsInspect what the numbers represent
Correct divisor for your questionAn unbiased estimateSystematic under- or over-statement, largest at small nAre these values the whole group?
Independent observationsGeneralising beyond the dataUnderstates true between-subject variabilityA property of the design
Roughly symmetric distributionThe empirical rule and mean ± SD intervalsIntervals can extend outside the possible rangeHistogram, or compare mean with median
No dominant outlierDescribing the bulk of the dataThe SD describes one point rather than the datasetCompare against 1.4826 × MAD
Unimodal distributionAny single summary to be meaningfulMean sits in an empty gap, SD describes nothing realPlot the data
Approximate normalityThe confidence interval for the SD onlyThe chi-square interval becomes unreliableQ-Q plot, or treat the interval as indicative
Common variance across groupsThe pooled SD onlyPooling produces a number describing no real groupVariance ratio between groups

Limitations worth stating in a write-up

  • It says nothing about shape. Two datasets can share a mean and an SD and look entirely different, as Example 8 demonstrates in a milder form. Always plot as well as summarise.
  • It is not robust. One extreme value can multiply it several times over, and the SD gives you no warning that this has happened. Only comparing against a robust measure reveals it.
  • It is itself an estimate with wide uncertainty. From twelve observations the 95% interval spans a factor of 2.4. Claims that one small group is more variable than another are usually unsupportable.
  • The n − 1 correction gives an unbiased variance, not an unbiased SD. Because the square root is non-linear, s remains very slightly biased low. The effect is tiny and almost nobody corrects for it, but the precise claim matters.
  • The empirical rule requires bell-shaped data. On skewed data the 68 and 95 percent landmarks can be substantially wrong.
  • Grouped calculations are approximations. Class midpoints discard within-class variation, and open-ended classes force you to invent a value.
  • The coefficient of variation needs a ratio scale. It is meaningless for temperatures in Celsius, for anything that can be negative, and for scales with an arbitrary zero.
  • The old computational formula is numerically unsafe. On large values it can return zero or even a negative variance. This is a property of floating-point arithmetic, not of your data.
  • An SD without n cannot be judged. The same figure means very different things from 5 observations and from 500.

🏁 17. Conclusion

The standard deviation is the average distance of your values from their mean, expressed in the same units as your data. You subtract the mean from each value, square the results so they cannot cancel, average those squares, and take the square root to get back to your original units. Everything else on this page follows from those four steps.

The one decision that trips people up is the divisor. Divide by n − 1 when your data are a sample from something larger, which is nearly always, and by N only when the values you have are the entire group you want to describe. The correction exists because the sample mean sits closer to your own data than the true population mean does, so the sum of squared deviations comes out too small every time. The gap between the two versions is 12% at n = 5, 1.7% at n = 30 and 0.5% at n = 100, which tells you where to spend your attention. This calculator shows both side by side so the choice is deliberate rather than accidental.

Three distinctions are worth keeping straight. Standard deviation is not standard error: the first describes how spread out your data are and does not shrink as you collect more, while the second describes how precisely you know the mean and does. Reporting one when you meant the other is the most common error in published figures, and it is why every error bar needs a label. Pooled is not combined: the pooled SD estimates within-group spread and feeds a t-test, while the combined SD describes all your groups merged into one pile and is larger by exactly the amount the group means differ. Variance is not standard deviation: they carry identical information, but variance lives in squared units, which is why it drives the mathematics and the SD gets reported.

Two failure modes deserve real caution. Because deviations are squared, a single extreme value can dominate the result completely. In Example 3 one reading of 180 among heart rates in the 120s accounts for 90% of the entire sum of squares and multiplies the SD from 2.95 to 15.12. The classical figure gives you no hint that this has happened; only comparing it against a robust measure such as 1.4826 times the median absolute deviation reveals it, which is why this calculator reports both and flags the ratio. And the textbook shortcut formula, Σx² − (Σx)²/n, is algebraically correct but numerically unsafe: on the three values 100000001, 100000002 and 100000003 it returns a variance of zero when the true answer is one. This tool uses Welford's method and warns you whenever the two disagree.

Finally, remember that the standard deviation is an estimate with substantial uncertainty of its own. From twelve observations, an SD of 5.67 has a 95% confidence interval running from 4.02 to 9.63, an upper bound nearly two and a half times the lower one. It narrows slowly, needing around 200 observations to sit within about 10% either side. That is worth knowing before you claim one group is more variable than another.

Report the standard deviation with its mean and its sample size, say which divisor you used, label your error bars, check it against a robust measure when outliers are plausible, and plot the data as well as summarising it. Done that way it remains the single most useful description of spread in statistics.

18. Frequently Asked Questions

What is standard deviation in simple terms?
It is the typical distance of your values from their average, in the same units as your data. If exam marks average 53 with a standard deviation of 5.7, most marks sit within about 6 points of 53. A small standard deviation means the values cluster tightly; a large one means they are spread out.
How do you calculate standard deviation?
Find the mean. Subtract it from each value and square the result. Add all those squares to get the sum of squares. Divide by n − 1 for a sample or by N for a population to get the variance. Take the square root. The squaring exists because raw deviations above and below the mean cancel to exactly zero, and the square root brings you back to the original units.
Should I divide by n or n minus 1?
Use n − 1 when your data are a sample from a larger group, which covers almost every real analysis. Use N only when the values you have are the entire group you want to describe. When in doubt use n − 1: it is the safer, slightly larger estimate and it is what every downstream statistical procedure expects.
Why do we divide by n minus 1?
Because you used the sample mean rather than the true population mean to measure deviations from, and the sample mean is calculated from those very numbers, so it sits closer to them than the true mean would. The sum of squared deviations therefore comes out too small every time. Dividing by n − 1 corrects that bias exactly. It is one rather than some other number because computing the mean uses up one degree of freedom.
What is the difference between standard deviation and variance?
The variance is the standard deviation squared. They carry identical information, but the variance is in squared units, so if your data are in centimetres the variance is in square centimetres. That is why the standard deviation is what gets reported. Variance survives in the mathematics because variances of independent quantities add together and standard deviations do not.
What is the difference between standard deviation and standard error?
The standard deviation describes how spread out your individual data points are, and collecting more data does not shrink it. The standard error describes how precisely you know the mean, equals the SD divided by the square root of n, and does shrink as you collect more data. Reporting one when you meant the other is the most common error in published figures, which is why every error bar needs a caption saying which it is.
What is a good or normal standard deviation?
There is no universal answer, because it depends entirely on your units and scale. A standard deviation of 5 is tiny for annual incomes and enormous for the length of a machined component. To judge it, compare it against the mean using the coefficient of variation: under 10% is tight, 10 to 30% is moderate, and above about 60% usually means the data are skewed enough that the mean and SD together mislead.
Can standard deviation be zero or negative?
Zero yes, negative never. A standard deviation of zero means every value is identical, which is arithmetically correct but usually a sign the data were rounded, copied or recorded at the wrong resolution. It can never be negative because it is the square root of a sum of squares. If a manual calculation gives you a negative variance, the shortcut formula has lost numerical precision.
How does an outlier affect the standard deviation?
Dramatically, because deviations are squared. In Example 3 on this page a single heart rate of 180 among readings in the 120s accounts for 90% of the entire sum of squares and lifts the SD from 2.95 to 15.12. The classical formula gives you no warning. Compare it against a robust measure such as 1.4826 times the median absolute deviation, and if the ratio exceeds about 1.6 you have an outlier driving the result.
What is the 68-95-99.7 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. The exact figures are 68.27%, 95.45% and 99.73%. It does not hold for skewed or bimodal data. Chebyshev's inequality gives a weaker but universal guarantee: at least 75% within two SDs and 89% within three, for any distribution whatsoever.
Why do R and Python give me different standard deviations?
Because np.std() defaults to dividing by N while R's sd() always divides by n − 1. Write ddof=1 in NumPy to match R. Confusingly, pandas goes the other way: df.std() defaults to n − 1, so NumPy and pandas disagree with each other within the same language and neither raises a warning.
How do I calculate standard deviation in Excel?
Use =STDEV.S(range) for a sample and =STDEV.P(range) for a population. The P stands for population, not precise, and choosing it by mistake is common. For the sum of squared deviations use =DEVSQ(range), and for the standard error divide STDEV.S by SQRT(COUNT(range)).
How do I find the standard deviation from grouped data?
Use each class midpoint as its value and weight by frequency: the mean is Σfx divided by Σf, and the SD is the square root of Σf(x − mean)² divided by Σf − 1. Remember it is an approximation, because every observation in a class is treated as sitting exactly at the midpoint. Open-ended classes such as "60 and over" are the worst case, since you have to invent a midpoint.
What is a pooled standard deviation and how is it different from combining the data?
The pooled SD estimates the spread within a typical group, assuming all groups share one underlying variability, and it is what a t-test and Cohen's d use. The combined SD is what you would get by merging every group into one dataset, and it is larger because it also picks up the differences between group means. In Example 5 the pooled figure is 5.15 and the combined is 10.06 for the same data. Quoting the wrong one is invisible to a reader.
How accurate is a standard deviation from a small sample?
Much less accurate than people expect. From twelve observations, a standard deviation of 5.67 has a 95% confidence interval running from 4.02 to 9.63, an upper bound 2.4 times the lower. The interval narrows slowly and you need roughly 200 observations before it sits within about 10% either side. This is why claims that one small group is more variable than another are rarely supportable.
Why does my textbook formula give a different answer on large numbers?
Because the shortcut Σx² − (Σx)²/n is algebraically identical to the definition but numerically unstable. On the values 100000001, 100000002 and 100000003 both terms are around 3 × 1016 while their true difference is 2, so nearly all the significant digits cancel and the answer comes out as exactly zero. This calculator uses Welford's method, which never forms those large intermediate values, and warns you when the two approaches disagree.
Can I calculate a standard deviation from Likert scale data?
Arithmetically yes, meaningfully no. Likert responses are ordinal: you know that "strongly agree" ranks above "agree" but not that the gap is the same size as between "agree" and "neutral". Taking a mean and a standard deviation treats those codes as real numbers on an equal-interval scale. Report frequencies, the median, or the proportion agreeing instead. Many researchers do compute means on multi-item Likert scales, which is more defensible, but a single item is not.
What does it mean if the standard deviation is bigger than the mean?
For data that can only be positive it means the distribution is highly variable and almost certainly right-skewed, since the mean minus one SD would fall below zero. That is common for incomes, waiting times and species counts. It is not an error, but it does mean the mean and SD together are a poor summary, and you should report the median and interquartile range as well.
How many decimal places should I report?
One more than your raw data, and rarely more than two or three. Reporting an SD of 5.67023 from twelve observations implies a precision you do not have, given that its confidence interval runs from 4.02 to 9.63. Always report the sample size alongside, because the same figure means very different things from 5 observations and from 500.
Does a larger sample size reduce the standard deviation?
No, and this is a common misconception. The standard deviation describes how spread out the population is, so collecting more data gives you a more precise estimate of it but does not make it smaller. If heights vary by 8 cm, they vary by 8 cm whether you measure 30 people or 3,000. The quantity that shrinks with sample size is the standard error, which describes the precision of the mean rather than the spread of the data.

🔖 19. Cite This Tool

APA 7th
StatsUnlock. (2026). Standard Deviation Calculator [Online tool]. https://statsunlock.com/standard-deviation-calculator/
MLA 9th
"Standard Deviation Calculator." StatsUnlock, 2026, statsunlock.com/standard-deviation-calculator/.
Chicago
StatsUnlock. "Standard Deviation Calculator." Accessed 2026. https://statsunlock.com/standard-deviation-calculator/.
BibTeX
@misc{statsunlock_sd, title={Standard Deviation Calculator}, author={{StatsUnlock}}, year={2026}, url={https://statsunlock.com/standard-deviation-calculator/}}

🔗 20. Related Calculators

📖 21. Glossary

TermMeaning
Standard deviationThe typical distance of values from their mean, in the original units.
VarianceThe standard deviation squared. Same information, squared units.
sThe sample standard deviation, computed with n − 1.
σ (sigma)The population standard deviation, computed with N.
Bessel's correctionDividing by n − 1 instead of n, which removes downward bias in the variance.
Degrees of freedomThe number of values free to vary. One is used up estimating the mean.
ddofThe delta degrees of freedom argument in NumPy. ddof=1 gives the sample version.
Sum of squaresΣ(x − mean)², the numerator of the variance.
Standard errorSD divided by the square root of n. The precision of the mean, not the spread of the data.
Coefficient of variationSD divided by the mean. Unitless, valid only on a ratio scale.
MADMedian absolute deviation, the median of the distances from the median.
Robust SD1.4826 × MAD, scaled to match s for normal data but immune to outliers.
RangeMaximum minus minimum. Very sensitive to extremes.
Interquartile rangeQ3 minus Q1, the spread of the middle half. Robust.
Pooled SDA weighted combination of group SDs, estimating a shared within-group spread.
Combined SDThe SD of all groups merged into one dataset. Includes between-group variation.
Empirical ruleThe 68-95-99.7 approximation, valid only for bell-shaped data.
Chebyshev's inequalityA weaker guarantee that holds for any distribution: at least 75% within two SDs.
SkewnessAsymmetry. High skew makes the mean and SD a poor summary.
KurtosisTail heaviness relative to a normal distribution.
Grouped dataA frequency table. Standard deviations from it are approximations.
Class midpointThe centre of a class interval, used as the value for every observation in it.
Welford's methodA numerically stable one-pass algorithm for the mean and sum of squares.
Catastrophic cancellationLoss of precision when subtracting two nearly equal large numbers.
Computational formulaΣx² − (Σx)²/n. Algebraically correct, numerically unsafe.
OutlierA value far from the rest. Squaring gives it outsized influence on the SD.
VolatilityThe standard deviation of returns, in finance.
Z-scoreA value expressed as a number of standard deviations from the mean.

📚 22. References

  1. Pearson, K. (1894). Contributions to the mathematical theory of evolution. Philosophical Transactions of the Royal Society A, 185, 71-110. doi.org/10.1098/rsta.1894.0003
  2. Welford, B. P. (1962). Note on a method for calculating corrected sums of squares and products. Technometrics, 4(3), 419-420. doi.org/10.1080/00401706.1962.10490022
  3. Chan, T. F., Golub, G. H., & LeVeque, R. J. (1983). Algorithms for computing the sample variance: Analysis and recommendations. The American Statistician, 37(3), 242-247. doi.org/10.1080/00031305.1983.10483115
  4. Higham, N. J. (2002). Accuracy and Stability of Numerical Algorithms (2nd ed.). SIAM. doi.org/10.1137/1.9780898718027
  5. Rousseeuw, P. J., & Croux, C. (1993). Alternatives to the median absolute deviation. Journal of the American Statistical Association, 88(424), 1273-1283. doi.org/10.1080/01621459.1993.10476408
  6. Leys, C., Ley, C., Klein, O., Bernard, P., & Licata, L. (2013). Detecting outliers: Do not use standard deviation around the mean, use absolute deviation around the median. Journal of Experimental Social Psychology, 49(4), 764-766. doi.org/10.1016/j.jesp.2013.03.013
  7. Cumming, G., Fidler, F., & Vaux, D. L. (2007). Error bars in experimental biology. Journal of Cell Biology, 177(1), 7-11. doi.org/10.1083/jcb.200611141
  8. Altman, D. G., & Bland, J. M. (2005). Standard deviations and standard errors. BMJ, 331(7521), 903. doi.org/10.1136/bmj.331.7521.903
  9. Nagele, P. (2003). Misuse of standard error of the mean (SEM) when reporting variability of a sample. British Journal of Anaesthesia, 90(4), 514-516. doi.org/10.1093/bja/aeg087
  10. Barde, M. P., & Barde, P. J. (2012). What to use to express the variability of data: Standard deviation or standard error of mean? Perspectives in Clinical Research, 3(3), 113-116. doi.org/10.4103/2229-3485.100662
  11. Moore, D. S., McCabe, G. P., & Craig, B. A. (2021). Introduction to the Practice of Statistics (10th ed.). W. H. Freeman. macmillanlearning.com
  12. Tukey, J. W. (1977). Exploratory Data Analysis. Addison-Wesley. archive.org
  13. Huber, P. J., & Ronchetti, E. M. (2009). Robust Statistics (2nd ed.). Wiley. doi.org/10.1002/9780470434697
  14. Wilkinson, L., & the Task Force on Statistical Inference (1999). Statistical methods in psychology journals: Guidelines and explanations. American Psychologist, 54(8), 594-604. doi.org/10.1037/0003-066X.54.8.594
  15. American Psychological Association (2020). Publication Manual of the American Psychological Association (7th ed.). apastyle.apa.org
  16. Jamieson, S. (2004). Likert scales: How to (ab)use them. Medical Education, 38(12), 1217-1218. doi.org/10.1111/j.1365-2929.2004.02012.x
  17. Bland, J. M., & Altman, D. G. (1996). Statistics notes: Measurement error. BMJ, 312(7047), 1654. doi.org/10.1136/bmj.312.7047.1654
  18. Press, W. H., Teukolsky, S. A., Vetterling, W. T., & Flannery, B. P. (2007). Numerical Recipes: The Art of Scientific Computing (3rd ed.). Cambridge University Press. numerical.recipes
  19. Harris, C. R., et al. (2020). Array programming with NumPy. Nature, 585, 357-362. doi.org/10.1038/s41586-020-2649-2
  20. R Core Team (2024). R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing. r-project.org
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Important Plots & Charts

Most Popular