Free calculator

Standard Deviation Calculator

Paste your numbers to get the standard deviation, variance and mean, for a sample or a whole population, with every step of the working shown.

  • Step-by-step working
  • Sample & population
  • Matches Excel & TI-84
  • Free

Your data

8 numbers

Is your data a sample or a whole population?

Choose sample if your numbers are a subset used to estimate a larger group (most homework and research). Choose population if you have every member of the group.

Result

Matches Excel’s STDEV.S and the TI-84’s Sx. See this data as a histogram →

Step-by-step solutionShow
  1. 1

    Count the values

    = n = 8

  2. 2

    Find the mean

    x̄ = Σx ÷ n = 40 ÷ 8

    = 5

  3. 3

    Subtract the mean from each value and square the result

    xx − x̄(x − x̄)²
    2−39
    4−11
    4−11
    4−11
    500
    500
    724
    9416
  4. 4

    Add up the squared differences (sum of squares)

    SS = Σ(x − x̄)²

    = 32

  5. 5

    Divide by n − 1 to get the variance

    s² = SS ÷ (n − 1) = 32 ÷ 7

    Dividing by n − 1 (Bessel’s correction) corrects the tendency of a sample to underestimate the spread.

    = 4.571429

  6. 6

    Take the square root

    s = √4.571429

    = 2.13809

What it means

On average, the values are about 2.138 away from the mean of 5. If the data is roughly bell-shaped, about 68% of values lie between 2.862 and 7.138, and about 95% between 0.724 and 9.276.

Formula: s = √( Σ(x − x̄)² ÷ (n − 1) )

Want every statistic at once? Try the descriptive statistics calculator.

Standard deviation formulas

SamplePopulation
Standard deviations = √( Σ(x − x̄)² ÷ (n − 1) )σ = √( Σ(x − μ)² ÷ N )
Variances² = Σ(x − x̄)² ÷ (n − 1)σ² = Σ(x − μ)² ÷ N

How to calculate standard deviation by hand

Example data: 2, 4, 4, 4, 5, 5, 7, 9.

  1. Find the mean: (2 + 4 + 4 + 4 + 5 + 5 + 7 + 9) ÷ 8 = 40 ÷ 8 = 5.
  2. Subtract the mean and square: 9, 1, 1, 1, 0, 0, 4, 16.
  3. Add them up: the sum of squares is 32.
  4. Divide: by n − 1 = 7 for a sample (variance 4.571) or by N = 8 for a population (variance 4).
  5. Square root: s = √4.571 ≈ 2.138; σ = √4 = 2.

What standard deviation tells you

The standard deviation measures how far values typically sit from the mean. A small standard deviation means the data is tightly clustered; a large one means it is spread out. For roughly bell-shaped data, the 68–95–99.7 rule applies: about 68% of values lie within 1 standard deviation of the mean, 95% within 2, and 99.7% within 3.

To see how far a single value is from the mean in standard deviations, use the z-score calculator. To see the spread, draw a histogram.

Standard deviation, in one picture

Standard deviation measures how spread out values are around their mean. These two data sets have exactly the same mean, but one is tightly packed and the other is spread out, and their standard deviations show it.

A: 68, 70, 70, 71, 71s ≈ 1.25060708090B: 50, 60, 70, 80, 90s ≈ 15.85060708090
Both data sets have a mean of 70 (dashed line). Their standard deviations are very different.

How to read your result

  • It is in the same units as your data. A standard deviation of 4.2 cm means values typically sit about 4 cm from the mean.
  • Use the 68–95–99.7 rule for bell-shaped data. If test scores have a mean of 70 and a standard deviation of 5, about 68% of students scored between 65 and 75, and about 95% between 60 and 80.
  • Compare spreads with the coefficient of variation (SD ÷ mean) when the means are very different. A spread of 5 kg matters a lot for cats and very little for cars.
  • It is never negative, and it is 0 only when every value is identical.
μ − 3σμ − 2σμ − σμμ + σμ + 2σμ + 3σ68%95%99.7%
For bell-shaped data, about 68% of values are within 1 standard deviation of the mean, 95% within 2 and 99.7% within 3.

Sample or population? Quick examples

SituationUse
30 students surveyed to learn about the whole schoolSample (s, n − 1)
Weights of 50 bags tested from a day’s productionSample (s, n − 1)
Test scores of every student in your class, describing just your classPopulation (σ, N)
Monthly sales for all 12 months of last yearPopulation (σ, N)

If you’re unsure, use the sample formula. It’s the default in most courses, software and research.

Common mistakes to avoid

  • Dividing by n for a sample. This underestimates the spread. Use n − 1 unless you truly have the whole population.
  • Forgetting the square root. Σ(x − x̄)² ÷ (n − 1) is the variance. The standard deviation is its square root.
  • Rounding the mean too early. Rounding x̄ before subtracting introduces errors that add up. Keep full precision until the end.
  • Mixing up standard deviation and standard error. The SD describes the spread of the data; the standard error (s ÷ √n) describes how precisely the mean is estimated.
  • Relying on SD for skewed data. A few extreme values inflate it. For skewed data, report the median and IQR as well.

Standard deviation in Excel, Google Sheets, TI-84 and Python

SoftwareHow
Excel=STDEV.S(A2:A51) for a sample, =STDEV.P(A2:A51) for a population. Variance: VAR.S and VAR.P.
Google Sheets=STDEV(A2:A51) for a sample, =STDEVP(A2:A51) for a population.
TI-84STAT › CALC › 1-Var Stats. Sx is the sample SD; σx is the population SD.
Pythonstatistics.stdev(data) (sample) or statistics.pstdev(data); NumPy: np.std(data, ddof=1) for a sample.

Have grouped data instead of raw values? Use the grouped data calculator.

Related tools: Descriptive Statistics Calculator, Z-Score Calculator, Mean, Median & Mode Calculator, Histogram Maker and Five-Number Summary Calculator.

Frequently asked questions

Should I use the sample or population standard deviation?

Use the sample standard deviation (s, divide by n − 1) when your data is a sample used to describe a larger group. That covers most homework, surveys and experiments. Use the population standard deviation (σ, divide by N) only when your data includes every member of the group you care about.

Why divide by n − 1 for a sample?

A sample's values are, on average, closer to the sample mean than to the true population mean, so dividing by n would underestimate the spread. Dividing by n − 1 (Bessel's correction) fixes this bias in the variance.

What is the difference between variance and standard deviation?

The variance is the average squared distance from the mean; the standard deviation is its square root. The standard deviation is in the same units as the data (e.g. cm), which makes it easier to interpret.

What does a standard deviation of 0 mean?

All the values are identical: there is no spread at all.

Which Excel function matches this calculator?

STDEV.S (or STDEV) gives the sample standard deviation and STDEV.P gives the population standard deviation. On a TI-84, 1-Var Stats shows them as Sx and σx.

Related tools