HomeDescriptive StatisticsStandard Deviation Calculator with Steps | StatsUnlock

Standard Deviation Calculator with Steps | StatsUnlock

Standard Deviation Calculator

Paste comma-separated numbers or upload a CSV and get the sample and population standard deviation, variance, mean, standard error, coefficient of variation and a confidence interval for the SD, with step-by-step working, four colourful charts and copy-ready sentences for your report.

DescriptiveSample & Population SDVarianceWith StepsMulti-GroupFree

⚡ 0. Quick Answer

A standard deviation calculator finds how far values typically sit from their mean: subtract the mean from each value, square the gaps, add them, divide by n − 1 for a sample (or n for a population), then take the square root.

For the 16 values 52, 48, 55, 61, 47, 50, 58, 53, 49, 56, 51, 54, 46, 57, 50, 52 the mean is 52.4375, the sum of squares is 263.9375, the sample variance is 17.5958 and the sample standard deviation is 4.1947. The population standard deviation is 4.0615. A bigger SD means more spread. The SD is never negative, and it is zero only when every value is the same.

s = √[ Σ(x − x̄)² ÷ (n − 1) ]  ·  σ = √[ Σ(x − μ)² ÷ N ]

Rule of thumb: use the sample SD (n − 1, Excel STDEV.S) unless you measured every member of the group. For bell-shaped data about 68% of values lie within 1 SD of the mean, 95% within 2 SD and 99.7% within 3 SD. A coefficient of variation under 10% is low spread, 10% to 30% is moderate, and above 30% is high.

Key takeaways

  • This standard deviation calculator returns the sample SD (s), the population SD (σ), variance, mean, SE and CV for any number of groups at once.
  • For the worked example (n = 16) the sample SD is 4.1947 and the population SD is 4.0615, because one divides by 15 and the other by 16.
  • The 95% confidence interval for the true SD is 3.10 to 6.49, which shows that an SD from a small sample is far less precise than most people expect.
  • SD describes the spread of the data, while SE = s ÷ √n = 1.0487 describes how precisely the mean is known, so the two are never interchangeable.
  • One wrong value can multiply the SD: a single typing error in Example 3 below raises it from 0.029 to 0.402, almost 14 times larger.

📚 1. What Is the Standard Deviation?

The standard deviation (SD) is the typical distance between each value and the mean of the data. It is measured in the same units as the data, so an SD of 4.19 mm means leaf lengths usually sit about 4 mm above or below their average. The variance is the same idea before the square root, so it is measured in squared units (mm²), which is harder to read.

What it actually measures: spread, also called dispersion or variability. Two groups can share the same mean of 52.5 and still be very different. In the sample dataset on this page, Site A has an SD of 4.19 mm while Site B has an SD of 8.05 mm, almost double, even though their means differ by only 0.13 mm. The mean tells you where the data sit. The SD tells you how tightly they sit there.

A worked one-liner: for 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5, the squared deviations add to 32, so the population SD is √(32 ÷ 8) = 2 and the sample SD is √(32 ÷ 7) = 2.1381.

same mean = 52.5 ±1 SD = 4.2 ±1 SD = 8.0 Site A: low SD, values packed near the mean Site B: high SD, values spread wide
Same mean, different standard deviation. The narrow green curve (SD 4.19) and the wide blue curve (SD 8.05) describe the two slopes in sample dataset 1.

Who uses it: laboratories use the SD and the relative standard deviation to judge measurement precision. Teachers and psychologists use it to turn scores into z-scores. Manufacturers use it to set control limits at ±3 SD. Ecologists use it to compare how variable body size or yield is between sites. Finance uses it as a measure of risk, called volatility. Clinical trials report every baseline variable as mean ± SD.

Measure of spreadWhat it findsBest used when
Standard deviationTypical distance from the mean, in data unitsData are roughly symmetric, for mean ± SD reporting
VarianceAverage squared distance from the meanInside formulas: ANOVA, pooling, regression
Interquartile range (IQR)Width of the middle 50% of the dataData are skewed or contain outliers
Median absolute deviationTypical distance from the medianYou need a robust SD that outliers cannot move
Coefficient of variationSD as a percentage of the meanComparing spread across different units or scales
Standard errorPrecision of the mean, s ÷ √nConfidence intervals and error bars for means

🧮 2. Set Up Your Data

Type or paste numbers separated by commas, for example 52, 48, 55, 61, 47, .... Spaces, tabs, semicolons and new lines also work, so a column copied from Excel pastes straight in. Each box is one group. Click the group name to rename it.

Accepts .csv, .txt, .xlsx and .xls. The first row is used as column names when it contains text. Only numeric columns are offered.

Type one value per cell. Each column is one group, and the header cell is its editable name. Empty cells are ignored.

No raw data? These three tools work from numbers printed in a paper or a frequency table. Each one computes only when you press its button.

A. Standard deviation from summary statistics

You haveEnter
Standard error and n
95% CI of the mean and n
Interquartile range
Range (max − min)
Variance
Standard deviation (to get variance)
Population SD and n (to get sample SD)

B. Pooled and combined standard deviation from n, mean and SD

GroupnMeanSD

C. Standard deviation of grouped data (frequency table)

Lower limitUpper limitFrequency

Both are always shown in the table. This only sets the big headline number.

📊 3. Results

Enter or load your data above, then press Calculate Standard Deviation. The sample and population SD, variance, standard error, coefficient of variation, a confidence interval for the SD, outlier checks, four charts and auto-filled reporting sentences will appear here.

🧠 4. Interpretation of Results, In Detail

Run the calculator to fill this box with your own numbers: SD = ___, mean = ___, CV = ___, CI for σ = ___ to ___. The twelve sub-sections below explain every part of the output.

4.1 What the standard deviation tells you

The standard deviation is the typical distance between a value and the mean. If exam scores have a mean of 66 and an SD of 5, a typical student scored about 5 points above or below 66. The SD is in the same units as your data, which is why it is the measure people quote. Its square, the variance, is in squared units and is mostly used inside other formulas.

A useful mental picture: the SD is roughly the radius of the cloud of data around its centre. A small SD means a tight cloud. A large SD means a loose one. It is not the average distance exactly (that is the mean absolute deviation, which is always a little smaller), because squaring gives extra weight to values far from the mean.

4.2 Is my standard deviation high or low?

There is no universal "good" standard deviation, because the SD depends on the units and the scale. An SD of 5 is tiny for incomes in dollars and enormous for blood potassium in mmol/L. Three questions settle it:

  • Compared with the mean? Use the coefficient of variation. Under 10% is low spread, 10% to 30% moderate, above 30% high. Laboratory assays usually aim for a CV under 5%.
  • Compared with the range of the scale? On a 1 to 5 Likert item the largest possible SD is about 2. An SD of 1.1 is moderate disagreement; above 1.5 means opinions are split.
  • Compared with published values? Reference SDs exist for most clinical and educational measures. An SD far above the literature often points to a mixed sample or a data entry problem.

4.3 Sample SD (n − 1) versus population SD (n)

Dividing by n − 1 instead of n is called Bessel’s correction. When you work from a sample, the deviations are measured from the sample mean, which sits closer to the data than the true population mean does. That makes the sum of squares slightly too small. Dividing by n − 1 (the degrees of freedom) corrects the variance so it is unbiased on average.

For the worked example the two answers are 4.1947 and 4.0615, a difference of about 3%. With n = 100 the gap falls to 0.5%, and with n = 5 it is 12%. Use the population SD only when your data contain every member of the group you want to describe, such as all 30 students in one class when you have no wish to generalise beyond them.

4.4 The 68-95-99.7 rule and when it fails

For data that follow a normal (bell-shaped) distribution, about 68% of values lie within 1 SD of the mean, 95% within 2 SD (1.96 SD exactly) and 99.7% within 3 SD. The calculator counts how many of your values actually fall in each band. In the worked example the counts are 62.5%, 93.75% and 100%, close to the rule for only 16 values.

When the counts are far from the rule, the data are not bell shaped and you should not use the rule to make statements like "95% of patients lie between". Chebyshev’s inequality is the safe fallback: for any distribution at all, at least 75% of values lie within 2 SD and at least 88.9% within 3 SD.

4.5 How outliers inflate the standard deviation

Because every deviation is squared, one value far from the mean can dominate the SD. Chart 4 shows each value’s squared deviation. In the worked example the value 61 alone supplies 73.3 of the 263.9 total, or 27.8% of the sum of squares, even though it is just one value out of 16. In Example 3 below a single typing error makes the SD almost 14 times bigger.

Compare the ordinary SD with the robust SD (1.4826 × the median absolute deviation). If the ordinary SD is more than about 1.5 times the robust one, a few extreme values are driving it. Do not delete them blindly. Check the raw records, fix genuine errors, and report the robust measure alongside if real extremes remain.

4.6 The confidence interval for the standard deviation

Your SD is an estimate of the population SD, and like any estimate it has uncertainty. The calculator uses the chi-square distribution to build an interval: √[(n − 1)s² ÷ χ²upper] to √[(n − 1)s² ÷ χ²lower]. The interval is not symmetric around s, because the SD can never go below zero.

The width surprises most people. With n = 16 the 95% interval for the worked example runs from 3.10 to 6.49, so the true SD could plausibly be 25% lower or 55% higher than the estimate. With n = 6 the upper limit is nearly four times the lower one. This interval relies heavily on normality, much more than the interval for a mean, so treat it with care when the data are skewed.

4.7 Standard deviation versus standard error

This is the most common mix-up in published research. The SD describes how variable the individual values are. It does not shrink as you collect more data, it just becomes a better estimate. The standard error of the mean, SE = s ÷ √n, describes how precisely the mean has been estimated, and it does shrink as n grows.

Use mean ± SD to describe your sample, for example in Table 1 of a paper. Use SE, or better a confidence interval, when you want to show how well the mean is pinned down. Error bars of ±SE look about √n times shorter than ±SD bars, which is why some authors prefer them and why readers must always be told which one is shown. Chart 2 draws both so you can see the difference.

4.8 Comparing spread across groups

When you enter two or more groups, the calculator reports the pooled SD, the combined SD and the Brown-Forsythe test. The pooled SD averages the within-group variances weighted by their degrees of freedom. It is the SD used in Cohen’s d and in the classic Student t-test. The combined SD treats all values as one sample, so it also includes the differences between group means and is usually larger.

The Brown-Forsythe test asks whether the groups differ in spread. It runs an ANOVA on the distances from each group’s median, which makes it robust to non-normal data. A p-value below 0.05 means the spreads differ: report each SD separately and prefer Welch-type tests when you compare means. A ratio of largest to smallest SD above 2 is a common warning sign even when the test is not significant.

