Skip to content
PercentPoint

Standard Deviation Calculator

Paste your data to get the sample or population standard deviation, the variance and every intermediate figure, including the sum of squared deviations, so you can check a homework answer line by line.

For planning only. Your school, syllabus or accountant has the final word. First published · Last reviewed by PercentPoint.

How to use the standard deviation calculator

  1. Enter the data. Separate values with commas, spaces or new lines, or paste a spreadsheet column.
  2. Choose sample or population. Pick sample if your numbers are a subset drawn from a bigger group you want to describe, which is the usual case in homework and research. Pick population if you have every member of the group, such as all the scores in your own class.
  3. Read the results. Next to the standard deviation you get the variance, the mean, the sum of squared deviations, the other kind of standard deviation for comparison, the median and quartiles, and how many values fall within one standard deviation of the mean.

The formulas, step by step

sample: s = √[ Σ(x − x̄)² ÷ (n − 1) ]
population: σ = √[ Σ(x − μ)² ÷ N ]

In words: find the mean, subtract it from each value, square each difference, add the squares, divide, and take the square root. The open textbook Introductory Statistics 2e from OpenStax (section 2.7) gives both formulas and the reason for the n − 1.

A small worked example, using 2, 4, 4, 4, 5, 5, 7 and 9:

  1. Mean: 40 ÷ 8 = 5.
  2. Deviations: −3, −1, −1, −1, 0, 0, 2, 4.
  3. Squares: 9, 1, 1, 1, 0, 0, 4, 16. Their sum is 32.
  4. Population variance: 32 ÷ 8 = 4, so σ = 2.
  5. Sample variance: 32 ÷ 7 = 4.571, so s = 2.138.

The variance is in squared units (dollars squared, points squared), which is hard to interpret. The square root brings the standard deviation back to the original units.

Sample or population: why n − 1?

A sample’s values sit closer to the sample’s own mean than to the true mean of the whole population, so dividing by n would understate the spread. Dividing by one less than the sample size corrects for that. The difference is large for small samples and shrinks as n grows: with 8 values, s is about 7% larger than σ; with 100 values, about 0.5%.

Spreadsheets have a separate function for each. Microsoft Excel’s STDEV.S estimates the standard deviation from a sample, and STDEV.P treats the data as the entire population. If your answer differs from a classmate’s by a small amount, check which one each of you used.

If you are unsure, use the sample version. In practice the data in front of you is usually a sample of something larger: some of the days, some of the customers, some of the parts off a production line.

Checking against the textbook

Two OpenStax examples make good tests, and the calculator matches both.

Example 2.32, ages of fifth graders. Twenty ages from 9 to 11.5 years have a mean of 10.525 and a sample variance of 0.5125. The sample standard deviation is √0.5125 = 0.715891, which the book rounds to 0.72.

Example 2.33, exam scores. Thirty-one scores from 33 to 100 have a sample mean of 73.5, a sample standard deviation of 17.9, a median of 73, a first quartile of 61 and a third quartile of 90. The calculator’s quartiles use the same median-of-halves method as the book. Other software may interpolate between values and give slightly different quartiles.

What the number tells you

The standard deviation is the typical distance of a value from the mean. A small one means the data is bunched up; a large one means it is spread out. Two classes can both average 75 on a test, but if one has a standard deviation of 5 and the other 15, the second class has many more very high and very low scores.

For data with a roughly bell-shaped distribution, the empirical rule from OpenStax section 6.1 applies: about 68% of values lie within one standard deviation of the mean, about 95% within two, and about 99.7% within three. The “within 1 SD” line lets you see how closely your own data follows that. In the small example above, 6 of the 8 values (75%) fall between 2.862 and 7.138.

To say how unusual a single value is, convert it to a z-score: its distance from the mean in standard deviations. The z-score calculator does that and adds the percentile.

