How to Calculate Standard Deviation (Sample vs Population)

Guides · Calculator · Updated 2026

Standard deviation (SD) tells you how spread out your numbers are. A small SD means most values hug the mean; a large SD means they’re all over the place. It’s a foundational concept in statistics, used everywhere from grading curves to stock‑market volatility. But there’s a crucial choice: do you divide by n (population) or n−1 (sample)? This article walks through the 4‑step method with a concrete dataset — 2, 4, 4, 4, 5, 5, 7, 9 — and shows you how to get the right result every time.

Population vs. sample: the n vs n−1 rule

If you have data for an entire population (e.g., all 8 students in a class), use “population” mode (divide by n). If your data is just a sample from a larger group (e.g., a poll of 8 voters out of millions), use “sample” mode (divide by n−1). The n−1 adjustment, called Bessel’s correction, makes the sample SD an unbiased estimator of the population SD.

4‑step method:
  1. Find the mean (μ or x̄).
  2. Subtract the mean from each data point → deviations.
  3. Square each deviation, then sum them all.
  4. Divide by n (population) or n−1 (sample), then take the square root.

Step‑by‑step: use the SD calculator

  1. Open the Standard Deviation Calculator tool.
  2. Type or paste your numbers (commas, spaces, or newlines). The default dataset is 2,4,4,4,5,5,7,9.
  3. Select Population (σ) or Sample (s) using the radio buttons.
  4. The tool instantly displays the standard deviation (big), variance, mean, count, and sum of squared differences. A step‑by‑step breakdown is shown in the muted section, so you can follow the math.
💡 Tip: In real research, always use sample SD unless you’re absolutely certain your data represents the entire population. Most scientific studies, surveys, and business analyses use n−1 by default.

Worked example: 2,4,4,4,5,5,7,9 (population SD = 2)

Step 1: Mean = (2+4+4+4+5+5+7+9) ÷ 8 = 40 ÷ 8 = 5. Step 2: Deviations: -3, -1, -1, -1, 0, 0, 2, 4. Step 3: Squares: 9, 1, 1, 1, 0, 0, 4, 16. Sum = 32. Step 4: Population variance = 32 ÷ 8 = 4. SD = √4 = 2. If this were a sample, variance = 32 ÷ 7 ≈ 4.571, SD ≈ 2.138. Use the tool to switch between the two and see the change instantly.

Frequently Asked Questions

Why do we square the deviations instead of just taking the absolute value?

Squaring gives more weight to larger deviations and is mathematically smoother for derivative‑based calculations. The alternative (mean absolute deviation) exists but is less common.

Can I calculate SD for just two numbers?

Yes, but the result is simply half the absolute difference. With two points, SD = |x₁ − x₂|/2. The calculator handles any count ≥ 2.

What if my data has negative numbers?

The same steps apply. Squaring removes the negative sign, so SD works for any real numbers.

How does SD relate to variance?

Variance is SD². SD is more interpretable because it’s in the same units as the original data. The calculator shows both.

Is it free and private?

Yes — the tool runs entirely in your browser, free, with no sign‑up and nothing uploaded to a server.

Try the Standard Deviation Calculator
Home / Blog / Standard Deviation