4.9 Coefficient of variation and relative standard deviation

The coefficient of variation (CV), also called the relative standard deviation (RSD), is the SD divided by the mean, times 100. It lets you compare spread between groups on different scales, such as the variability of body mass in mice and in elephants. A CV of 8% means the typical deviation is 8% of the mean.

The CV is only meaningful on a ratio scale with a true zero and a positive mean. Do not compute it for temperatures in Celsius, for z-scores, or for differences that can be negative. When the mean is near zero, the CV explodes and becomes useless.

4.10 Can the standard deviation be negative, or bigger than the mean?

The SD can never be negative, because it is a square root of a sum of squares. It is zero only when every value is identical. If software shows a negative SD, a formula has been typed wrongly.

The SD can be bigger than the mean. That is common and correct for data that are bounded at zero and skewed to the right, such as hospital stays, insurance claims or species counts. For such data, mean ± 2 SD gives a negative lower bound, which is impossible, so report the median and IQR as well. Example 4 below shows an SD of 10.60 with a mean of 6.16.

4.11 What the standard deviation cannot tell you

The SD says nothing about the shape of the data. A symmetric sample, a skewed sample and a sample with two separate clusters can all share an SD of 10. It also says nothing about why the data vary: measurement error, real biological differences and data entry mistakes all add to it in the same way. And on its own it is not a test. Two groups with different SDs may differ by chance, which is what the Brown-Forsythe test checks.

The SD of a biased sample is a precise answer to the wrong question. No formula fixes a sample that does not represent the population.

4.12 Practical judgement

Look at Chart 1 before you look at the number. Check that the data form one group, not two. Check the outlier flags and the robust SD. Decide between n − 1 and n before you report, and say which you used. Then report mean ± SD with n, add the median and IQR when the data are skewed, and give the confidence interval for σ when the SD itself is your result, for example in a reliability or quality control study.

✍ 5. How to Write Your Results in Research

When reporting standard deviation calculator results in APA format, give the mean, the SD and n together, say whether you used the sample or population formula, and match decimal places to your measurement. The five templates below fill in automatically after you press Calculate.

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

Example 1, APA 7th Edition
Descriptive statistics for ___ were as follows: ___ (M = ___, SD = ___, n = ___). The 95% confidence interval for the population standard deviation was [___, ___].
📌 Key conventions for this style
  • Write M and SD in italics in the final document.
  • Report SD to the same number of decimals as the mean, usually two.
  • Use a leading zero for values that can exceed 1 (SD = 0.45) but not for p-values (p = .009).
  • Never report a mean without its SD and n.
Example 2, Thesis / Dissertation
Variability in ___ was summarised using the sample standard deviation (n − 1 denominator). ___
📌 Key conventions for this style
  • State the denominator (n − 1 or n) once in the Methods chapter.
  • Say how outliers were defined before you looked at the data.
  • Justify mean ± SD over median and IQR when skew is present.
  • Name the software and version used to compute the SD.
Example 3, Plain-Language Summary
We measured ___ in ___ cases. The average was ___, and most values were within about ___ of that average.
📌 Key conventions for this style
  • Translate SD as "most values were within about X of the average".
  • Use "about two thirds of values" for the ±1 SD band only if the data look bell shaped.
  • Avoid symbols such as σ, s or ±.
  • Give units every time a number appears.
Example 4, Structured Abstract / Poster
Objective: ___. Methods: ___. Results: ___ ± ___ (mean ± SD, n = ___). Conclusion: ___.
📌 Key conventions for this style
  • Write "mean ± SD" once so readers know the format.
  • Keep decimals identical down a table column.
  • On posters, show error bars and label them SD or SE in the legend.
  • Footnote the SD version if any row uses the population formula.
Example 5, Replication / Pre-Registration
Planned analysis: the primary measure of dispersion is the sample standard deviation (denominator n − 1). Observed: n = ___, SD = ___, variance = ___, sum of squares = ___.
📌 Key conventions for this style
  • Report the sum of squares and n so others can rebuild your SD exactly.
  • Pre-specify the outlier rule and the confidence level.
  • Give four decimals for values others will reuse in a meta-analysis.
  • Share the raw data file when you can.

5.1 Methods wording

"Continuous variables are presented as mean ± standard deviation (SD), calculated with the n − 1 denominator. Variables with marked skew are additionally summarised as median and interquartile range." One sentence like this, placed once, saves every later table from repeating it.

5.2 The Results sentence

Lead with the finding, then the numbers in brackets: "Leaf length on the south slope was considerably more variable than on the north slope (SD = 8.05 mm vs 4.19 mm; Brown-Forsythe F(1, 30) = 7.79, p = .009), although the means were almost identical (52.56 vs 52.44 mm)."

5.3 Tables and figures

  • Use one column per group and rows for mean (SD), with n in the column header.
  • Do not use the ± symbol in a table cell when the caption says "mean (SD)". Pick one format.
  • Every error bar must be labelled in the caption: "Error bars show ±1 SD."
  • Show the raw data points next to bars when n is under about 30, as Chart 1 does.

5.4 The Discussion sentence

Interpret the spread, not just the centre: "The larger SD on the south slope suggests more heterogeneous growing conditions, which may matter more for management than the near-identical mean." Spread is often the real biological or practical story.

5.5 Final reporting checklist

  • Mean, SD and n given together for every group.
  • Sample (n − 1) or population (n) formula stated.
  • SD and SE never confused; error bars labelled.
  • Outlier rule stated, and any removed values disclosed.
  • Median and IQR added when skewness is above about 1, or when SD exceeds the mean for positive data.
  • Confidence interval for σ given when the SD itself is a key result.

∑ 6. Formulas Used

①
Sample Standard Deviation
s = √[ Σ(xᵢ − x̄)² ÷ (n − 1) ]
sSample standard deviation, in the units of the data
xᵢEach individual value
x̄Sample mean, Σx ÷ n
n − 1Degrees of freedom. Dividing by n − 1 is Bessel’s correction
Range0 or above. Zero only when all values are equal
Example√(263.9375 ÷ 15) = √17.5958 = 4.1947
②
Population Standard Deviation
σ = √[ Σ(xᵢ − μ)² ÷ N ]  ·  s = σ × √[ n ÷ (n − 1) ]
σPopulation standard deviation, read "sigma"
μPopulation mean
NNumber of values in the whole population
Use forOnly when every member of the group was measured
Example√(263.9375 ÷ 16) = 4.0615
③
Sum of Squares and Variance
SS = Σ(xᵢ − x̄)² = Σx² − (Σx)² ÷ n  ·  s² = SS ÷ (n − 1)
SSSum of squared deviations, squared units. Excel DEVSQ
s²Sample variance, squared units. Excel VAR.S
NoteThe shortcut Σx² − (Σx)²/n can lose precision with large numbers. This tool uses Welford’s one-pass method instead
RuleSD = √variance, and variance = SD²
④
Standard Error and Coefficient of Variation
SE = s ÷ √n  ·  CV = (s ÷ |x̄|) × 100%
SEStandard error of the mean, data units. Precision of x̄
CVRelative standard deviation, a unitless percentage
RequiresCV needs a ratio scale and a mean well above zero
ExampleSE = 4.1947 ÷ 4 = 1.0487; CV = 4.1947 ÷ 52.4375 = 8.00%
⑤
Confidence Interval for σ (Chi-Square)
√[ (n − 1)s² ÷ χ²1−α/2, n−1 ] ≤ σ ≤ √[ (n − 1)s² ÷ χ²α/2, n−1 ]
χ²Chi-square critical values with n − 1 degrees of freedom
α1 minus the confidence level, 0.05 for 95%
RequiresRoughly normal data. Skew makes this interval too narrow
Example√(263.94 ÷ 27.488) = 3.0987 to √(263.94 ÷ 6.262) = 6.4922
⑥
Pooled and Combined SD for Several Groups
sp = √[ Σ(nᵢ − 1)sᵢ² ÷ Σ(nᵢ − 1) ]  ·  sc = √{ [ Σ(nᵢ − 1)sᵢ² + Σnᵢ(x̄ᵢ − x̄)² ] ÷ (N − 1) }
spPooled SD, the within-group spread. Used in Cohen’s d
scCombined SD of all values as one sample
nᵢ, sᵢ, x̄ᵢSize, SD and mean of group i
ExampleSites A and B: sp = √[(15 × 17.596 + 15 × 64.796) ÷ 30] = 6.4184
⑦
Robust Spread and Rules of Thumb
MAD = median|xᵢ − Mdn|  ·  SD≈ 1.4826 × MAD ≈ IQR ÷ 1.349 ≈ Range ÷ 4
MADMedian absolute deviation, data units
1.4826, 1.349Constants that make each equal σ for normal data
Range ÷ 4A rough check only. Works best for n near 20 to 40
ChebyshevAt least 1 − 1/k² of any data lie within k SD of the mean

🔀 7. Standard Deviation Calculation Flowchart, Step by Step

This flowchart shows how the standard deviation is calculated, step by step, from a raw column of numbers to a checked and reportable SD. Every box uses the same worked example as the Excel, R and Python sections: 16 leaf lengths in millimetres from Site A.

Start or result Data step Calculation step Yes or no check
Start Raw measurements 16 leaf lengths in mm: 52, 48, 55, 61, 47, 50, 58, 53, 49, 56, 51, 54, 46, 57, 50, 52
CheckIs any cell blank, text or a missing-value code like −99?
YesRemove it. Never type 0 for a missing value, because a fake zero inflates the SD.
NoAll 16 values are real measurements, so keep them.
1
Count the values and add them n, Σx n = 16, Σx = 839
2
Find the mean x̄ = Σx ÷ n 839 ÷ 16 = 52.4375
3
Subtract the mean from each value x − x̄ 52 − 52.4375 = −0.4375, 61 − 52.4375 = 8.5625, … they add to 0
4
Square each gap and add them up SS = Σ(x − x̄)² 0.1914 + 19.6914 + … + 0.1914 = 263.9375
CheckDo the data cover the whole population you care about?
YesDivide by N = 16 for the population variance: 16.4961.
NoIt is a sample, so divide by n − 1 = 15. This is the usual case.
5
Divide by n minus 1 for the variance s² = SS ÷ (n − 1) 263.9375 ÷ 15 = 17.5958 mm²
6
Take the square root s = √s² √17.5958 = 4.1947 mm (population: √16.4961 = 4.0615)
CheckIs any value beyond the Tukey fences or more than 3 SD from the mean?
Yes, stopCheck that value against the raw record before you report the SD.
NoFences are 41.5 to 63.5 mm and the largest |z| is 2.04, so the SD stands.
Result SD = 4.19 mm, mean = 52.44 mm, n = 16, CV = 8.00% Low spread No outliers CV under 10% counts as low spread. Report as 52.44 ± 4.19 mm (mean ± SD).