Comparing spread between data sets with very different means, such as the weights of mice and of elephants, is easier with the coefficient of variation, the standard deviation divided by the mean. Divide the two results shown here to get it.

Limits and common slips

  • A single value has a population standard deviation of 0 and no sample standard deviation, since n − 1 = 0.
  • The standard deviation is sensitive to outliers because deviations are squared. One typo, such as 700 instead of 70, can multiply it several times over. Check the sorted range first.
  • Forgetting to square the deviations, or taking the square root before dividing, are the two most common hand-calculation errors. The intermediate sum of squares shown here helps you find which step went wrong.
  • Rounding the mean early introduces error. The calculator carries full precision until the end.

Data in a frequency table

If your data comes as values with counts, such as “score 7 appears 4 times,” the formula becomes Σf(x − x̄)² ÷ (n − 1), where f is each value’s frequency and n is the total count. OpenStax gives this version alongside the basic one. To use this calculator, enter each value as many times as it occurs: 7 7 7 7 for a frequency of 4. The result is identical.

Standard deviation versus standard error

The standard deviation describes how spread out the individual values are. The standard error of the mean describes how precisely the sample mean estimates the population mean, and it shrinks as the sample grows:

standard error = s ÷ √n

For the twenty fifth graders in OpenStax Example 2.32, s = 0.716 years, so the standard error is 0.716 ÷ √20 = 0.16 years. Ages vary by about 0.7 years from child to child, but the class average is pinned down to within a fraction of that. Reports often show results as mean ± SD or mean ± SE, so check which one a figure uses before comparing.

Sources & assumptions

How this calculator gets its numbers. Full method: our methodology.

  • Sample: s = √(Σ(x − x̄)² ÷ (n − 1)). Population: σ = √(Σ(x − μ)² ÷ N).
  • Quartiles use the median-of-halves method, as in OpenStax; spreadsheets that interpolate may differ slightly.
  • Full precision is carried through; results are rounded for display.

Sources

  1. OpenStax (Rice University), Introductory Statistics 2e, 2.7 Measures of the Spread of the Data. Sample (n − 1) and population (N) standard deviation formulas; Example 2.32 (mean 10.525, s² = 0.5125, s = 0.715891) and Example 2.33 (mean 73.5, s = 17.9, median 73, Q1 61, Q3 90).
  2. OpenStax (Rice University), Introductory Statistics 2e, 6.1 The Standard Normal Distribution. z = (x − μ) ÷ σ with N(5, 6): x = 17 gives z = 2 and x = 1 gives z = −0.67; N(5, 2): x = 10 gives z = 2.5; and the empirical rule (about 68%, 95% and 99.7% within 1, 2 and 3 standard deviations).
  3. Microsoft Support, STDEV.S function. STDEV.S estimates standard deviation based on a sample.
  4. Microsoft Support, STDEV.P function. STDEV.P calculates standard deviation based on the entire population.

Last reviewed . The empirical rule applies to roughly bell-shaped data, not to every data set.

Frequently asked questions

How do you calculate standard deviation?

Find the mean, subtract it from each value and square the results, add the squares, divide by n − 1 for a sample or n for a population, and take the square root.

What is the difference between sample and population standard deviation?

The sample version divides the sum of squared deviations by n − 1, the population version by n. The sample version is a little larger and is used when your data is a subset of a larger group.

What is the relationship between variance and standard deviation?

The standard deviation is the square root of the variance. A variance of 4 means a standard deviation of 2.

What is a good or high standard deviation?

It depends on the scale of the data. Compare it with the mean: a standard deviation of 5 is small for scores averaging 500 and large for scores averaging 10. The ratio of the two, the coefficient of variation, puts them on a common scale.

Which Excel function should I use?

Use STDEV.S for a sample and STDEV.P for a whole population. They match the sample and population options in this calculator.

Can the standard deviation be negative?

No. It is the square root of an average of squares, so it is zero or positive. It is zero only when every value is the same.