Standard deviation calculator
Paste your numbers and the standard deviation calculator shows the sample and population standard deviation with every step: for 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5, the sample standard deviation s ≈ 2.138 and the population standard deviation σ = 2. Mean, median, mode, variance, quartiles, z-scores and a box plot come with it.
Source: Section 1.3.5.1, NIST/SEMATECH e-Handbook of Statistical Methods – Measures of Location (mean, median, mode). Updated: .
How it is calculated
How the calculator works
For a data set of n values x1, …, xn the calculator uses the definitions of the NIST/SEMATECH e-Handbook of Statistical Methods, section 1.3.5.6 “Measures of Scale” (checked 2026):
- Mean: x̄ = (x1 + … + xn) / n
- Median: the middle value of the sorted list; with an even count, the average of the two middle values.
- Mode: the most frequent value. There can be several modes; if every value occurs equally often, there is no mode.
- Range: maximum − minimum.
- Sample variance: s² = Σ(x − x̄)² / (n − 1), standard deviation s = √s².
- Population variance: σ² = Σ(x − x̄)² / n, σ = √σ².
How to calculate standard deviation
- Paste your values into the data set field – separated by commas, spaces, semicolons or new lines; a spreadsheet column works too.
- Choose whether your values are a sample (divide by n − 1) or the whole population (divide by n) – both results are listed.
- Read mean, median, mode, variance, standard deviation and quartiles with the full working and the step-by-step table.
Worked example by hand
Data: 2, 4, 4, 4, 5, 5, 7, 9 (n = 8).
- Sum: 2 + 4 + 4 + 4 + 5 + 5 + 7 + 9 = 40.
- Mean: 40 / 8 = 5.
- Subtract the mean from each value and square the result (table below).
- Sum of squares: 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32.
- Population: σ² = 32 / 8 = 4, so σ = √4 = 2.
- Sample: s² = 32 / 7 ≈ 4.5714, so s = √4.5714 ≈ 2.1381.
| i | x | x − x̄ | (x − x̄)² | z = (x − x̄) / s |
|---|---|---|---|---|
| 1 | 2 | −3 | 9 | −1.4031 |
| 2 | 4 | −1 | 1 | −0.4677 |
| 3 | 4 | −1 | 1 | −0.4677 |
| 4 | 4 | −1 | 1 | −0.4677 |
| 5 | 5 | 0 | 0 | 0 |
| 6 | 5 | 0 | 0 | 0 |
| 7 | 7 | 2 | 4 | 0.9354 |
| 8 | 9 | 4 | 16 | 1.8708 |
| Σ | 40 | 0 | 32 |
The column x − x̄ always adds up to 0 – a quick check that the mean is right. Sorted, the two middle values are 4 and 5, so the median is 4.5; the mode is 4 (three times); the range is 9 − 2 = 7.
Sample or population?
If your numbers are the whole group you care about (e.g. the scores of every student in one class), divide by n. If they are a sample used to draw conclusions about a larger group (e.g. 50 surveyed customers), divide by n − 1 (Bessel’s correction). In Excel and Google Sheets these are STDEV.S and STDEV.P; on a TI-84, 1-Var Stats lists Sx (sample) and σx (population).
Common mistakes
- Wrong divisor: dividing by n for a sample understates the spread – 2 instead of 2.1381 in the example; the gap is largest for small n.
- Forgetting the square root: 4.5714 is the variance, not the standard deviation; the variance is in squared units.
- Squaring before subtracting: Σx² / n − x̄² for large numbers with a small spread loses digits to rounding; the calculator uses a numerically stable two-pass method and reproduces NIST’s certified reference data.
- Thousands separators: commas separate values here, so 1,500 is read as 1 and 500 – write 1500.
- Rounding the mean too early: with a mean of 5.333… rounded to 5.3, every deviation and the final result shift.
Quartiles
Q1 and Q3 use linear interpolation (Excel QUARTILE.INC, the R default): Q1 = 4, Q3 = 5.5, interquartile range 1.5 in the example. Textbooks and the TI-84 sometimes use other methods, so quartiles can differ slightly; the quartile calculator compares four methods.
Frequency table, z-score, coefficient of variation and box plot
If your data comes as a frequency table, change “Input type” and write a value and its frequency on each line: the lines “2 1”, “4 3”, “5 2”, “7 1”, “9 1” are the same eight values as in the example above and again give x̄ = 5 and s ≈ 2.1381. The step-by-step table then shows the columns f · x and f · (x − x̄)².
The z-score tells you how many standard deviations a value lies from the mean: z = (x − x̄) / s. For x = 9 in the example: (9 − 5) / 2.1381 ≈ 1.8708. The coefficient of variation relates the spread to the mean: 2.1381 / 5 ≈ 42.76%. The standard error is s / √n = 2.1381 / √8 ≈ 0.7559.
The box plot draws Q1, the median and Q3 as a box. Values more than 1.5 times the interquartile range below Q1 or above Q3 count as outliers (Tukey’s rule) – in the example everything outside 1.75 to 7.75, i.e. the 9.
Single measures in more depth: standard error, coefficient of variation and mean, median and mode. To see the shape of larger data sets, use the histogram maker.
Frequently asked questions
Should I use the sample or the population standard deviation?
Use the sample formula (divide by n − 1) unless your data contain every member of the group. Measurements and surveys are almost always samples; the scores of every student in one class are a population, so divide by n.
How do you calculate standard deviation by hand?
Find the mean, subtract it from each value, square the differences, add them up, divide by n − 1 (sample) or n (population) and take the square root. For 2, 4, 4, 4, 5, 5, 7, 9 that is √(32 / 7) ≈ 2.1381.
How do I calculate standard deviation in Excel or Google Sheets?
Use =STDEV.S(A1:A8) for a sample and =STDEV.P(A1:A8) for a population. The older functions STDEV and STDEVP give the same results; VAR.S and VAR.P return the variance.
How do I find standard deviation on a TI-84?
Enter the data in L1 with STAT → EDIT, then run STAT → CALC → 1-Var Stats. Sx is the sample standard deviation and σx the population standard deviation.
What is a good standard deviation?
There is no universal good value – it depends on the unit and the mean. Compare the spread to the mean with the coefficient of variation: 2.1381 / 5 ≈ 43% in the example is a wide spread, while a few percent counts as tight for most measurements.
What is the difference between variance and standard deviation?
The standard deviation is the square root of the variance. It has the same unit as the data (e.g. cm), whereas the variance is in squared units (cm²), so the standard deviation is easier to interpret.
Mean or median – which is better?
The median, when the data are skewed or contain outliers: for 1, 2, 3, 4, 100 the mean is 22 but the median is 3. For roughly symmetric data both are close and the mean is the usual choice.
Why are my quartiles different from my textbook or TI-84?
Because there are several common definitions of quartiles. This calculator uses linear interpolation like Excel QUARTILE.INC. Mean, median, variance and standard deviation are uniquely defined and will match.
Sources and legal basis
- Section 1.3.5.1: NIST/SEMATECH e-Handbook of Statistical Methods – Measures of Location (mean, median, mode)
- Section 1.3.5.6: NIST/SEMATECH e-Handbook of Statistical Methods – Measures of Scale (variance, standard deviation, range)
- Section 7.2.6.2: NIST/SEMATECH e-Handbook – Percentiles and quartiles
- NIST Statistical Reference Datasets – certified values for mean and standard deviation
As of: · Editorial policy
Related tools
- Standard Error CalculatorStandard error calculator for raw data or for standard deviation and sample size: SE = s / √n with steps, mean and variance shown for every result.
- Coefficient of Variation CalculatorCoefficient of variation calculator for a list of numbers: CV = s / mean as a percentage, for a sample or a population, with the working shown step by step.
- Quartile CalculatorQuartile calculator: enter your numbers to get Q1, median, Q3, the interquartile range and outliers, with four methods and the full working shown.
- Average CalculatorAverage calculator: mean, median, mode and weighted average of your numbers with working and frequency table – plus the value needed for a target average.
- Histogram MakerHistogram maker for your numbers: automatic bins (Sturges, Freedman-Diaconis), a frequency distribution table, summary statistics and PNG or SVG download.
- GPA & Weighted Grade CalculatorGPA calculator: enter letter grades and credits for semester and cumulative GPA, weighted for Honors, AP and IB, plus the GPA you need to hit your target.
- Online CalculatorCalculator online, free and instant: type or tap and see the answer as you go – order of operations, brackets, percent, square root, steps and a history list.
- Stem and Leaf Plot GeneratorStem and leaf plot generator: enter your numbers and get stems and leaves sorted automatically, with a key, split stems and the median.
- ANOVA CalculatorANOVA calculator for one-way analysis of variance: F value, p-value, ANOVA table, group means and effect size eta squared, with the steps and an interpretation.