How to Calculate Standard Deviation (Step-by-Step Guide)

Learn how to calculate standard deviation step by step, the difference between sample and population formulas, and when to use each — with a worked example.

What Is Standard Deviation?

Standard deviation measures how spread out a set of numbers is from its average. To calculate it: find the mean, subtract the mean from each number and square the differences, average those squared differences (the variance), then take the square root. A low standard deviation means values cluster tightly around the mean; a high standard deviation means they’re spread out widely. You can skip the arithmetic entirely with the standard deviation calculator, which shows sample and population results plus every intermediate step.

The Formula, Step by Step

Standard deviation has two versions — population and sample — and the only difference is what you divide by at the end.

StepPopulation (σ)Sample (s)
1. Find the meanx̄ = Σx ÷ Nx̄ = Σx ÷ n
2. Subtract mean from each value, square it(x − x̄)²(x − x̄)²
3. Sum the squared differencesΣ(x − x̄)²Σ(x − x̄)²
4. Divide (this is the variance)÷ N÷ (n − 1)
5. Take the square root√variance = σ√variance = s

The only real difference is step 4: population divides by N (the full group size), sample divides by n − 1. That “minus 1” is called Bessel’s correction — it corrects for the fact that a sample’s own mean is an estimate, which otherwise makes the sample look slightly less variable than the true population.

Worked Example

Take the data set 2, 4, 4, 4, 5, 5, 7, 9 (8 values):

  1. Mean: (2+4+4+4+5+5+7+9) ÷ 8 = 40 ÷ 8 = 5
  2. Squared differences: (2−5)²=9, (4−5)²=1 (×3), (5−5)²=0 (×2), (7−5)²=4, (9−5)²=16
  3. Sum of squared differences: 9+1+1+1+0+0+4+16 = 32
  4. Population variance: 32 ÷ 8 = 4 → σ = √4 = 2
  5. Sample variance: 32 ÷ 7 ≈ 4.571 → s = √4.571 ≈ 2.138

Notice the sample standard deviation (2.138) is always a bit larger than the population standard deviation (2) for the same numbers — dividing by a smaller number (n − 1 instead of N) pushes the result up slightly.

Plug the same eight numbers into the standard deviation calculator and you’ll get an identical result instantly, along with the mean, variance, and count.

Sample vs. Population: Which Do I Use?

  • Use population when your numbers are the entire group you care about — every student in one classroom, every widget in a finished batch, every month of a company’s first full year.
  • Use sample when your numbers are a subset used to estimate something larger — 200 survey respondents standing in for all customers, a handful of blood pressure readings representing a patient’s typical range, or a sample of products pulled from an assembly line.

Most everyday data analysis — surveys, test scores, quality-control spot checks — uses sample standard deviation, because you’re rarely measuring literally every member of a population.

Quick rule of thumb: if you could theoretically go collect more data points from the same group, you’re looking at a sample — use n − 1.

Standard Deviation vs. Variance vs. Average

These three statistics answer different questions, and it’s easy to mix them up:

StatisticWhat it tells youFormulaUnits
Mean (average)The center of the dataΣx ÷ nSame as your data (e.g. dollars)
VarianceAverage squared distance from the meanΣ(x − x̄)² ÷ (n or n−1)Squared units (e.g. dollars²)
Standard deviationTypical distance from the mean, in original units√varianceSame as your data (e.g. dollars)

Variance is mathematically useful (it’s used in many statistical formulas), but standard deviation is easier to interpret because it’s back in the same units as your original data. If you’re also comparing two data sets or want the mean, median, and mode alongside your spread, the average calculator handles that companion calculation.

Real-World Examples

  • Test scores: A class with a mean of 80 and a standard deviation of 3 has most students scoring 77–83. A standard deviation of 15 means scores are all over the map, from failing to near-perfect.
  • Investment returns: Standard deviation of monthly returns is one of the most common measures of volatility. A fund with 2% standard deviation is far steadier than one with 15%, even if both average the same return.
  • Manufacturing quality control: A machine cutting bolts to 10mm with a standard deviation of 0.01mm is far more consistent than one with 0.5mm — even if both average exactly 10mm.
  • Weather comparisons: Two cities can share the same average temperature but very different standard deviations — one has mild, consistent weather, the other swings between extremes.

Calculating Standard Deviation in Excel or Google Sheets

If your numbers already live in a spreadsheet, you don’t need to do the arithmetic by hand there either:

StatisticExcel / Google Sheets formula
Sample standard deviation=STDEV(A1:A10)
Population standard deviation=STDEVP(A1:A10)
Sample variance=VAR(A1:A10)
Population variance=VARP(A1:A10)
Mean=AVERAGE(A1:A10)

Both Excel and Google Sheets default to the sample functions (STDEV, VAR) unless you explicitly use the population versions (STDEVP, VARP) — a common source of mismatched numbers when comparing a spreadsheet result to a textbook example. If your spreadsheet total doesn’t match a hand calculation or the standard deviation calculator, double-check you’re using matching sample/population settings on both.

Common Mistakes to Avoid

  1. Mixing up sample and population. This is the single most common error — always confirm whether your data is the whole group or a subset before dividing.
  2. Forgetting to square the differences before summing. Adding the raw (unsquared) differences from the mean will always sum to zero — squaring is what makes the spread measurable.
  3. Confusing variance with standard deviation. Variance is in squared units and is rarely reported on its own; standard deviation (its square root) is the number people actually want.
  4. Treating a small sample as reliable. Standard deviation from 3–4 data points can be wildly unstable. The more data points you have, the more trustworthy the estimate becomes.

Frequently Asked Questions

What does a standard deviation of 0 mean? Every value in the data set is identical. There’s no spread at all around the mean.

Can standard deviation be negative? No — because it comes from squaring differences and then taking a square root, standard deviation is always zero or positive.

Should I use sample or population standard deviation for a class of test scores? If those are the only scores you care about (e.g., grading exactly that class), use population. If those students represent a larger group you’re trying to draw conclusions about (e.g., predicting how future classes will perform), use sample.

Why is my sample standard deviation always slightly bigger than the population one? Because sample standard deviation divides by n − 1 instead of N. Dividing by a smaller number produces a larger result — this is the built-in correction for estimating from a subset instead of measuring everyone.

What’s considered a “high” standard deviation? It depends entirely on context and units — there’s no fixed cutoff. Compare it to the mean (this ratio is called the coefficient of variation) or to a similar data set to judge whether it’s meaningfully high or low.

The Bottom Line

Standard deviation boils down to five steps: find the mean, square the differences from it, average those squared differences, and take the square root — dividing by N for a full population or n − 1 for a sample. Once you understand which one applies to your data, the math is mechanical. Skip the manual squaring and summing with the standard deviation calculator — paste in your numbers, pick sample or population, and get the standard deviation, variance, and mean instantly. Pair it with the average calculator for mean/median/mode or the percentage change calculator to track how a value shifts over time.

Advertisement
Advertisement