Σ
SDCalc
IntermediateConcepts·7 min

Sample vs Population Standard Deviation: n−1 vs N, Worked Example

Population SD divides by N, sample SD by n−1. The same 8 numbers give σ = 2 and s ≈ 2.138090. See how the gap shrinks as n grows, then open both modes in the calculator.

By Hommer Zhao·Published ·Updated

Sample vs Population Standard Deviation: The Short Answer

Use the sample standard deviation (s, divide by n−1) when your numbers are a subset you use to describe a larger group. Use the population standard deviation (σ, divide by N) only when your numbers are the entire group you care about. For the same list of at least two values that are not all equal, s is larger than σ by a factor of √(n ÷ (n−1)): 5.41% at n = 10 and under 2% from n = 30.

Open 8 example scores as a sample

Sample (n-1) mode: s ≈ 2.138090 for 2, 4, 4, 4, 5, 5, 7, 9. Replace them with your own numbers.

Open the same scores as a population

Population (N) mode: σ = 2 for the same eight values.

Population (N)

Use when you have data for every member of the group you're studying. σ = √[Σ(x − μ)² / N]

Sample (n-1)

Use when you have data from a subset of the larger population. s = √[Σ(x − x̄)² / (n − 1)]

Symbols: Σ = add up, x = each value, μ = population mean, x̄ = sample mean, N = number of values in the population, n = number of values in the sample. Variance is in squared units (points²); the standard deviation is back in the original units (points).

Worked Example: The Same 8 Numbers Both Ways

Eight quiz scores (out of 10)
2, 4, 4, 4, 5, 5, 7, 9

Take eight quiz scores out of 10. The arithmetic is identical up to the divisor. What changes is the question you are asking. If these are all 8 students in one tutoring group and you only want to describe that group, they are a population, and μ = x̄ = 5. If they are 8 students picked from a school of 400 and you want to estimate the spread for the whole school, they are a sample: s is an estimate of the school's unknown σ, not the school's σ itself.

Step 1–2: Find the mean and the squared deviations

Score xx − x̄(x − x̄)²
2-39
4-11
4-11
4-11
500
500
724
9416
Mean x̄ = 5Sum = 0Σ(x − x̄)² = 32

Step 3: Divide to get the variance, then take the square root

Population: σ² = 32 ÷ 8 = 4 points², σ = √4 = 2 points. Sample: s² = 32 ÷ 7 ≈ 4.571429 points², s = √(32 ÷ 7) ≈ 2.138090 points.

Computed with this site's calculator on 2026-11-02. The only difference between the two rows is the divisor, so s ÷ σ = √(8 ÷ 7) ≈ 1.0690. Each button opens the same eight scores in the calculator with that mode already selected.

Population (the whole group)Open in Population (N) mode
Divide Σ(x − x̄)² byN = 8Varianceσ² = 4Standard deviationσ = 2
Sample (part of a larger group)Open in Sample (n-1) mode
Divide Σ(x − x̄)² byn − 1 = 7Variances² ≈ 4.571429Standard deviations ≈ 2.138090

How Much Does n−1 Change the Answer?

Here σ means the population-formula result for the same list. The ratio s ÷ σ depends only on n, not on the values, so the table below holds for any list of at least two values that are not all equal. With 8 values the sample SD is 6.90% larger, which matches 2.138090 ÷ 2 above.

The gap is large for very small lists and shrinks as n grows: under 2% from n = 30, about 0.50% at n = 100 and 0.05% at n = 1,000. It never changes which formula answers your question.

n (number of values)s ÷ σSample SD is larger by
21.414241.42%
31.224722.47%
51.118011.80%
101.05415.41%
301.01711.71%
1001.00500.50%
1,0001.00050.05%

When to Use Each

Your situationUseDivide by
You have every value in the group, such as all 25 scores in one classPopulation SD (σ)N
You only want to describe the data in hand, not generalizePopulation SD (σ)N
You measured part of a larger group, such as 100 widgets from a day's 10,000Sample SD (s)n-1
You need a t-based confidence interval or t-test for a mean and σ is unknownSample SD (s)n-1

If you are unsure

Use the sample standard deviation (n-1). Most real-world data is a sample, not a complete population, and the usual t-based intervals and tests for a mean use s.

Sample vs Population SD in Excel, Google Sheets, Python, R and TI-84

Every tool offers both versions, but the defaults differ. NumPy and pandas, often used together, have opposite defaults.

