Skip to main content
Viralrang
MathFree · no sign-up

Standard Deviation Calculator

Sample or population — the switch that changes the answer, made the first control.

Updated

8 numbers found. Commas, spaces or one per line all work.

These numbers are

Spread

2.138090s

Sample standard deviation of 8 values, dividing by 7.

Variance
4.571429
Mean
5
Sum of squared deviations
32
Count
8
Divided by
7
Range
7
Standard error of the mean
0.755929
Coefficient of variation
42.76%

The divisor is the whole difference between the two answers. Sample standard deviation divides the squared deviations by 8 − 1 = 7; the population form divides by 8. The sample figure is always the larger of the two, and it is the right one unless your list is genuinely every member of the group rather than a selection from it.

Spreadsheets encode the same split: STDEV.S is the sample form and STDEV.P is the population form. Reaching for the wrong one is the most common way this calculation goes wrong.

In short

Should I divide by n or n − 1 for standard deviation?

Divide by n − 1 when your numbers are a sample drawn from something larger, and by n only when they are the entire group. For 2, 4, 4, 4, 5, 5, 7, 9 the population figure is exactly 2 and the sample figure is 2.138.

Sample is the safer default: a list pasted into a calculator is almost never the whole population.

How to use the standard deviation calculator

Standard deviation answers one question: how far, typically, do these numbers sit from their own average? A small figure means the values cluster; a large one means they scatter. It is in the same units as the data, which is why it is quoted more often than variance — variance is in units squared, and square pounds mean nothing to anybody.

The calculation has four steps and no judgement in any of them. Find the mean. Subtract it from every value and square each result, which removes the signs so that being above and below the mean both count as distance. Add those squares. Divide by a count, and take the square root. Only the fourth step has a decision in it, and that decision is the whole reason this page exists.

n − 1

Divisor for a sample

Bessel's correction

n

Divisor for a population

the entire group

2.138

Sample s for the classic set

where population σ is 2

Sample and population are not two flavours of the same thing. A population is every member of the group you are describing — all fourteen people in a department, every item produced in a batch. A sample is a selection from something larger, and the numbers are being used to estimate what that larger thing looks like. Almost everything pasted into a web calculator is a sample.

The correction matters most on small sets and fades on large ones. With four values, dividing by three instead of four raises the variance by a third. With four hundred, the difference is about an eighth of one percent and nothing downstream will notice. That is why the choice feels academic on big datasets and decides the answer on small ones.

Which one your software means
STDEV.S in Excel
sample, divides by n − 1
STDEV.P in Excel
population, divides by n
STDEV and STDEVP
the older compatibility names for the same two
A scientific calculator
usually offers both, labelled s and σ
This page
sample by default, switchable

Google Sheets accepts all four spellings. Reaching for the wrong one is the most common way this calculation goes wrong, and nothing in the output will tell you it happened.

Start with the mean and the median

Standard deviation is measured around the mean, so it is worth knowing whether that mean is representative. The average page gives all three central figures together.

Open the average calculator

How much the sample and population divisors differ as the count grows, computed from the same sum of squared deviations each time.

Values (n)Sample divides bySample figure is larger by
2141.4%
3222.5%
4315.5%
5411.8%
876.9%
1095.4%
20192.6%
30291.7%
50491.0%
100990.5%
4003990.13%
Ratio is s ÷ σ, which equals the square root of n ÷ (n − 1) and depends only on the count, never on the values.

The textbook set, worked all the way through

The list 2, 4, 4, 4, 5, 5, 7, 9 appears in statistics teaching everywhere because its numbers come out clean. It sums to 40 across eight values, so the mean is exactly 5, and the squared deviations add to exactly 32. From there the two answers separate cleanly.

Population and sample, side by side
Values
2, 4, 4, 4, 5, 5, 7, 9
Mean
40 ÷ 8 = 5
Squared deviations
9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32
Population: 32 ÷ 8
variance 4, σ = 2
Sample: 32 ÷ 7
variance 4.571, s = 2.138
The gap
0.138, about 6.9 percent

Nothing about the data changed between those two lines. The only difference is the divisor, and it moves the answer by seven percent on eight values. On four values it would move it by fifteen.

One consequence worth stating plainly: the sample figure is always the larger of the two. Dividing by a smaller number gives a bigger result, every time, for any dataset. If your sample standard deviation ever comes out below the population one, the arithmetic went wrong somewhere.

What the number does not tell you

Standard deviation summarises spread and says nothing about shape. Two datasets with identical means and identical standard deviations can look completely different — one evenly scattered, the other clustered at two extremes with nothing in the middle. The single figure cannot distinguish them, and neither can variance.