Check any box yourself: the Excel sheet in Section 9, the R script in Section 10 and the Python script in Section 11 all return a sum of squares of 263.9375, a sample SD of 4.1947 and a population SD of 4.0615 for this dataset.

📝 8. How to Use This Standard Deviation Calculator

  1. Enter your data. Type or paste comma-separated numbers into the first box, in the format the placeholder shows: 52, 48, 55, 61, 47, .... Spaces, tabs and new lines also work.
  2. Name each group. Click the group name above each box and type something meaningful, such as North slope. The name flows into the tables, charts and report sentences.
  3. Add more groups to compare spread. Press Add group for each extra sample. With two or more groups you also get the pooled SD, the combined SD and the Brown-Forsythe test.
  4. Or upload a CSV or Excel file. On the Upload tab choose your file, then click every column you want. Each clicked column becomes its own group, highlighted in the preview.
  5. Or try a sample dataset. Ten built-in datasets cover clean data, skewed income, a Likert scale, a small sample and a dataset with a typing error.
  6. Choose sample or population SD. Keep the default sample SD (n − 1) unless you measured every member of the population. Both are always shown in the table.
  7. Set the confidence level and outlier fence. 95% and 1.5 × IQR are the usual choices.
  8. Press Calculate Standard Deviation. Nothing is computed until you do. Changing any input clears old results, so you never read stale numbers.
  9. Read the checks and the four charts. Look for outlier flags, strong skew and an SD driven by one value in Chart 4 before you trust the number.
  10. Report and export. Copy a ready-made sentence from Section 5, then use Download Doc for a text report or Download PDF for a printable version with charts.

📈 9. How to Calculate Standard Deviation in Excel

Excel has six standard deviation functions, and picking the wrong one is the single most common reason a spreadsheet answer disagrees with a paper or with R. The arithmetic itself is one formula. What trips people up is STDEV.S versus STDEV.P, blank cells and text that silently shrink n, and the confidence interval for the SD, which has no built-in function at all. This section walks through all of it with the spreadsheet shown at each step.

The whole thing in one line: with your numbers in A2:A17, type =STDEV.S(A2:A17) and press Enter. For the worked example it returns 4.1947.

9.1 The functions you need

You wantExcel functionNote
Sample standard deviation=STDEV.S(A2:A17)Divides by n − 1. The right choice for almost all research data
Population standard deviation=STDEV.P(A2:A17)Divides by n. Only when you measured every member
Sample variance=VAR.S(A2:A17)Equals STDEV.S squared
Population variance=VAR.P(A2:A17)Equals STDEV.P squared
Sum of squares=DEVSQ(A2:A17)Σ(x − x̄)², the core of every SD formula
Mean and count=AVERAGE(A2:A17), =COUNT(A2:A17)Use COUNT, not COUNTA, which counts text too
Standard error=STDEV.S(A2:A17)/SQRT(COUNT(A2:A17))No built-in function
Coefficient of variation=STDEV.S(A2:A17)/AVERAGE(A2:A17)Format the cell as a percentage
SD counting text and TRUE as values=STDEVA(A2:A17)Rarely what you want. Text counts as 0
Old-style function names=STDEV(), =STDEVP()Same as STDEV.S and STDEV.P, kept for old files

The Analysis ToolPak (File → Options → Add-ins → Manage Excel Add-ins → tick Analysis ToolPak) gives a Descriptive Statistics table under Data → Data Analysis. Its "Standard Deviation" row is the sample SD, the same as STDEV.S.

9.2 Step by step

1 Put your numbers in one column

Paste the values down column A with a text label in A1, and keep your summary statistics in columns B and C. Excel’s SD functions skip the header automatically, so the range can start at A2.

Xsd.xlsx - ExcelA2fx52A1Leaf length (mm)252348455561647750858953

The 16 leaf lengths sit in A2:A17. Only the first eight rows are shown here.

2 Get the mean, n and the sum of squares

These three numbers are the ingredients of every standard deviation. Seeing them first means you can check the SD by hand.

=AVERAGE(A2:A17)=COUNT(A2:A17)=DEVSQ(A2:A17)
Xsd.xlsx - ExcelC4fx=DEVSQ(A2:A17)ABC1LengthStatisticValue252Mean52.4375348n16455Sum of squares263.9375561647750858953

Mean 52.4375, n 16, sum of squares 263.9375.

3 Calculate the sample and population SD

Put both side by side. The difference reminds you, and your reader, which one you are reporting.

=STDEV.S(A2:A17)=STDEV.P(A2:A17)=VAR.S(A2:A17)
Xsd.xlsx - ExcelC5fx=STDEV.S(A2:A17)ABC1LengthStatisticValue252Mean52.4375348n16455Sum of squares263.9375561Sample SD4.1947647Population SD4.0615750Sample variance17.5958858953

Sample SD 4.1947, population SD 4.0615, sample variance 17.5958. Check: √(263.9375 ÷ 15) = 4.1947.

4 Add the standard error, CV and the confidence interval for the SD

Excel has no CI function for the SD, but CHISQ.INV builds it in two cells.

=SQRT(C4/CHISQ.INV(0.975,C3-1))=SQRT(C4/CHISQ.INV(0.025,C3-1))
Xsd.xlsx - ExcelC10fx=SQRT(C4/CHISQ.INV(0.975,C3-1))ABC1LengthStatisticValue252Mean52.4375348n16455Sum of squares263.9375561Sample SD4.1947647Population SD4.0615750Sample variance17.5958858Standard error1.0487953CV8.00%1049CI lower for SD3.09871156CI upper for SD6.4922

SE 1.0487, CV 8.00% and the 95% CI for σ from 3.0987 to 6.4922, where C3 holds n and C4 holds DEVSQ.

5 Standard deviation of several groups at once

Put each group in its own column and copy the formula across. For a long table with a group column, use a FILTER inside the SD function (Excel 365).

=STDEV.S(FILTER(A2:A200,B2:B200="Site B"))=SQRT(((COUNT(A:A)-1)*VAR.S(A:A)+(COUNT(B:B)-1)*VAR.S(B:B))/(COUNT(A:A)+COUNT(B:B)-2))

The second formula is the pooled SD of columns A and B. For the two slopes in sample dataset 1 it returns 6.4184.

9.3 The awkward cases

Standard deviation of a frequency table. Put class midpoints in A, frequencies in B, then:

=SQRT(SUMPRODUCT(B2:B7,(A2:A7-SUMPRODUCT(A2:A7,B2:B7)/SUM(B2:B7))^2)/(SUM(B2:B7)-1))

For the frequency table in Section 2C (midpoints 42.5 to 67.5) this gives 6.1660. The classic mistake is dividing by the number of classes instead of the total frequency.

Standard deviation from a standard error. =SE*SQRT(n). A paper reporting SE = 0.35 with n = 49 implies SD = 2.45. Forgetting this step is the most common error in meta-analysis data extraction.

Ignoring zeros that mean "missing". =STDEV.S(IF(A2:A17<>0,A2:A17)) entered as an array formula (Ctrl + Shift + Enter in older Excel). Blank cells are ignored automatically, but zeros are counted.

The STDEV.P trap. Excel’s function list often suggests STDEV.P first. For a sample it gives an answer that is too small: 4.0615 instead of 4.1947 here, and the error grows as n gets smaller. Unless you measured the entire population, use STDEV.S.

9.4 Why your Excel answer might differ from R or Python

SituationWhat happensFix
Python NumPy gives a smaller SDnp.std() defaults to the population formula, ddof = 0Use np.std(x, ddof=1) to match STDEV.S
Pandas matches Excel but NumPy does notPandas .std() defaults to ddof = 1State ddof explicitly in both
Blank cells in the rangeExcel skips them, so n is smaller than you expectCheck COUNT returns the n you intended
Zeros typed for missing dataCounted as real values, which usually inflates the SDLeave missing cells blank
Numbers stored as textSilently skipped by STDEV.S, counted as 0 by STDEVALook for green triangles, then Convert to Number
Quartiles and IQR differQUARTILE.EXC and R type 7 use different rulesUse QUARTILE.INC to match R and this page
Rounded values were reusedCopying a displayed 52.44 instead of 52.4375 shifts later stepsReference cells, never retype rounded numbers
ToolSample SD (n − 1)Population SD (n)Variance (n − 1)
Excel / Google Sheets=STDEV.S(rng)=STDEV.P(rng)=VAR.S(rng)
Rsd(x)sd(x)*sqrt((n-1)/n)var(x)
Python NumPynp.std(x, ddof=1)np.std(x)np.var(x, ddof=1)
Python pandass.std()s.std(ddof=0)s.var()
Python statisticsstatistics.stdev(x)statistics.pstdev(x)statistics.variance(x)
TI-84Sx in STAT → CALC → 1-Var Statsσx in the same listsquare Sx
SPSSAnalyze → Descriptive Statistics → Descriptives reports the sample SD (n − 1)

9.5 Charting mean ± SD in Excel

  1. Select your group names and their means.
  2. Insert → Charts → Clustered Column.
  3. Click the chart, press the + button, tick Error Bars, then More Options → Custom → Specify Value and select the cells holding each group’s SD for both the positive and negative values.
  4. Do not use Excel’s built-in "Standard Deviation" error bar option. It computes one SD across all the bar heights, not the SD of each group’s data, and it is wrong for this purpose.
  5. Write in the caption "Error bars show ±1 SD". An unlabelled error bar cannot be interpreted.

Chart 2 in Section 3 of this page draws SD and SE error bars side by side automatically, which is a quick way to check your Excel chart.

9.6 Excel errors you will probably hit

Excel showsWhyFix
#DIV/0! from STDEV.SFewer than two numeric values in the rangeA sample SD needs at least 2 values. Check the range and text-stored numbers
#DIV/0! from STDEV.PNo numeric values at allCheck that the range points at your data
#NUM! from CHISQ.INVProbability outside 0 to 1, or df below 1Use 0.975 and 0.025 for a 95% interval, and n − 1 for df
#VALUE!Text inside a formula that does arithmetic, such as SQRT on a labelPoint the formula at numeric cells only
SD looks too largeA typing error, or zeros entered for missing dataSort the column and look at both ends
SD is exactly 0All values identical, or the range covers one repeated cellCheck the range address
Green triangles in cell cornersNumbers stored as text and being skippedSelect the column, click the warning, Convert to Number

📈 10. How to Calculate Standard Deviation in R