ExcelSample SD (n−1)STDEV.S (older: STDEV)Population SD (N)STDEV.P (older: STDEVP)Default to watchNone: pick by name
Google SheetsSample SD (n−1)STDEV.S or STDEVPopulation SD (N)STDEV.P or STDEVPDefault to watchNone: pick by name
Python statisticsSample SD (n−1)statistics.stdev()Population SD (N)statistics.pstdev()Default to watchNone: pick by name
NumPySample SD (n−1)np.std(x, ddof=1)Population SD (N)np.std(x)Default to watchddof=0, population
pandasSample SD (n−1)Series.std()Population SD (N)Series.std(ddof=0)Default to watchddof=1, sample
RSample SD (n−1)sd(x)Population SD (N)n <- length(x); sd(x) * sqrt((n - 1) / n)Default to watchstats::sd uses n−1; no population-mode argument
TI-84 (1-Var Stats)Sample SD (n−1)SxPopulation SD (N)σxDefault to watchShows both

Checked on 2026-11-02: with Python 3.14.5, NumPy 2.4.2 and pandas 3.0.0 on the eight scores above, np.std() returned 2.0 and statistics.pstdev() returned 2.0 (population), while pandas Series.std() and statistics.stdev() returned 2.138089935… (sample), which is 2.138090 to six decimals. The Excel, Google Sheets, R and TI-84 rows follow each vendor's documentation (see Sources); R and a physical TI-84 were not run. Guides: Excel STDEV.S vs STDEV.P, Google Sheets, R sd(), Excel and Python, TI-84 Sx and σx.

Why the Sample Formula Divides by n−1 (Bessel's Correction)

Sample values sit closer to their own mean x̄ than to the unknown population mean μ, so Σ(x − x̄)² comes out systematically too small. Dividing by n−1 instead of n, known as Bessel's correction, makes the sample variance an unbiased estimate, under independent random sampling, of the population variance.

Degrees of freedom

Once you know the mean and n−1 of the values, the last value is fixed. Only n−1 deviations are free to vary, so that is the divisor. More detail: degrees of freedom explained.

The square root of the unbiased variance, s, still slightly underestimates σ on average. The correction removes the bias in the variance, not in the standard deviation. See Bessel's correction explained for the derivation.

Further Reading

Sources

References and further authoritative reading used in preparing this article.

  1. Statistical population — Wikipedia
  2. NIST/SEMATECH e-Handbook: Measures of Scale
  3. Bessel's correction — Wikipedia
  4. Microsoft Support: STDEV.S function
  5. NumPy documentation: numpy.std (ddof defaults to 0)
  6. pandas documentation: Series.std (ddof defaults to 1)
  7. R documentation: sd (denominator n − 1)
  8. Python documentation: statistics.stdev and pstdev
  9. Google Docs Editors Help: Google Sheets function list (STDEV.S, STDEV.P)
  10. Texas Instruments: Sx and σx in 1-Var Stats (TI-83/84 Plus family)

Frequently Asked Questions

What is the difference between sample and population standard deviation?

Population standard deviation (σ) describes the spread of an entire group and divides by N. Sample standard deviation (s) estimates that spread from a subset and divides by n−1. Dividing by n−1 removes the bias in the sample variance; s itself is still slightly biased, but it is the standard estimate.

When do you divide by n-1 instead of n?

Divide by n−1 when your data is a sample used to estimate the variability of a larger population—this is Bessel's correction. Divide by N only when your data already includes every member of the population you care about.

Which standard deviation should I use?

In most real analyses you have a sample, not the whole population, so the sample standard deviation (n−1) is the default. Use the population formula (N) only when the dataset is genuinely complete, such as the scores of every student in a single specific class.

How much bigger is the sample standard deviation than the population standard deviation?

For the same list of at least two values that are not all equal, s ÷ σ = √(n ÷ (n−1)). The sample value is 41.42% larger at n = 2, 5.41% larger at n = 10, 1.71% larger at n = 30 and about 0.50% larger at n = 100. The gap shrinks as n grows, but choose the formula by the question you are answering, not by n.

Does NumPy use sample or population standard deviation by default?

NumPy's np.std() uses ddof=0, which is the population formula (divide by N). Pass ddof=1 for the sample standard deviation. pandas does the opposite: Series.std() defaults to ddof=1 (sample). On the scores 2, 4, 4, 4, 5, 5, 7, 9, np.std() returns 2.0 and pandas returns 2.138089935…, which is 2.138090 to six decimals.

Why does the sample formula divide by n-1?

Dividing by n−1 instead of n makes the sample variance an unbiased estimator of the population variance under independent random sampling. Using the sample mean already 'uses up' one degree of freedom, so n−1 compensates and prevents the variance from systematically underestimating the true spread.