Math & School

Standard Deviation Calculator — Sample & Population (n−1 vs n)

Measure how spread out your data is, the way your stats class and spreadsheet do it

Standard deviation is the number that tells you how spread out a set of values is around its average. A small standard deviation means the numbers cluster tightly near the mean; a large one means they're scattered widely. It's the backbone of statistics class, lab reports, quality control, finance (volatility), grading curves and any A/B test — and it's the single stat people most often compute the wrong way.

The steps are always the same. First find the mean (add the values, divide by the count). Then subtract the mean from each value and square the result — squaring keeps everything positive and punishes big gaps. Add up those squared differences to get the sum of squares. Divide by the denominator to get the variance, and finally take the square root to get the standard deviation, which lands back in the original units.

The one decision that changes your answer is the denominator. Population standard deviation (σ) divides the sum of squares by n — use it when your data is the entire group you care about. Sample standard deviation (s) divides by n − 1 — use it when your numbers are a sample drawn from a larger population you're trying to estimate. That "minus one" is called Bessel's correction, and it nudges the estimate up slightly because a sample tends to underestimate the true spread.

Here's a worked example with the data 2, 4, 4, 4, 5, 5, 7, 9. The count is 8 and the sum is 40, so the mean = 40 ÷ 8 = 5. The squared deviations are 9, 1, 1, 1, 0, 0, 4, 16, which add to 32. For the population: variance = 32 ÷ 8 = 4, so σ = √4 = 2.0. For a sample: variance = 32 ÷ 7 ≈ 4.571, so s = √4.571 ≈ 2.14. Same data, two valid answers — the only difference is whether you divided by 8 or by 7.

The most common mistake is picking the wrong denominator. Spreadsheets make it easy to slip up: STDEV / STDEV.S use n − 1 (sample), while STDEVP / STDEV.P use n (population). If your homework says "sample," choose the sample mode here; if it says the whole population, choose population. This calculator does both at once so you can see the difference, and it shows the count, sum, mean, variance and the formula so you can check every step by hand.

Medium ⏱ 5 min Updated: 2026-06-19 ✍️ By Jeferson Bruno
📖 See also: Federal Income Tax Brackets 2025: How Much Will You Owe?

Calculator

Fill in the fields and click "Calculate" for instant results.

Separate values with commas, spaces or new lines.
Result
Waiting for calculation
Fill in the fields and click "Calculate".
Transparency: below the form you'll find an explanation, formula, examples, tips, and FAQ (when available for this calculator).

📰 Formula

• Mean: x̄ = (Σx) / n
• Sum of squares: SS = Σ(x − x̄)²
• Sample variance: s² = SS / (n − 1)
• Sample std dev: s = √[ SS / (n − 1) ]
• Population variance: σ² = SS / n
• Population std dev: σ = √[ SS / n ]

📰 Formula

• Mean: x̄ = (Σx) / n
• Sum of squares: SS = Σ(x − x̄)²
• Sample variance: s² = SS / (n − 1)
• Sample std dev: s = √[ SS / (n − 1) ]
• Population variance: σ² = SS / n
• Population std dev: σ = √[ SS / n ]

🧪 Worked examples

1

Example 1

2

Example 2

3

Example 3

4

Example 4

⚠️ Common mistakes

  • Using n (population) when the problem asks for a sample, or vice versa.
  • Forgetting to square the deviations, or squaring after summing instead of before.
  • Taking the square root of the sum of squares instead of the variance.
  • Leaving in blank cells, units or stray text so a value parses as zero.

💡 Tips

  • If your numbers are a sample of a bigger group, use sample (n − 1); if they're the whole group, use population (n).
  • Variance is in squared units; standard deviation puts you back in the original units — report the standard deviation.
  • In Excel/Sheets, STDEV.S = sample (n − 1) and STDEV.P = population (n) — match the mode here to the function you used.

Embed this calculator on your site

Copy the code below and paste it into the HTML of your site or blog.

<iframe src="https://www.calcnimbus.com/embed/standard-deviation-calculator" width="100%" height="500" frameborder="0" style="border:1px solid #eee;border-radius:12px"></iframe>

❓ Frequently asked questions

What is standard deviation in plain English?

It's the average distance of your numbers from their mean. A small value means the data is bunched close to the average; a large value means it's spread out.

What's the difference between sample and population standard deviation?

Population divides the sum of squared deviations by n; sample divides by n − 1. Use sample when your data is a subset you're using to estimate a larger group, and population when you have every value in the group.

Why does the sample formula divide by n − 1 instead of n?

It's Bessel's correction. A sample tends to underestimate the true spread, so dividing by n − 1 makes the sample standard deviation a less biased estimate of the population's. The smaller denominator gives a slightly larger answer.

Which one should I use for my homework?

Read the wording. "Sample standard deviation" or "a sample of..." means n − 1. "Population standard deviation" or "all the data" means n. When in doubt in intro stats, sample (n − 1) is the more common default.

How is standard deviation related to variance?

Standard deviation is just the square root of the variance. Variance is in squared units (like dollars²), which is hard to interpret, so taking the square root returns you to the original units.

Does Excel use sample or population standard deviation?

Both are available. STDEV and STDEV.S use n − 1 (sample); STDEVP and STDEV.P use n (population). If your spreadsheet answer doesn't match, check which function you typed.

Can standard deviation be zero or negative?

It can be zero — that happens when every value is identical, so there's no spread. It can never be negative, because it comes from squared differences and a square root.

How do I enter my numbers?

Paste or type them separated by commas, spaces or new lines — for example 5, 7, 3, 9 or 5 7 3 9. The calculator strips out symbols and parses each value, so a stray $ or % won't break it.

What's a 'good' standard deviation?

There's no universal good or bad — it depends on context. Compare it to the mean (the coefficient of variation, s ÷ mean) or to another data set. Lower means more consistent; higher means more variable.