R gives you the sample standard deviation in two letters, sd(x), but a bare SD is rarely all you need to report. The script below is complete and runnable. It shows every step of the calculation, adds the population SD, the standard error, the CV, a chi-square confidence interval for σ and two robust checks, prints a plain-English verdict, and saves one publication-ready figure at 300 dpi. It uses base R only, so there is nothing to install.

Copy the whole block. It runs top to bottom in RStudio, VS Code or plain Rscript. Change only the x <- c(...) line to use your own data.

10.1 The complete script

R, base only, saves sd_plot.png

# ============================================================
# Standard deviation with steps, CI for sigma and one figure
# StatsUnlock - https://statsunlock.com/standard-deviation-calculator/
# Base R only. No packages to install.
# ============================================================

# ---- 1. Your data ------------------------------------------
# Replace with your own values, or read a CSV:
#   x <- read.csv("data.csv")$column_name
x <- c(52, 48, 55, 61, 47, 50, 58, 53,
       49, 56, 51, 54, 46, 57, 50, 52)
x <- x[!is.na(x)]                  # drop missing values first

label <- "Site A, north slope"
units <- "mm"
conf  <- 0.95

# ---- 2. The calculation, step by step ----------------------
n      <- length(x)
mean_x <- mean(x)
dev    <- x - mean_x               # deviations, they sum to 0
ss     <- sum(dev^2)               # sum of squares (Excel DEVSQ)
var_s  <- ss / (n - 1)             # sample variance, same as var(x)
sd_s   <- sqrt(var_s)              # sample SD, same as sd(x)
var_p  <- ss / n                   # population variance
sd_p   <- sqrt(var_p)              # population SD
se     <- sd_s / sqrt(n)
cv     <- sd_s / abs(mean_x) * 100

# ---- 3. Confidence interval for sigma (chi-square) ---------
a     <- 1 - conf
ci_lo <- sqrt(ss / qchisq(1 - a / 2, df = n - 1))
ci_hi <- sqrt(ss / qchisq(a / 2,     df = n - 1))

# ---- 4. Robust checks ---------------------------------------
mad_robust <- mad(x)               # 1.4826 x median absolute deviation
iqr_sd     <- IQR(x) / 1.349
within2    <- mean(abs(dev) <= 2 * sd_s) * 100

cat(sprintf("n                  = %d\n", n))
cat(sprintf("mean               = %.4f\n", mean_x))
cat(sprintf("sum of squares     = %.4f\n", ss))
cat(sprintf("sample variance    = %.4f\n", var_s))
cat(sprintf("sample SD (n-1)    = %.4f\n", sd_s))
cat(sprintf("population SD (n)  = %.4f\n", sd_p))
cat(sprintf("standard error     = %.4f\n", se))
cat(sprintf("CV                 = %.2f%%\n", cv))
cat(sprintf("%d%% CI for sigma   = %.4f to %.4f\n", round(conf * 100), ci_lo, ci_hi))
cat(sprintf("robust SD (MAD)    = %.4f   IQR/1.349 = %.4f\n", mad_robust, iqr_sd))
cat(sprintf("within 2 SD        = %.1f%%\n", within2))
cat(sprintf("Verdict: SD = %.2f %s, CV = %.1f%% -> %s spread%s\n", sd_s, units, cv,
    if (cv < 10) "low" else if (cv <= 30) "moderate" else "high",
    if (sd_s / mad_robust > 1.5) ", but outliers may be inflating it" else ""))

# ---- 5. One figure, two panels -----------------------------
png("sd_plot.png", width = 3000, height = 1500, res = 300)
par(mfrow = c(1, 2), mar = c(4.5, 4.5, 3.5, 1), family = "sans")

# left: every value with mean +/- 1 and 2 SD bands
set.seed(42)                       # reproducible jitter
jit <- runif(n, -0.25, 0.25)
plot(jit, x, xlim = c(-0.6, 0.6), xaxt = "n", xlab = "", ylab = units,
     pch = 21, bg = adjustcolor("#16a34a", 0.75), col = "white", cex = 1.6,
     ylim = range(c(x, mean_x + c(-2, 2) * sd_s)), las = 1,
     main = sprintf("%s\nmean = %.2f, SD = %.2f", label, mean_x, sd_s), cex.main = 0.95)
rect(-0.4, mean_x - 2 * sd_s, 0.4, mean_x + 2 * sd_s, col = adjustcolor("#16a34a", 0.08), border = NA)
rect(-0.4, mean_x - sd_s,     0.4, mean_x + sd_s,     col = adjustcolor("#16a34a", 0.18), border = NA)
segments(-0.4, mean_x, 0.4, mean_x, lwd = 3, col = "#15803d")
points(jit, x, pch = 21, bg = adjustcolor("#16a34a", 0.75), col = "white", cex = 1.6)

# right: histogram with normal curve and SD lines
h <- hist(x, breaks = "Sturges", plot = FALSE)
plot(h, col = "#e9d5ff", border = "#9333ea", main = "Histogram with +/- 1, 2, 3 SD",
     xlab = sprintf("Value (%s)", units), las = 1, cex.main = 0.95,
     xlim = mean_x + c(-3.3, 3.3) * sd_s)
bw <- diff(h$breaks)[1]
curve(n * bw * dnorm(x, mean_x, sd_s), add = TRUE, col = "#ea580c", lwd = 2.4)
abline(v = mean_x + (-3:3) * sd_s, lty = c(3, 2, 2, 1, 2, 2, 3),
       col = c("#b91c1c", "#ca8a04", "#0f766e", "#111827", "#0f766e", "#ca8a04", "#b91c1c"))

dev.off()
cat("\nSaved sd_plot.png\n")

Run it with Rscript sd_script.R from a terminal, or paste it into the RStudio console. It prints n = 16, sample SD = 4.1947, population SD = 4.0615 and a 95% CI for sigma of 3.0987 to 6.4922.

10.2 What each part does

Line or functionWhat it does, and why it is there
x[!is.na(x)]Drops missing values. sd() returns NA if even one value is missing, and na.rm = TRUE hides the change in n.
dev <- x - mean_xThe deviations. Printing sum(dev) gives 0 (or a tiny rounding error), a good sanity check.
ss <- sum(dev^2)The sum of squares, the same as Excel DEVSQ.
var_s <- ss / (n - 1)The sample variance. R’s var(x) gives the same answer and always uses n − 1.
sd_s <- sqrt(var_s)The sample SD, identical to sd(x) and Excel STDEV.S.
sd_p <- sqrt(ss / n)The population SD. R has no built-in function for it, so it is computed directly.
qchisq(1 - a/2, n - 1)The upper chi-square critical value. Dividing the sum of squares by it gives the lower limit of the CI for σ.
mad(x)Median absolute deviation already multiplied by 1.4826, so it estimates σ for normal data. Use mad(x, constant = 1) for the raw MAD.
IQR(x) / 1.349A second robust SD. IQR() uses quantile type 7, the same as Excel QUARTILE.INC.
set.seed(42)Fixes the random jitter so the figure is identical every time you run it.
rect(...)Draws the shaded ±1 SD and ±2 SD bands behind the points.
curve(n * bw * dnorm(...))Scales the normal density to counts, so the bell curve sits on the same axis as the histogram.
png(..., res = 300)Writes a print-quality file. Without res you get a blurry 72 dpi image.
dev.off()Closes the file. Forgetting it leaves an empty or locked PNG.

10.3 What the figure shows

The left panel plots every value with a little horizontal jitter. The dark green band is the mean ± 1 SD and the pale band is ± 2 SD, with the mean as a thick line. You can see at a glance that most points sit inside the dark band and none sit outside the pale one. The right panel is a histogram with a normal curve of the same mean and SD drawn over it, plus lines at ±1, 2 and 3 SD. If the bars roughly follow the curve, mean ± SD is a fair summary.

10.4 Common R problems and fixes

SymptomCauseFix
sd(x) returns NAAt least one missing valueClean first with x <- x[!is.na(x)]
sd(x) differs from PythonNumPy divides by n by defaultUse np.std(x, ddof=1) in Python
Need the population SDBase R has no function for itsd(x) * sqrt((length(x) - 1) / length(x))
sd(df) gives an errorsd() wants a vector, not a data framesapply(df[sapply(df, is.numeric)], sd)
Result is NA with one valueA sample SD needs at least two valuesCheck length(x)
mad(x) looks too largeIt is scaled by 1.4826 by defaultUse mad(x, constant = 1) for the raw MAD
Numbers read as text from CSVA stray character in the columnas.numeric(gsub(",", "", x)), then check for NA
PNG is emptydev.off() was not calledRun while (dev.cur() > 1) dev.off()

10.5 Useful one-liners

You wantR code
Sample SDsd(x)
Sample variancevar(x)
SD by grouptapply(df$value, df$group, sd)
Mean and SD by group in one tableaggregate(value ~ group, df, function(v) c(mean = mean(v), sd = sd(v), n = length(v)))
SD of every numeric columnsapply(df[sapply(df, is.numeric)], sd, na.rm = TRUE)
Standard errorsd(x) / sqrt(length(x))
Coefficient of variation, %sd(x) / mean(x) * 100
Brown-Forsythe test of equal SDscar::leveneTest(value ~ group, data = df, center = median)

📈 11. How to Calculate Standard Deviation in Python

Python has at least four ways to get a standard deviation, and they do not agree by default. NumPy’s np.std() returns the population SD unless you pass ddof=1, while pandas and the statistics module return the sample SD. The script below sets ddof explicitly, prints every step, adds a chi-square confidence interval for σ and saves one 300 dpi figure.

Copy the whole block. It needs NumPy, SciPy and Matplotlib, all standard in a scientific Python install. Change only the x = np.array([...]) line.
numpyarrays and the arithmetic
scipy.statschi-square values and robust MAD
matplotlibthe figure

Install with pip install numpy scipy matplotlib if you do not already have them.

11.1 The complete script

Python 3, saves sd_plot.png

# ============================================================
# Standard deviation with steps, CI for sigma and one figure
# StatsUnlock - https://statsunlock.com/standard-deviation-calculator/
# ============================================================

import numpy as np
import matplotlib
matplotlib.use("Agg")              # save to file without opening a window
import matplotlib.pyplot as plt
from scipy import stats

# ---- 1. Your data ------------------------------------------
# Replace this list with your own values, or read a CSV:
#   import pandas as pd
#   x = pd.read_csv("data.csv")["column_name"].to_numpy(dtype=float)
x = np.array([52, 48, 55, 61, 47, 50, 58, 53,
              49, 56, 51, 54, 46, 57, 50, 52], dtype=float)
x = x[~np.isnan(x)]                # drop missing values first

label, units, conf = "Site A, north slope", "mm", 0.95

