Standard deviation calculator

Paste a list of numbers, straight from a spreadsheet if you like, and get the standard deviation with each step, plus the mean, median, mode, quartiles and more. There is a weighted average tab too.

How standard deviation is calculated

Standard deviation measures how spread out numbers are around their mean. A small value means most numbers sit close to the average; a large one means they are scattered. The calculation has five steps, and the calculator shows each of them with your numbers:

  1. Find the mean: add the values and divide by how many there are (n).
  2. Subtract the mean from each value (the deviation).
  3. Square each deviation, so negatives do not cancel positives, and add them up (the sum of squares).
  4. Divide the sum of squares by n for a population, or by n − 1 for a sample. That is the variance.
  5. Take the square root of the variance. That is the standard deviation, in the same units as your data.

sample s = √( Σ(x − x̄)² ÷ (n − 1) )  ·  population σ = √( Σ(x − μ)² ÷ n )

Sample or population?

Use population when your list is every member of the group you care about: the marks of every student in one class, when you only want to describe that class. Use sample when your list is part of a bigger group and you want to estimate the spread of the whole group: 50 customers surveyed out of thousands. A sample's own mean sits a little closer to its values than the true mean does, so dividing by n would understate the spread; dividing by n − 1 (Bessel's correction) makes up for that. If you are unsure, homework and research almost always want the sample version, and spreadsheets' STDEV.S (sample) and STDEV.P (population) match the two options.

Worked example

Eight test scores: 72, 85, 90, 64, 85, 78, 94, 80.

  • Sum = 648, so the mean = 648 ÷ 8 = 81.
  • Deviations from 81: −9, 4, 9, −17, 4, −3, 13, −1. Squares: 81, 16, 81, 289, 16, 9, 169, 1. Sum of squares = 662.
  • Sample variance = 662 ÷ 7 = 94.57, so the sample standard deviation s ≈ 9.72.
  • Population variance = 662 ÷ 8 = 82.75, so the population standard deviation σ ≈ 9.10.
  • Sorted: 64, 72, 78, 80, 85, 85, 90, 94. Median = (80 + 85) ÷ 2 = 82.5; mode = 85; range = 94 − 64 = 30.
  • Quartiles: Q1 is the median of the lower half (64, 72, 78, 80) = 75, Q3 the median of the upper half (85, 85, 90, 94) = 87.5, so the IQR = 12.5.
  • The 94 has a z-score of (94 − 81) ÷ 9.72 ≈ 1.34: it is 1.34 sample standard deviations above the mean.

The other numbers

  • Median: the middle value when sorted (the average of the two middle values when n is even). Unlike the mean, it is not pulled by a few extreme values.
  • Mode: the most frequent value. There can be several, or none if no value repeats.
  • Quartiles and IQR: Q1 and Q3 are the medians of the lower and upper halves (leaving out the middle value when n is odd). This is the method most school textbooks and many calculators use; spreadsheets' QUARTILE functions interpolate and can give slightly different numbers.
  • Standard error of the mean: s ÷ √n, how much the mean of a sample this size would typically vary from sample to sample.
  • z-score: (x − mean) ÷ standard deviation, how many standard deviations a value is from the mean, using the type you chose.
  • Possible outliers: values more than 1.5 × IQR below Q1 or above Q3 (Tukey's rule of thumb).

For course grades with weighted categories, the grade calculator handles weights, dropped scores and what you need on the final.

FAQ

What is the difference between sample and population standard deviation?

The population version divides the sum of squares by n and describes exactly the numbers you have. The sample version divides by n − 1 and estimates the spread of the larger group your numbers came from. For the example scores they are 9.10 and 9.72.

Can I paste a column from Excel or Google Sheets?

Yes. Copy the cells and paste them into the box; each cell lands on its own line. Remove any header text first, and make sure numbers have no thousands separators.

How do I enter a frequency table?

Write each value with its count after a colon: 10:3, 12:5, 15:2 means three 10s, five 12s and two 15s. The step table then shows a count column.

Why is my answer slightly different from my calculator?

Check that both use the same type (sample or population). For quartiles, methods differ between calculators and spreadsheets, so Q1 and Q3 can differ slightly even when everything else matches.

Can the standard deviation be negative?

No. It is a square root of a sum of squares, so it is 0 or more. It is 0 only when every value is the same.

Is my data saved?

No. The numbers are worked out in your browser and not stored.