Do

  • Use the sample form unless your list is genuinely everyone
  • Report the divisor alongside the figure when it matters
  • Look at the mean and median before trusting the spread
  • Use the coefficient of variation to compare across different scales

Don't

  • Say that dividing by n − 1 makes the standard deviation unbiased
  • Describe n − 1 as accounting for a missing observation
  • Compare a sample figure from one source with a population figure from another
  • Use the coefficient of variation on data that can be negative

The first two of those are subtle and both are commonly repeated. Dividing by n − 1 makes the VARIANCE an unbiased estimate; the square root of an unbiased estimate is not itself unbiased, and the standard deviation stays slightly low. Under a normal distribution the shortfall is about 2.7 percent at ten values, shrinking as the sample grows.

The formula, worked line by line

One formula with one switch in it. Everything below the switch is identical for both cases, which is why the two answers are always in fixed proportion to each other regardless of the data.

Population when the list is everyone. Sample when the list is a selection. The data cannot tell you which — only you know where it came from.
The decision no calculator can make for you

That last point is why the switch is a control rather than something detected automatically. Eight numbers are eight numbers; whether they are a whole department or eight people out of two hundred is a fact about the world, not about the list.

mean = Σx / n
sum of squares = Σ(x − mean)²
population variance = sum of squares / n
sample variance = sum of squares / (n − 1)
standard deviation = √variance
The divisor is the whole differenceFor the same eight values the squared deviations total 32. Divided by 8 the standard deviation is 2; divided by 7 it is 2.14, which is 6.9 percent larger.SAME DATA — ONE DIVISOR APARTmean 5squared deviations total 32÷ 8 population σ2÷ 7 sample s2.14BESSELsum of squares32population ÷ n2sample ÷ n − 12.14sample larger by6.9%
The same eight values divided by n and by n minus one, and the gap between them.
Why the order of the steps matters
Two-pass
find the mean, then square the deviations
Shortcut
Σx²/n − mean², algebraically identical
On 100000.1, 100000.2, 100000.3
the shortcut can go negative
Why
it subtracts two huge, nearly equal numbers
This page uses
the two-pass method

A negative variance is impossible — it is a sum of squares over a positive count — so any tool that produces one has hit catastrophic cancellation. Chan, Golub and LeVeque documented this in 1983 and recommended the corrected two-pass method whenever two passes are available.

Standard deviation against standard error

These are different measurements and the names invite confusion. Standard deviation describes how spread out the individual values are. Standard error describes how much the MEAN would jump about if you took the sample again, and it is the standard deviation divided by the square root of the count. A large sample has a small standard error and its standard deviation is unchanged.

The coefficient of variation, and when not to use it

Putting spread in proportion
Coefficient of variation
standard deviation ÷ mean, as a percentage
What it is for
comparing spread across different scales
Needs
a ratio scale with a meaningful zero
Undefined at
a mean of zero
Unstable near
a mean close to zero

A non-zero mean is not enough on its own. Temperatures in Celsius have an arbitrary zero, so a coefficient of variation computed on them is arithmetic without meaning, however clean the number looks.

Used within its limits it is genuinely useful: it lets you say that one process is more variable than another even when they are measured in different units or at wildly different sizes, which raw standard deviation cannot.

Questions people ask

Sources

Where the constants and formulas on this page come from. Each line names the figure it backs.

  1. Sample variance divides the sum of squared deviations by n − 1, and the population form divides by n.

    NIST/SEMATECH e-Handbook of Statistical Methods — Measures of ScaleNational Institute of Standards and Technology

  2. The sample standard deviation is a biased estimator of sigma even when the variance estimator is unbiased, with a normal-theory correction factor c4(n).

    NIST/SEMATECH e-Handbook — Variables Control ChartsNational Institute of Standards and Technology

  3. The computational formula for variance can suffer catastrophic cancellation, and the corrected two-pass method is recommended where two passes are possible.

    Algorithms for Computing the Sample Variance: Analysis and RecommendationsChan, Golub and LeVeque, The American Statistician

  4. STDEV.S estimates standard deviation from a sample and STDEV.P calculates it for an entire population.

    STDEV.S functionMicrosoft

How Are Loan Payments Calculated? Amortization, Explained

One level payment, front-loaded interest — the formula worked by hand, the two levers you control, and why the smaller payment is often the costlier loan.

July 23, 2026 · 13 min read

How Does Inflation Work? The Math That Shrinks Money

One growth factor, two answers — what today's money will buy later, and how many future dollars it takes to keep up.

July 23, 2026 · 13 min read

How Is Sales Tax Calculated? Rates, Rules, and the Reverse Math

The combined-rate reality, the one-multiplication forward formula, and the division that pulls the tax back out of any total.

July 23, 2026 · 13 min read