# ---- 2. The calculation, step by step ----------------------
n = x.size
mean_x = x.mean()
dev = x - mean_x                   # deviations, they sum to 0
ss = np.sum(dev ** 2)              # sum of squares (Excel DEVSQ)
sd_s = np.std(x, ddof=1)           # sample SD, matches STDEV.S and R sd()
sd_p = np.std(x, ddof=0)           # population SD, NumPy default
var_s = sd_s ** 2
se = sd_s / np.sqrt(n)
cv = sd_s / abs(mean_x) * 100

# ---- 3. Confidence interval for sigma (chi-square) ---------
a = 1 - conf
ci_lo = np.sqrt(ss / stats.chi2.ppf(1 - a / 2, n - 1))
ci_hi = np.sqrt(ss / stats.chi2.ppf(a / 2, n - 1))

# ---- 4. Robust checks ---------------------------------------
mad_robust = stats.median_abs_deviation(x, scale="normal")   # 1.4826 x MAD
q1, q3 = np.percentile(x, [25, 75])
iqr_sd = (q3 - q1) / 1.349
within2 = np.mean(np.abs(dev) <= 2 * sd_s) * 100

print(f"n                  = {n}")
print(f"mean               = {mean_x:.4f}")
print(f"sum of squares     = {ss:.4f}")
print(f"sample variance    = {var_s:.4f}")
print(f"sample SD (n-1)    = {sd_s:.4f}")
print(f"population SD (n)  = {sd_p:.4f}")
print(f"standard error     = {se:.4f}")
print(f"CV                 = {cv:.2f}%")
print(f"{conf:.0%} CI for sigma   = {ci_lo:.4f} to {ci_hi:.4f}")
print(f"robust SD (MAD)    = {mad_robust:.4f}   IQR/1.349 = {iqr_sd:.4f}")
print(f"within 2 SD        = {within2:.1f}%")
level = "low" if cv < 10 else "moderate" if cv <= 30 else "high"
flag = ", but outliers may be inflating it" if sd_s / mad_robust > 1.5 else ""
print(f"Verdict: SD = {sd_s:.2f} {units}, CV = {cv:.1f}% -> {level} spread{flag}")

# ---- 5. One figure, two panels -----------------------------
rng = np.random.default_rng(42)    # reproducible jitter
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 5))

jit = rng.uniform(-0.25, 0.25, n)
ax1.axhspan(mean_x - 2 * sd_s, mean_x + 2 * sd_s, xmin=0.15, xmax=0.85, color="#16a34a", alpha=0.08)
ax1.axhspan(mean_x - sd_s, mean_x + sd_s, xmin=0.15, xmax=0.85, color="#16a34a", alpha=0.18)
ax1.hlines(mean_x, -0.4, 0.4, color="#15803d", lw=3)
ax1.scatter(jit, x, s=70, color="#16a34a", alpha=0.8, edgecolor="white")
ax1.set_xlim(-0.6, 0.6); ax1.set_xticks([]); ax1.set_ylabel(units)
ax1.set_title(f"{label}\nmean = {mean_x:.2f}, SD = {sd_s:.2f}", fontsize=10)

counts, edges, _ = ax2.hist(x, bins="sturges", color="#e9d5ff", edgecolor="#9333ea")
grid = np.linspace(mean_x - 3.3 * sd_s, mean_x + 3.3 * sd_s, 200)
ax2.plot(grid, n * (edges[1] - edges[0]) * stats.norm.pdf(grid, mean_x, sd_s), color="#ea580c", lw=2.4)
for k, c in zip(range(-3, 4), ["#b91c1c", "#ca8a04", "#0f766e", "#111827", "#0f766e", "#ca8a04", "#b91c1c"]):
    ax2.axvline(mean_x + k * sd_s, color=c, ls="-" if k == 0 else "--", lw=1.4)
ax2.set_title("Histogram with +/- 1, 2, 3 SD", fontsize=10)
ax2.set_xlabel(f"Value ({units})")

fig.tight_layout()
fig.savefig("sd_plot.png", dpi=300, bbox_inches="tight")
print("\nSaved sd_plot.png")

Run it with python sd_script.py. It prints n = 16, mean = 52.4375, sum of squares = 263.9375, sample SD = 4.1947, population SD = 4.0615 and a 95% CI for sigma of 3.0987 to 6.4922, matching Excel and R exactly.

11.2 What each part does

Line or functionWhat it does, and why it is there
dtype=floatMakes sure the array holds decimals, so later division never truncates.
x[~np.isnan(x)]Drops missing values. np.std returns nan if any value is missing; np.nanstd is the alternative.
np.std(x, ddof=1)The sample SD. ddof=1 is essential: without it NumPy divides by n and returns 4.0615 instead of 4.1947.
np.std(x, ddof=0)The population SD, NumPy’s default.
np.sum(dev ** 2)The sum of squares, the same as Excel DEVSQ.
stats.chi2.ppf(...)Chi-square critical values with n − 1 degrees of freedom, used for the CI for σ.
median_abs_deviation(x, scale="normal")The robust SD, 1.4826 × MAD. Without scale="normal" you get the raw MAD.
np.percentile(x, [25, 75])Quartiles with linear interpolation, the same as R type 7 and Excel QUARTILE.INC.
default_rng(42)A seeded random generator, so the jitter and the figure are reproducible.
axhspan(...)Shades the ±1 SD and ±2 SD bands behind the points.
stats.norm.pdf(...) × n × bin widthScales the bell curve to the histogram counts.
savefig(dpi=300, bbox_inches="tight")Writes a print-quality PNG without clipped labels.

11.3 What the figure shows

The two panels match the R figure exactly: every value with mean ± 1 and 2 SD bands on the left, and the histogram with a fitted normal curve and SD lines on the right. Same data, same seed, same picture, which is a quick visual proof that the two scripts agree.

11.4 Common Python problems and fixes

SymptomCauseFix
NumPy SD smaller than ExcelDefault ddof=0 is the population SDnp.std(x, ddof=1)
NumPy and pandas disagreepandas defaults to ddof=1, NumPy to ddof=0Always pass ddof explicitly
Result is nanA missing value in the arraynp.nanstd(x, ddof=1) or drop NaN first
statistics.stdev raises an errorFewer than two valuesCheck len(x)
Huge numbers give a slightly wrong SDFloating-point loss in naive two-sum formulasUse np.std or statistics.stdev, which are numerically stable
Column read as textCommas or symbols in the CSVpd.to_numeric(df["col"], errors="coerce")
Figure window opens but no filesavefig called after showCall savefig before plt.show()

11.5 Useful one-liners

You wantPython code
Sample SD, standard librarystatistics.stdev(x)
Population SD, standard librarystatistics.pstdev(x)
Sample SD, NumPynp.std(x, ddof=1)
SD by group, pandasdf.groupby("group")["value"].std()
Mean, SD and n by groupdf.groupby("group")["value"].agg(["mean", "std", "count"])
Standard errorscipy.stats.sem(x)
Coefficient of variationscipy.stats.variation(x, ddof=1)
Brown-Forsythe testscipy.stats.levene(a, b, center="median")

Run the script with python sd_script.py from a terminal. In Jupyter, remove the matplotlib.use("Agg") line and add plt.show() at the end to see the figure inline.

📋 12. Reference Tables

12.1 Which standard deviation should you use?

Your situationUseExcel
A sample from a larger group (almost all research)Sample SD, n − 1STDEV.S
Every member of the group was measured, no generalisingPopulation SD, nSTDEV.P
Data skewed or with outliersSD plus median and IQR, or robust SDQUARTILE.INC
Several groups, one within-group spread neededPooled SDformula in 9.2
Only a frequency table is availableGrouped SD from midpointsformula in 9.3
Only SE and n are reportedSD = SE × √n=SE*SQRT(n)
Comparing spread across different unitsCoefficient of variation=STDEV.S/AVERAGE

What to conclude: the n − 1 sample SD is the default. Switch only when the situation in the left column clearly applies.

12.2 Empirical rule versus Chebyshev’s inequality

Within k SD of the meanNormal (bell-shaped) dataAny data, at least (Chebyshev)
k = 168.27%no guarantee
k = 1.586.64%55.6%
k = 1.9695.00%74.0%
k = 295.45%75.0%
k = 2.598.76%84.0%
k = 399.73%88.9%

What to conclude: only use the 68-95-99.7 rule when your data look bell shaped. Otherwise quote the Chebyshev minimum, which holds for every distribution (Pukelsheim, 1994).

12.3 How precise is a standard deviation? 95% CI as a multiple of s

nLower limitUpper limitUpper ÷ lower
50.599 × s2.874 × s4.80
100.688 × s1.826 × s2.65
150.732 × s1.577 × s2.15
200.760 × s1.461 × s1.92
300.796 × s1.344 × s1.69
500.835 × s1.246 × s1.49
1000.878 × s1.162 × s1.32
2000.911 × s1.109 × s1.22

What to conclude: you need about 30 values before the SD is known to within roughly 20% to 35%, and about 100 to get within 15%. Multiply your own s by these factors for a quick interval (normal data assumed).

12.4 Chi-square critical values for the CI of σ

df = n − 1χ² 0.025χ² 0.975χ² 0.05χ² 0.95
40.48411.1430.7119.488
50.83112.8331.14511.070
71.69016.0132.16714.067
92.70019.0233.32516.919
103.24720.4833.94018.307
156.26227.4887.26124.996
198.90732.85210.11730.144
2412.40139.36413.84836.415
2916.04745.72217.70842.557
4931.55570.22233.93066.339
9973.361128.42277.046123.225

What to conclude: for a 95% interval divide (n − 1)s² by the 0.975 value for the lower limit and by the 0.025 value for the upper limit, then take square roots. The worked example uses df = 15.

12.5 Bessel correction and the c4 constant

ns ÷ σn = √[n ÷ (n − 1)]Sample SD larger byc4 (E[s] = c4 × σ)
21.414241.4%0.7979
31.224722.5%0.8862
51.118011.8%0.9400
101.05415.4%0.9727
201.02602.6%0.9869
301.01711.7%0.9914
501.01021.0%0.9949

What to conclude: n − 1 makes the variance unbiased, but the SD itself is still slightly too small on average. Dividing s by c4 removes that bias, which matters in quality control charts with small subgroups.

12.6 Turning other spread measures into an SD

You haveEstimated SDWorks well when
Median absolute deviation (MAD)1.4826 × MADNormal data with possible outliers
Interquartile rangeIQR ÷ 1.349Roughly symmetric data
Range, n ≈ 25 to 30Range ÷ 4Rough planning only
Range, n = 5Range ÷ 2.326Control chart subgroups (d2 constant)
Range, n = 10Range ÷ 3.078Control chart subgroups (d2 constant)
Standard error and nSE × √nAlways exact
95% CI of a mean and n√n × (upper − lower) ÷ (2 × t0.975, n−1)Always exact for a t-based interval

