Standard Deviation Calculator
σ and s with the full working — for lists, frequency tables and class intervals.
Standard deviation
This is the last answer worked out. Fix the data above to update it.
Steps
Table
About the Standard Deviation Calculator
Type or paste your numbers to get the sample standard deviation (s, dividing by n − 1) and the population standard deviation (σ, dividing by n) with every step worked out: the mean, a table of the deviations x − x̄ and their squares (x − x̄)², the sum of squares, the variance and its square root. The same result gives the coefficient of variation, the mean absolute deviation, the standard error of the mean and the z-score of every value.
The data can be a plain list, a frequency table (each value with how often it occurs) or grouped data in class intervals such as 30–40, 40–50, worked from the class marks by the direct method or by the step-deviation (shortcut) method of school textbooks. Sums are kept as exact fractions, so a variance of 32/7 is shown exactly and the square root is rounded only once, at the end.
How to use it
- Choose List of values, Frequency table or Grouped data.
- Type or paste the data. A list: numbers separated by commas, spaces or new lines (a column copied from a spreadsheet works). A frequency table: each value and its frequency on one line (
4 3), or the values on one line and the frequencies on the next. Grouped data: each class and its frequency on one line (30-40 3). - Choose Sample when the data are a sample from a larger group — the usual case — or Population when they are the whole group. Both answers are shown either way; the choice decides the headline, the CV and the z-scores.
- For grouped data, choose the direct or the step-deviation method. With step deviation you can type the assumed mean A and the step h your book uses, or leave them empty.
- Read the answer, the steps and the table. Copy the result or the working, or download the table as a CSV file.
Examples
2, 4, 4, 4, 5, 5, 7, 9
Mean 5 · Σ(x − x̄)² = 32 Population: σ² = 32 ÷ 8 = 4, σ = 2 Sample: s² = 32 ÷ 7 ≈ 4.5714, s ≈ 2.1381
x: 4 8 11 17 20 24 32 f: 3 5 9 5 4 3 1
N = 30, Σfx = 420, mean 14 Σf(x − x̄)² = 1,374 → σ² = 1,374 ÷ 30 = 45.8, σ ≈ 6.7676
30-40 3, 40-50 7, 50-60 12, 60-70 15, 70-80 8, 80-90 3, 90-100 2 (one class per line)
A = 65, h = 10: Σfu = −15, Σfu² = 105 Mean = 65 + 10 × (−15 ÷ 50) = 62 σ² = (100 ÷ 2,500) × (50 × 105 − 225) = 201, σ ≈ 14.1774
The direct method — Σf(x − x̄)² = 10,050 from the class marks 35, 45 … 95 — gives the same 201.
Common uses
- Homework and exam practice: check each line of a hand calculation, including frequency tables and grouped data.
- Lab and field measurements: the spread of repeated readings and the standard error of their mean.
- Comparing the consistency of two sets with the coefficient of variation, for example two batsmen’s scores or two machines’ fill weights.
- Finding how unusual each value is from its z-score.
The formulas
- Mean: x̄ = Σx ÷ n; with frequencies x̄ = Σfx ÷ N, where N = Σf.
- Sum of squares: SS = Σ(x − x̄)², or Σf(x − x̄)² with frequencies.
- Population variance σ² = SS ÷ N and sample variance s² = SS ÷ (n − 1); the standard deviation is the square root of the variance.
- Shortcut: σ² = Σx² ÷ n − x̄² (with frequencies Σfx² ÷ N − x̄²).
- Step deviation for grouped data: u = (x − A) ÷ h, x̄ = A + h × Σfu ÷ N and σ² = (h² ÷ N²) × [N × Σfu² − (Σfu)²].
- Coefficient of variation CV = SD ÷ x̄ × 100%; mean absolute deviation = Σ|x − x̄| ÷ n; z = (x − x̄) ÷ SD; standard error of the mean = s ÷ √n.
The variance, standard deviation and average absolute deviation are defined this way in the NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.6 Measures of Scale. The frequency-table, grouped-data and step-deviation versions are those of school textbooks such as NCERT Mathematics for Class 11 (chapter “Statistics”).
Sample or population?
Divide by n when the data are the whole group you are describing — every student in one class, every day of last month. Divide by n − 1 when they are a sample used to estimate the spread of a larger population. The deviations are measured from the sample’s own mean, which always sits closer to the data than the population mean does, so dividing by n would make the variance too small on average; n − 1 (Bessel’s correction) removes that bias from the variance.
Spreadsheets make the same split: STDEV.S and VAR.S for a sample, STDEV.P and VAR.P for a population. Textbook exercises on frequency tables and grouped data usually ask for σ, dividing by N.
Grouped data and the step-deviation method
With class intervals the original values are unknown, so each class is represented by its class mark, the mid-point: 35 for the class 30–40. The step-deviation method subtracts an assumed mean A (usually the class mark nearest the middle) and divides by the class width h, so the table holds small whole numbers u = (x − A) ÷ h; the mean and the variance are then converted back. Any A and h give the same answer — the method only makes hand calculation easier, and the calculator shows its table and steps so you can follow your book.
Inclusive classes such as 10–19, 20–29 have boundaries half-way between them (9.5–19.5, 19.5–29.5) but the same class marks (14.5, 24.5 …), so the result does not change. Because every value of a class is put at its mark, a standard deviation from grouped data is an estimate of the standard deviation of the raw data.
Reading the results
For data with a roughly bell-shaped (normal) distribution, about 68% of the values lie within one standard deviation of the mean, 95% within two and 99.7% within three. A z-score tells you how many standard deviations a value is above (+) or below (−) the mean, so values with |z| above 2 or 3 stand out.
The coefficient of variation compares the spread with the mean, which makes it useful for comparing data with very different means or in different units. It only makes sense for positive data measured from a true zero — heights, weights, times, prices — not for temperatures in °C or for data that can be negative.
Limitations
- A list can have up to 50,000 values; for more, use a frequency table. The page shows the first 1,000 rows of the table, and the CSV file has all of them.
- Commas separate values, so do not use thousands separators in the data (type 12500, not 12,500).
- Frequencies must be whole numbers. For decimal weights, such as credits or portfolio weights, use a weighted mean instead.
- Grouped data give estimates from the class marks, and open-ended classes such as “60 and above” need a limit before they can be used.
- The sample standard deviation s is not an unbiased estimate of σ — only s² is unbiased for σ² — so in small samples s tends to come out slightly below σ.
Privacy
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
What is the difference between sample and population standard deviation?
Only the divisor: the population variance divides the sum of squared deviations by n, the sample variance by n − 1. For 2, 4, 4, 4, 5, 5, 7, 9 the sum of squares is 32, so σ = √(32 ÷ 8) = 2 while s = √(32 ÷ 7) ≈ 2.1381. Use s for a sample from a larger group and σ for a complete population.
How do I calculate the standard deviation by hand?
Find the mean; subtract it from each value; square each difference; add the squares; divide by n (population) or n − 1 (sample) to get the variance; take the square root. The table and the steps on this page follow exactly those columns, so you can compare them line by line with your own working.
Why are the deviations squared?
Because the deviations x − x̄ always add up to 0 — the positive and negative ones cancel — so their plain average says nothing about the spread. Squaring makes every deviation positive (and weighs large ones more). The mean absolute deviation uses |x − x̄| instead, and the calculator shows it as well.
How do I find the standard deviation of grouped data?
Work out the class mark x of each class, then fx and the mean x̄ = Σfx ÷ N, then f(x − x̄)² for each class; σ² = Σf(x − x̄)² ÷ N. With the step-deviation method you use u = (x − A) ÷ h instead and σ² = (h² ÷ N²) × [N × Σfu² − (Σfu)²]. Choose Grouped data to see either method worked out for your table.
What does a z-score of 2 mean?
That the value is two standard deviations above the mean. If the data are roughly normally distributed, only about 2.3% of the values are higher than that; a z-score of −2 is just as far below the mean.
Which spreadsheet function matches this calculator?
STDEV.S (or the older STDEV) gives the sample standard deviation s and STDEV.P the population standard deviation σ; VAR.S and VAR.P give the variances. They work on lists of values; for a frequency table or grouped data, use this calculator or build the fx and f(x − x̄)² columns yourself.