Standard Deviation Calculator

Paste or type a list of numbers to find how spread out they are: the standard deviation and variance for a sample or a whole population, worked step by step.

Your results

–

Save this calculation and come back to it any time. Members only — $5 every 3 months, ad-free.

Become a member

How to use the standard deviation calculator

  1. Enter your numbers, separated by commas, spaces or line breaks. A column copied from a spreadsheet works.
  2. Choose whether the data is a sample (some of the people or items you care about) or the whole population (every one of them).
  3. Read the standard deviation, then follow the steps and the table of deviations to see where it comes from.

The standard deviation formula

Sample: s = √( Σ(x − x̄)² ÷ (n − 1) ) Population: σ = √( Σ(x − μ)² ÷ n ) Variance is the same without the square root: s² or σ²

x is each value, x̄ (or μ for a population) is the mean, n is the number of values and Σ means "add them all up". The standard deviation is the square root of the variance, which puts it back in the same units as your data: minutes, dollars, centimeters.

The only difference between the two versions is the divisor. A sample divides by n − 1 instead of n. This is Bessel's correction: a sample's values sit a little closer to their own mean than to the true population mean, so dividing by a slightly smaller number makes up for the spread the sample misses.

Worked example

The calculator starts with eight commute times in minutes: 20, 40, 30, 25, 15, 35, 45, 30.

  1. Count: n = 8
  2. Mean: (20 + 40 + 30 + 25 + 15 + 35 + 45 + 30) ÷ 8 = 240 ÷ 8 = 30
  3. Deviations from the mean: −10, 10, 0, −5, −15, 5, 15, 0
  4. Squares: 100, 100, 0, 25, 225, 25, 225, 0, which add up to 700
  5. Sample variance: 700 ÷ (8 − 1) = 100
  6. Sample standard deviation: √100 = 10 minutes

If those eight trips were every trip you care about (the population), divide by 8 instead: 700 ÷ 8 = 87.5, and √87.5 = 9.35414 minutes.

Sample or population?

Your data Use
Survey answers from 500 of a city's residents Sample
A batch of parts you measured to judge the whole production run Sample
Test scores of every student in your class, to describe that class Population
Monthly sales for each month of last year, to describe last year Population

When in doubt, use the sample version. Most data is a sample of something bigger, and for large lists the two results are almost the same: with 1,000 values they differ by only 0.05%.

Reading the result

In data that is roughly bell-shaped, about 68% of values fall within one standard deviation of the mean and about 95% within two. For the commute example, most trips take between 20 and 40 minutes, and a 60-minute trip would be unusual. To turn a single value into a distance from the mean in standard deviations, use the z-score calculator. The statistics calculator adds the median, quartiles and outliers.

Frequently asked questions

Why divide by n − 1 for a sample?

Because the sample mean is calculated from the same values, the deviations from it come out slightly too small on average. Dividing by n − 1 instead of n corrects that bias in the variance. The difference matters most for small samples: with 5 values it changes the variance by 25%.

Can the standard deviation be negative?

No. It is the square root of an average of squares, so the smallest it can be is 0, which happens only when every value is the same. A larger number means the values are more spread out.

What is the difference between variance and standard deviation?

Variance is the average squared distance from the mean, so its units are squared (minutes², dollars²). The standard deviation is its square root, back in the original units, which makes it easier to interpret. Both describe the same spread.

How many numbers can I enter?

Up to 100,000. The table shows the first 200 deviations, but every value is included in the totals. Anything that isn't a number, such as a word or a blank cell, is skipped and the calculator tells you how many entries it ignored.

Related calculators

  • Statistics Calculator — Descriptive statistics for a list: mean, median, mode, quartiles, IQR, outliers, variance, SD and skewness.
  • Mean, Median, Mode & Range Calculator — The mean, median, mode and range of a list of numbers, with the sorted list and each step explained.
  • Z-Score Calculator — The z-score and percentile of a value, the probability between two values, and the value at any percentile.
  • Confidence Interval Calculator — Confidence interval and margin of error for a mean (t or z) or a proportion, at any confidence level.

Results are calculated in your browser. Double-check anything important before you rely on it. See our disclaimer.