What to conclude: SE and CI conversions are exact; the others are estimates that assume a bell-shaped distribution (Wan et al., 2014; Hozo et al., 2005). The Summary tab in Section 2 does all of these for you.

12.7 Coefficient of variation bands

CVLabel used by this toolTypical example
under 5%Low spreadRepeat measurements on a calibrated instrument
5% to 10%Low spreadAdult height, leaf length within one site
10% to 30%Moderate spreadExam scores, crop yields between plots
above 30%High spreadIncome, species counts, reaction times under stress
above 100%High, SD exceeds the meanInsurance claims, hospital stays, rainfall per day

What to conclude: these bands are conventions, not laws. Always compare a CV with values published for the same measurement in your field.

📈 13. Example Results

1
TEXTBOOK CASE

Sample versus population SD on the classic dataset

The eight numbers every statistics course uses.

The values 2, 4, 4, 4, 5, 5, 7, 9 appear in many textbooks because their population SD comes out to exactly 2.

n = 8mean = 5σ = 2.0000s = 2.1381SS = 32
StatisticValueNote
Sum of squares32.00009 + 1 + 1 + 1 + 0 + 0 + 4 + 16
Population SD σ2.0000√(32 ÷ 8)
Sample SD s2.1381√(32 ÷ 7)
Sample variance4.571432 ÷ 7
CV42.76%High spread relative to a mean of 5
Mean 5 with the band at mean +/- 1 sample SD2468ValueTextbook datamean 5.00, SD 2.14
Eight values around a mean of 5. The shaded band is mean ± 1 sample SD (2.86 to 7.14).

What it means: the two answers differ by 7% only because n is small. If these 8 values are the whole population, report 2. If they are a sample from something bigger, report 2.14. Most calculators and textbooks quietly pick one, which is why students get "wrong" answers that are actually right for the other formula.

How to write it: "Values had a mean of 5.00 (SD = 2.14, n = 8; sample formula)."

2
SMALL SAMPLE

VO2 max in six athletes

Why an SD from tiny samples is barely an estimate.

A coach measured VO2 max in six squad members: 48.2, 52.5, 55.1, 50.3, 58.7, 46.9 ml/kg/min.

n = 6mean = 51.95s = 4.4395% CI 2.76 to 10.86upper ÷ lower = 3.9
StatisticValueNote
Sample SD4.4289ml/kg/min
Population SD4.04309% lower, because n is tiny
95% CI for σ2.7645 to 10.8623Chi-square, df = 5
CV8.53%Low relative spread
Six athletes, mean +/- 1 SD47.55052.55557.5VO2 max (ml/kg/min)Squad, n = 6mean 51.95, SD 4.43
Six points cannot pin down the spread. The true SD could be anywhere from about 2.8 to 10.9.

What it means: the SD of 4.43 looks precise, but the interval says the true squad SD could be less than 3 or more than 10. Do not use an SD from six people to plan the sample size of a larger study without allowing for this uncertainty.

How to write it: "VO2 max was 51.95 ± 4.43 ml/kg/min (mean ± SD, n = 6; 95% CI for SD 2.76 to 10.86)."

3
OUTLIER EFFECT

One typing error in a lab assay

How a single wrong value multiplies the SD.

Ten replicate concentrations in mg/L. Nine sit between 4.09 and 4.18. The tenth was typed as 5.40 instead of 4.14.

n = 10s with error = 0.4022s without = 0.029313.7 times largerrobust SD = 0.0371
StatisticWith 5.40Without 5.40
Mean4.25804.1311
Sample SD0.40220.0293
CV9.45%0.71%
Robust SD (1.4826 × MAD)0.03710.0297
Tukey outlier flagged5.40none
One wrong value stretches the SD band44.55Concentration (mg/L)With typing errormean 4.26, SD 0.40Error correctedmean 4.13, SD 0.03
One point far to the right stretches the SD band across empty space.

What it means: the single error supplies about 90% of the sum of squares. The ordinary SD jumps from 0.029 to 0.402, while the robust SD barely moves (0.030 to 0.037). When the ordinary SD is many times the robust SD, look for a recording error before anything else.

How to write it: "One value (5.40 mg/L) was traced to a transcription error and corrected; replicate precision was SD = 0.029 mg/L (CV = 0.71%, n = 9)."

4
SD BIGGER THAN MEAN

Insurance claim amounts

Strong right skew makes mean ± SD meaningless.

Twelve claims in thousands: 0.2, 0.5, 0.8, 1.1, 1.5, 2.0, 2.4, 3.1, 4.8, 7.5, 12.0 and 38.0.

n = 12mean = 6.16s = 10.60CV = 172%median = 2.20
StatisticValueNote
Mean6.1583Pulled up by one large claim
Sample SD10.6000Larger than the mean
Mean − 2 SD−15.04Impossible for a claim amount
Median and IQR2.20, 4.45A better summary here
Skewness G12.89Strong right skew
Mean +/- 1 SD runs below zero010203040Claim amount (thousands)Claimsmean 6.16, SD 10.60
Most claims bunch near zero; one 38.0 claim drags the mean right and the SD band below zero.

What it means: an SD larger than the mean is not an error. It tells you the data are bounded at zero and strongly skewed. The interval mean ± 2 SD runs below zero, which is impossible, so the SD alone misleads. Report the median and IQR, and consider analysing the logarithm of the values.

How to write it: "Claim amounts were strongly right skewed (median 2.2 thousand, IQR 1.0 to 5.5; mean 6.2, SD 10.6)."

5
LIKERT SCALE

Customer satisfaction on a 1 to 5 scale

Reading an SD when the scale has only five points.

Twenty customers rated satisfaction from 1 (very poor) to 5 (excellent). Nine chose 4.

n = 20mean = 3.65s = 1.09median = 4max possible SD ≈ 2
StatisticValueNote
Sample SD1.0894About a quarter of the 1 to 5 range
Frequencies 1, 2, 3, 4, 51, 2, 4, 9, 4Modal answer is 4
Skewness G1−0.84Mild left skew, a ceiling effect
CV29.85%Not meaningful on an ordinal scale
Number of customers giving each rating02.557.5101122439445Rating (1 = very poor, 5 = excellent)Customers
Ratings stack at 4. The SD summarises disagreement, not distance on a ruler.

What it means: on a 1 to 5 item, an SD near 0.5 means strong agreement, around 1 means moderate disagreement, and values approaching 2 mean opinion is split between the two ends. An SD of 1.09 shows most customers agree on a 4 but a minority are unhappy. Report the frequencies too, and avoid the CV for ordinal data.

How to write it: "Satisfaction was high (M = 3.65, SD = 1.09, Mdn = 4, n = 20), with 65% rating 4 or 5."

6
GROUPED DATA

Standard deviation from a frequency table

When only class counts survive, not the raw values.

A report lists 46 seedling heights in six 5 cm classes from 40 to 70 cm, with frequencies 3, 8, 15, 12, 6 and 2.

N = 46mean = 54.24s = 6.1660Sheppard = 5.9947h = 5
StatisticValueNote
Σf(m − x̄)²1710.8696Using class midpoints m
Sample SD6.1660√(1710.87 ÷ 45)
Population SD6.0986√(1710.87 ÷ 46)
Sheppard-corrected SD5.9947√(38.0193 − 25 ÷ 12)
Frequency table of 46 seedling heights051015340-45845-501550-551255-60660-65265-70Height class (cm)Frequency
Midpoints stand in for the hidden raw values, which slightly overstates the spread.

What it means: treating every value as if it sat at its class midpoint adds a small amount of artificial spread. Sheppard’s correction removes h²/12 from the variance, bringing the SD down from 6.17 to 5.99 cm. Use the correction only for smooth, bell-shaped data with equal class widths.

How to write it: "From grouped data, mean seedling height was 54.2 cm (SD = 6.2 cm, N = 46; Sheppard-corrected SD = 6.0 cm)."

7
POOLED SD

Combining three groups from a published table

Pooled versus combined SD from n, mean and SD only.

A paper reports three groups: n = 12, mean 24.5, SD 3.2; n = 15, mean 27.1, SD 4.0; n = 10, mean 22.8, SD 2.6.

N = 37pooled SD = 3.42combined SD = 3.78grand mean = 25.09df = 34
StatisticValueNote
Σ(nᵢ − 1)sᵢ²397.4811 × 10.24 + 14 × 16 + 9 × 6.76
Pooled SD3.4192√(397.48 ÷ 34)
Between-group SS117.22Σnᵢ(x̄ᵢ − 25.09)²
Combined SD3.7812√[(397.48 + 117.22) ÷ 36]
Group means with +/- 1 SD2022.52527.530Group 1n 12, 24.5 ± 3.2Group 2n 15, 27.1 ± 4.0Group 3n 10, 22.8 ± 2.6Outcome score
Three group means with ±1 SD bars. The combined SD also counts the gaps between the means.

What it means: the pooled SD (3.42) is the typical spread inside a group and belongs in Cohen’s d or a power calculation. The combined SD (3.78) is the spread of all 37 people mixed together and is what you need when merging subgroups into one row of a meta-analysis.

How to write it: "Across the three groups the pooled SD was 3.42 (df = 34); combining all participants gave M = 25.09, SD = 3.78, N = 37."

8
APPLIED FIELD STUDY

Same mean, different spread on two slopes

When the variability is the real finding.

Leaf length (mm) of 16 plants on a sheltered north slope and 16 on an exposed south slope. This is sample dataset 1 in the calculator.

n = 16 + 16SD 4.19 vs 8.05means 52.44 vs 52.56BF p = 0.009pooled SD 6.42
StatisticSite ASite B
Mean52.437552.5625
Sample SD4.19478.0496
CV8.00%15.31%
95% CI for σ3.10 to 6.495.95 to 12.46
Brown-ForsytheF(1, 30) = 7.79, p = 0.009
Same mean, different spread405060Leaf length (mm)Site A, northmean 52.44, SD 4.19Site B, southmean 52.56, SD 8.05
The two slopes share a centre but not a spread. Site B’s SD band is almost twice as wide.

What it means: a t-test on the means would find nothing, yet the plants on the exposed slope are almost twice as variable. That pattern often reflects patchy soil or wind exposure and is an ecological result in its own right. The SD ratio of 1.92 and the Brown-Forsythe p-value of 0.009 support reporting the SDs separately.

How to write it: "Mean leaf length did not differ between slopes (52.4 vs 52.6 mm), but variability was greater on the south slope (SD = 8.05 vs 4.19 mm; Brown-Forsythe F(1, 30) = 7.79, p = .009)."

🧪 14. Data Collection Protocol

Study design: the standard deviation assumes independent measurements of one quantity on an interval or ratio scale, taken the same way for every unit, so that differences between values reflect real variation plus ordinary measurement error.

  1. Define the unit of observation before you calculate standard deviation. Decide whether one value is one plant, one patient or one repeat reading. Mixing repeat readings with separate subjects shrinks the SD and makes the data look more consistent than they are.
  2. Choose sample or population SD at the design stage. If you will generalise beyond the units you measure, plan to use the sample standard deviation (n − 1) and say so in the protocol.
  3. Plan enough observations for a stable SD. Aim for at least 20 to 30 per group. With 10 values the 95% interval for σ still spans a factor of 2.65 (Table 12.3).
  4. Randomise selection. A convenience sample often has less spread than the population, because people or sites that are easy to reach tend to be similar.
  5. Fix the instrument, units and resolution. Switching instruments or observers mid-study adds variation that has nothing to do with the subject.
  6. Record missing values as blank, never as zero. A fake zero is usually far from the mean and can double the standard deviation on its own.
  7. Write the outlier rule in advance. State that values beyond 1.5 × IQR from the quartiles will be checked against raw records and corrected only if they are errors.
  8. Keep groups in separate columns or label them clearly. Mixing two populations inflates the standard deviation and hides a two-peaked distribution.
  9. Enter data twice or verify a random 10%. Example 3 shows how one typing error can make the SD almost 14 times larger.
  10. Check standard deviation calculation results in two tools. Run the same column through this page and Excel or R. Agreement to four decimals confirms the right formula and range.
GroupPlant IDLeaf length (mm)
Site A, north slopeA0152
Site A, north slopeA0248
Site B, south slopeB0150

Long format like this pastes straight into R or pandas. For this calculator, put each group in its own column (wide format) and click the columns on the Upload tab.

Minimum sample: two values give a sample SD, but treat anything under 10 per group as a rough guide and always report the confidence interval for σ. Pre-registration line: "Dispersion will be summarised as the sample SD (n − 1) with a 95% chi-square confidence interval; outliers will be screened with Tukey fences at 1.5 × IQR." Common mistakes: pooling repeat readings as if they were separate subjects, typing 0 for missing values, mixing units within a column, and reporting SE while calling it SD.

🎯 15. When to Use This Standard Deviation Calculator

This free standard deviation calculator is designed for students checking homework, researchers describing a sample, teachers building z-scores and analysts who need the SD, variance and CV for one or many groups with the working shown.

Use it when
  • Your data are numeric measurements on an interval or ratio scale.
  • You need mean ± SD for a table or abstract.
  • You want to compare spread across two or more groups.
  • You need the SD from SE, a CI, an IQR or a frequency table.
  • You want the sample and population SD side by side.
Do not rely on it alone when
  • The data are strongly skewed: add the median and IQR.
  • The data are categories with no order: use counts and percentages.
  • You want to test whether means differ: use a t-test or ANOVA.
  • The values are growth rates: use the geometric SD.
  • Observations are repeated on the same subject: use a mixed model.

Four real-world examples

  • Clinical baseline table: age, weight and blood pressure reported as mean ± SD per treatment arm.
  • Laboratory precision: the SD and CV of 10 replicate assays judge whether a method is repeatable.
  • Education: exam SDs show whether a new teaching method helps everyone equally or widens the gap.
  • Field ecology: the SD of body size or yield between sites reveals how patchy a habitat is.

Study design guidance

Plan the sample size around the precision you need for the SD itself, not just for the mean (Table 12.3). When the SD will feed into a power calculation for a later study, use the upper confidence limit of σ rather than the point estimate, so the next study is not underpowered.

Decision tree: the right tool for your question

If your question isUse
How spread out are my values?This standard deviation calculator
Are the data skewed, or are there outliers?Five number summary and box plot
How precise is my mean?Confidence interval calculator
Is the spread equal in two or more groups?Brown-Forsythe test, included above
Do two group means differ?Welch t-test
Do three or more group means differ?One-way ANOVA or Welch ANOVA
Are my data normally distributed?Kolmogorov-Smirnov or Shapiro-Wilk test

🔧 16. Troubleshooting and Common Errors

My SD does not match my textbook or teacher

Cause: one answer uses n − 1 and the other uses n. Fix: compare both rows in the results table. For 2, 4, 4, 4, 5, 5, 7, 9 the sample SD is 2.1381 and the population SD is 2.0000.

Python gives a smaller SD than Excel

Cause: np.std() divides by n unless told otherwise. Fix: use np.std(x, ddof=1), which matches STDEV.S, R sd() and the sample SD here.

Some of my values were ignored

Cause: text, currency symbols, or a comma used as a decimal mark (4,5 is read as two values, 4 and 5). Fix: use a full stop for decimals and remove units. The warning above the Calculate button lists every ignored entry.

The SD is much larger than I expected

Cause: an outlier, a typing error, or a zero entered for a missing value. Fix: look at Chart 4. A single tall red bar is driving the SD. Check that value in the raw records.

The SD is larger than the mean

Cause: strongly right-skewed data bounded at zero. Fix: this is not an error. Report the median and IQR as well, and consider a log transformation for analysis.

The confidence interval for the SD is very wide

Cause: a small sample. With n = 6 the upper limit is almost four times the lower. Fix: collect more data, or report the interval honestly so readers know the SD is uncertain.

The CV shows n/a or a huge number

Cause: the mean is zero, negative or close to zero. Fix: the CV only makes sense for positive data on a ratio scale. Report the SD alone for such variables.

My uploaded file shows no columns to click

Cause: the columns contain text, or the file is not .csv, .txt, .xlsx or .xls. Fix: remove units from cells, save as .csv, and make sure the first row is a header.

A group was skipped

Cause: it had fewer than two numbers. Fix: a sample SD needs at least two values. Add data or remove the group.

The charts did not appear

Cause: the chart library could not load, usually because of a content blocker or no internet. Fix: allow cdnjs.cloudflare.com or reload. The numbers in the tables are unaffected.

Excel error bars do not match my group SDs

Cause: Excel’s built-in "Standard Deviation" error bar computes one SD across the plotted bars. Fix: choose Custom and point at the cells holding each group’s SD (Section 9.5).

⚖ 17. Assumptions and Limitations

Assumptions

  1. Independent observations. Each value comes from a different unit. Check: the design; no repeat readings counted as separate subjects. If it fails: the SD is biased downward, because repeats are more alike than separate units.
  2. Interval or ratio scale. Differences between values mean the same thing everywhere on the scale. Check: the measurement type. If it fails: on ordinal scales the SD has no clean meaning and can over or under state disagreement.
  3. One population per group. Check: Chart 1 and Chart 3 for two separate clusters. If it fails: the SD is biased upward, since the gap between the clusters is counted as spread.
  4. Roughly normal data for the 68-95-99.7 rule and the CI for σ. Check: skewness, the empirical rule counts and Chart 3. If it fails: the CI for σ is too narrow with heavy tails, and the rule misstates coverage.
  5. Correct values. Check: outlier flags and the ratio of ordinary to robust SD. If it fails: recording errors bias the SD upward, often strongly.

Limitations

  1. The SD is not robust: one extreme value can dominate it. Alternative: median absolute deviation or IQR, both reported above.
  2. The SD says nothing about shape. Alternative: the five number summary and a box plot.
  3. The CI for σ relies heavily on normality. Alternative: a bootstrap interval in R or Python for skewed data.
  4. Grouped-data SDs are approximations. Alternative: obtain the raw values where possible.
  5. SD from IQR or range assumes normal data. Alternative: ask authors for the SD, or use the methods of Wan et al. (2014) with care.
  6. The Brown-Forsythe test has low power with small groups. Alternative: report the SD ratio and confidence intervals for each σ.

🏁 18. Conclusion

Run the analysis above to see your own conclusion here: SD = ___, mean = ___, n = ___.

A standard deviation calculator turns a column of numbers into one figure that describes how tightly they cluster around their mean. The arithmetic is short: find the mean, square each distance from it, add those squares, divide by n − 1 and take the square root. For the worked example that gives 4.1947 mm. What makes the number useful, or misleading, is everything around that arithmetic.

The first decision is sample versus population. Almost all research data are samples, so the n − 1 formula and Excel’s STDEV.S are the right default. The second is whether the SD can be trusted at all. One typing error, a zero used for a missing value, or two populations mixed into one column can inflate it many times over, which is why this page shows every value, flags outliers and reports a robust SD beside the ordinary one.

The third is how precise the SD is. A standard deviation from 16 values could easily be 25% too high or 55% too low, and from 6 values the uncertainty is far larger. When the SD itself matters, for a reliability study or for planning sample size, report its confidence interval. And never confuse it with the standard error: SD describes the people or plants, SE describes the mean.

Finally, report it properly: mean ± SD with n, the formula you used, and the median and IQR when the data are skewed. Paste your data into this standard deviation calculator, read the checks before the headline number, and copy a ready-made sentence from Section 5.

❓ 19. Frequently Asked Questions

How do you calculate standard deviation?

Find the mean, subtract it from every value, square each difference, add the squares, divide by n − 1 for a sample (or n for a population), then take the square root. For 52, 48, 55, 61, 47, 50, 58, 53, 49, 56, 51, 54, 46, 57, 50, 52 the result is 4.1947.

What is the formula for standard deviation?

The sample standard deviation is s = √[Σ(x − x̄)² ÷ (n − 1)]. The population standard deviation is σ = √[Σ(x − μ)² ÷ N]. The only difference is the denominator.

What is the difference between sample and population standard deviation?

The sample SD divides the sum of squares by n − 1, and the population SD divides by n. Use the sample SD when your data are a sample from a larger group, which is almost always. The sample SD is slightly larger, by 3% for n = 16 and 12% for n = 5.

Why do we divide by n − 1 instead of n?

Deviations are measured from the sample mean, which is always closer to the sample than the true mean is. That makes the sum of squares too small. Dividing by n − 1, called Bessel’s correction, makes the variance unbiased. n − 1 is also the degrees of freedom.

What is a good standard deviation?

There is no single good value, because the SD depends on units. Judge it against the mean with the coefficient of variation: under 10% is low spread, 10% to 30% moderate, above 30% high. For lab methods a CV under 5% is often expected.

What does a high standard deviation mean?

A high SD means values are spread widely around the mean, so the mean is a less reliable guide to any single value. It can reflect real diversity, a skewed distribution, two groups mixed together, or errors in the data.

Can standard deviation be negative?

No. The SD is the square root of a sum of squared numbers, so it is always zero or positive. It equals zero only when every value is the same. A negative SD means a formula was entered incorrectly.

Can the standard deviation be bigger than the mean?

Yes. This is common for positive, right-skewed data such as incomes, claim amounts or hospital stays. It signals strong skew, and in that case you should also report the median and IQR.

What is the difference between standard deviation and standard error?

The SD describes how much individual values vary. The standard error, SE = SD ÷ √n, describes how precisely the mean is estimated. Use SD to describe data and SE or a confidence interval to describe a mean. For the worked example SD = 4.19 and SE = 1.05.

How do you convert variance to standard deviation?

Take the square root: SD = √variance. To go back, square the SD. A variance of 17.5958 gives an SD of 4.1947.

How do you find standard deviation from standard error?

Multiply the standard error by the square root of the sample size: SD = SE × √n. A mean reported with SE = 0.35 and n = 49 has SD = 0.35 × 7 = 2.45.

How do you calculate standard deviation for grouped data?

Use class midpoints m and frequencies f: find the mean Σfm ÷ N, then s = √[Σf(m − x̄)² ÷ (N − 1)]. Sheppard’s correction subtracts h²/12 from the variance when classes have equal width h. Section 2C does this for you.

What is the pooled standard deviation?

The pooled SD combines the spread inside several groups, weighting each group’s variance by n − 1: sp = √[Σ(nᵢ − 1)sᵢ² ÷ Σ(nᵢ − 1)]. It is used in Cohen’s d and the Student t-test.

What is the 68-95-99.7 rule?

For normally distributed data, about 68% of values lie within 1 SD of the mean, 95% within 2 SD and 99.7% within 3 SD. It is also called the empirical rule. For non-normal data, Chebyshev’s inequality guarantees only at least 75% within 2 SD.

How many data points do you need for a standard deviation?

Two values are the minimum for a sample SD, but it is very imprecise. With 10 values the 95% interval for the true SD spans a factor of 2.65, and you need about 30 values to know the SD within roughly 20% to 35%.

Should error bars show SD or SE?

Use SD error bars to show how variable the data are and SE or 95% CI bars to show how precise the mean is. Always say which one in the caption. SE bars are about √n times shorter, so mixing them up misleads readers.

How do you interpret standard deviation on a Likert scale?

On a 1 to 5 item the SD ranges from 0 (everyone agrees) to about 2 (opinion split between the ends). Around 1 means moderate disagreement. Report the frequencies too, because Likert data are ordinal.

How do you calculate standard deviation in Excel?

Use =STDEV.S(A2:A17) for a sample and =STDEV.P(A2:A17) for a population. =VAR.S gives the variance and =DEVSQ the sum of squares. Section 9 shows each step with spreadsheet screenshots.

How do you calculate standard deviation in R?

Use sd(x), which always divides by n − 1. Remove missing values first or use sd(x, na.rm = TRUE). For the population SD use sd(x) * sqrt((n - 1) / n). Section 10 has a full script with a 300 dpi figure.

How do you calculate standard deviation in Python?

Use statistics.stdev(x), np.std(x, ddof=1) or pandas s.std() for the sample SD. Plain np.std(x) returns the population SD, which is smaller. Section 11 has a complete script.

📑 20. Cite This Tool

APA 7th edition
StatsUnlock. (2026). Standard deviation calculator [Interactive statistical tool]. https://statsunlock.com/standard-deviation-calculator/
BibTeX
@misc{statsunlock_sd_2026, title={Standard Deviation Calculator}, author={{StatsUnlock}}, year={2026}, note={Interactive statistical tool}, url={https://statsunlock.com/standard-deviation-calculator/}}
Methods wording (auto-filled after you run the calculator)
Variability was quantified with the StatsUnlock Standard Deviation Calculator (2026). The sample standard deviation was computed with the n − 1 (Bessel-corrected) denominator using a numerically stable one-pass algorithm, and a 95% chi-square confidence interval was calculated for the population standard deviation. Outliers were screened with Tukey fences at 1.5 × IQR.

🔗 21. Related Tools

📖 22. Glossary of Terms

TermMeaning
Bessel’s correctionDividing by n − 1 instead of n so the sample variance is not too small on average.
Brown-Forsythe testA test of whether several groups have equal spread, based on distances from each group’s median.
Chebyshev’s inequalityA rule that holds for any data: at least 1 − 1/k² of values lie within k SD of the mean.
Chi-square distributionThe probability distribution used to build a confidence interval for a variance or SD.
Coefficient of variation (CV)The SD divided by the mean, as a percentage. Also called relative standard deviation.
Combined SDThe SD of several groups merged into one sample, including the differences between their means.
Confidence intervalA range of plausible values for an unknown population quantity, such as σ.
Degrees of freedomThe number of values free to vary after the mean is fixed, n − 1 for one sample.
DeviationThe distance of one value from the mean, x − x̄. Deviations always add up to zero.
Empirical ruleFor normal data, about 68%, 95% and 99.7% of values lie within 1, 2 and 3 SD of the mean.
Grouped dataData reported only as counts in classes, such as a frequency table.
Interquartile range (IQR)The width of the middle half of the data, Q3 minus Q1.
Mean absolute deviationThe average distance of values from the mean, without squaring.
Median absolute deviation (MAD)The median distance of values from the median. Times 1.4826 it estimates σ robustly.
OutlierA value far from the rest, here beyond 1.5 × IQR from the quartiles.
Pooled SDThe average within-group SD of several groups, weighted by their degrees of freedom.
PopulationThe whole group you want to describe, not just the part you measured.
SampleThe subset of the population you actually measured.
Sheppard’s correctionSubtracting h²/12 from a grouped-data variance to remove the bias from using class midpoints.
Standard deviationThe square root of the variance: the typical distance of values from their mean.
Standard error (SE)The SD divided by √n, measuring how precisely the mean is estimated.
Sum of squares (SS)The total of the squared deviations from the mean.
VarianceThe average squared deviation from the mean, the SD squared.
Welford’s algorithmA one-pass method for the variance that avoids rounding errors with large numbers.
z-scoreHow many SDs a value sits above or below the mean, (x − x̄) ÷ s.

📚 23. References

These peer-reviewed sources support the methods used in this standard deviation calculator: the sample and population formulas, stable computation, confidence intervals, robust alternatives, pooled and grouped SDs, and best practice in reporting spread.

  1. Altman, D. G., & Bland, J. M. (2005). Standard deviations and standard errors. BMJ, 331(7521), 903. https://doi.org/10.1136/bmj.331.7521.903
  2. Bland, J. M., & Altman, D. G. (1996). Statistics notes: Measurement error. BMJ, 312(7047), 1654. https://doi.org/10.1136/bmj.312.7047.1654
  3. Brown, M. B., & Forsythe, A. B. (1974). Robust tests for the equality of variances. Journal of the American Statistical Association, 69(346), 364–367. https://doi.org/10.1080/01621459.1974.10482955
  4. 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. https://doi.org/10.1080/00031305.1983.10483115
  5. Conover, W. J., Johnson, M. E., & Johnson, M. M. (1981). A comparative study of tests for homogeneity of variances, with applications to the outer continental shelf bidding data. Technometrics, 23(4), 351–361. https://doi.org/10.1080/00401706.1981.10487680
  6. Cumming, G., Fidler, F., & Vaux, D. L. (2007). Error bars in experimental biology. Journal of Cell Biology, 177(1), 7–11. https://doi.org/10.1083/jcb.200611141
  7. Hozo, S. P., Djulbegovic, B., & Hozo, I. (2005). Estimating the mean and variance from the median, range, and the size of a sample. BMC Medical Research Methodology, 5, 13. https://doi.org/10.1186/1471-2288-5-13
  8. Hyndman, R. J., & Fan, Y. (1996). Sample quantiles in statistical packages. The American Statistician, 50(4), 361–365. https://doi.org/10.1080/00031305.1996.10473566
  9. Lakens, D. (2013). Calculating and reporting effect sizes to facilitate cumulative science: A practical primer for t-tests and ANOVAs. Frontiers in Psychology, 4, 863. https://doi.org/10.3389/fpsyg.2013.00863
  10. Lang, T. A., & Altman, D. G. (2015). Basic statistical reporting for articles published in biomedical journals: The "Statistical Analyses and Methods in the Published Literature" or the SAMPL Guidelines. International Journal of Nursing Studies, 52(1), 5–9. https://doi.org/10.1016/j.ijnurstu.2014.09.006
  11. 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. https://doi.org/10.1016/j.jesp.2013.03.013
  12. Nagele, P. (2003). Misuse of standard error of the mean (SEM) when reporting variability of a sample. A critical evaluation of four anaesthesia journals. British Journal of Anaesthesia, 90(4), 514–516. https://doi.org/10.1093/bja/aeg087
  13. Pukelsheim, F. (1994). The three sigma rule. The American Statistician, 48(2), 88–91. https://doi.org/10.1080/00031305.1994.10476030
  14. Reed, G. F., Lynn, F., & Meade, B. D. (2002). Use of coefficient of variation in assessing variability of quantitative assays. Clinical and Diagnostic Laboratory Immunology, 9(6), 1235–1239. https://doi.org/10.1128/CDLI.9.6.1235-1239.2002
  15. Rousseeuw, P. J., & Croux, C. (1993). Alternatives to the median absolute deviation. Journal of the American Statistical Association, 88(424), 1273–1283. https://doi.org/10.1080/01621459.1993.10476408
  16. Sheppard, W. F. (1897). On the calculation of the most probable values of frequency-constants, for data arranged according to equidistant division of a scale. Proceedings of the London Mathematical Society, s1-29(1), 353–380. https://doi.org/10.1112/plms/s1-29.1.353
  17. Sullivan, G. M., & Artino, A. R. (2013). Analyzing and interpreting data from Likert-type scales. Journal of Graduate Medical Education, 5(4), 541–542. https://doi.org/10.4300/JGME-5-4-18
  18. Wan, X., Wang, W., Liu, J., & Tong, T. (2014). Estimating the sample mean and standard deviation from the sample size, median, range and/or interquartile range. BMC Medical Research Methodology, 14, 135. https://doi.org/10.1186/1471-2288-14-135
  19. Weissgerber, T. L., Milic, N. M., Winham, S. J., & Garovic, V. D. (2015). Beyond bar and line graphs: Time for a new data presentation paradigm. PLoS Biology, 13(4), e1002128. https://doi.org/10.1371/journal.pbio.1002128
  20. Welford, B. P. (1962). Note on a method for calculating corrected sums of squares and products. Technometrics, 4(3), 419–420. https://doi.org/10.1080/00401706.1962.10490022
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Statistical Models

Important Plots & Charts

Calculators and Converters