BedrockCalculator
Figures cited to primary sourcesWritten by Aapt Dubey, MBA (Marketing & Banking), ISB 3 primary sourcesLast updated

Standard Deviation Calculator: Sample and Population, with Variance

The Standard Deviation Calculator: Sample and Population, with Variance finds the sample and population standard deviation and variance of a data set, with the mean, sum of squares and standard error, worked step by step.

Quick Answer: For the data 2, 4, 4, 4, 5, 5, 7, 9 the sample standard deviation is 2.138 and the population standard deviation is 2. The mean is 5 and the squared deviations add up to 32; dividing by 7 gives the sample variance and dividing by 8 gives the population variance.

Assumptions

Computed

Preset scenarios

Standard deviation
2.1380899353
Sample standard deviation (s)
2.1380899353
Population standard deviation (σ)
2
Sample variance (s²)
4.57142857143
Population variance (σ²)
4
Mean
5
Count (n)
8
Sum of squared deviations
32
Standard error of the mean
0.755928946018
Entries skipped
None

Sample and population standard deviation of small data sets

Download CSV
Each row is this calculator run on the list in the first column. Results are shown to 12 significant figures, rounded half up.
DataMeanSample SDPopulation SDSample variance
1, 2, 3, 4, 531.581138830081.414213562372.5
2, 4, 4, 4, 5, 5, 7, 952.138089935324.57142857143
10, 20, 30, 402512.909944487411.1803398875166.666666667
1, 1, 1, 11000
0, 1057.07106781187550
1, 2, 3, 4, 5, 6, 7, 8, 9, 105.53.02765035412.872281323279.16666666667
9.98, 9.99, 10.00, 10.01, 10.02100.01581138830080.01414213562370.00025
3, 7, 7, 1996.92820323028648

This table and its CSV are free to reuse with a link to this page, CC BY 4.0.

Standard Deviation Calculator: Sample and Population, with Variance: Standard deviation 2.1380899353 (Data: 2, 4, 4, 4, 5, 5, 7, 9; The data is: A sample (divide by n - 1)).

Save or share this result

A one-page summary of this calculator's default example, drawn from the same calculation as the result above.

The infographic is free to reuse with a link to this page, CC BY 4.0.

Illustration of wooden pegs of different heights on a board, the tallest in the middle
Quick Answer: For the data 2, 4, 4, 4, 5, 5, 7, 9 the sample standard deviation is 2.138 and the population standard deviation is 2. The mean is 5 and the squared deviations add up to 32; dividing by 7 gives the sample variance and dividing by 8 gives the population variance.

What does this calculator do?

This standard deviation calculator takes a list of numbers and returns both versions of the standard deviation and the variance, labelled, along with the mean, the count, the sum of squared deviations and the standard error of the mean.

Standard deviation measures how far the values typically sit from their mean. A small one means the data is bunched together; a large one means it is spread out. Variance is the same measure before the square root is taken, so it is in squared units (square millimetres for lengths in millimetres), which is why the standard deviation is usually the figure people report.

There are two versions because there are two situations. If your numbers are every member of the group you care about, such as the scores of everyone in one class when you only care about that class, they are a population and you divide by n. If they are a sample drawn from a larger group you want to describe, you divide by n - 1. The NIST/SEMATECH e-Handbook of Statistical Methods uses n - 1 as its definition of the variance, because that is the case statisticians meet most often. The calculator shows both so you can pick the one your course, software or report uses.

Using the Standard Deviation Calculator

  1. Paste or type the data, separated by commas, spaces or new lines. Do not use commas as thousands separators.
  2. Choose whether the data is a sample or the whole population. This only sets the headline; both results appear in the cards.
  3. Read the standard deviation at the top, then the variance, mean, sum of squares and standard error below.
  4. Check Entries skipped if the count looks wrong. Anything that is not a number is listed there.

How is this calculated?

  1. Read the data. Each entry is kept as an exact decimal, so measurements like 9.98 and 10.02 carry no binary rounding into the sums.
  1. Mean. Add the values and divide by the count n.

x̄ = 1/n∑(i = 1 to n) xᵢ

  1. Sum of squared deviations. Subtract the mean from each value, square the result and add them all up. This total, often written SS, is the numerator of both variances.

SS = ∑(i = 1 to n) (xᵢ − x̄)²

  1. Variances. The population variance divides SS by n. The sample variance divides it by n - 1, which is Bessel's correction: a sample's own mean sits closer to its values than the true mean does, so dividing by n would understate the spread on average.

σ² = SS/n; s² = SS/(n − 1)

  1. Standard deviations. Each is the square root of its variance, computed to 34 significant digits.

σ = √σ²; s = √s²

  1. Standard error of the mean. The sample standard deviation divided by the square root of n. It measures how much the mean itself would vary from sample to sample, not how much the data varies.

SE = s/√n

  1. Show the results. Every figure is rounded half up to 12 significant figures for display, with trailing zeros dropped. With a single value there is no sample variance, since n - 1 is zero, and the cards say so.

Worked Example

Using the default data, 2, 4, 4, 4, 5, 5, 7, 9:

  1. n = 8 and the sum is 40, so the mean is 5.
  2. Deviations from 5: -3, -1, -1, -1, 0, 0, 2, 4. Squared: 9, 1, 1, 1, 0, 0, 4, 16. Their sum is 32.
  3. Population variance: 32 ÷ 8 = 4, so the population standard deviation is 2.
  4. Sample variance: 32 ÷ 7 = 4.57142857143, and its square root is 2.1380899353.
  5. Standard error of the mean: 2.1380899353 ÷ √8 = 0.755928946018.

The Ten test scores preset (72, 85, 90, 66, 78, 88, 95, 70, 81, 75) has a mean of 80 and a sum of squares of 804. Its sample standard deviation is 9.45163125251 and its population standard deviation is 8.96660470858. The gap between the two shrinks as n grows, because n and n - 1 get closer in proportion.

Should I Use Sample or Population Standard Deviation?

Use the sample version when your data is a subset and you want to say something about the larger group: a survey of 200 customers, ten test tubes from a production run, a week of daily temperatures standing in for the season.

Use the population version only when the data is the entire group and you have no interest beyond it.

When in doubt, the sample version is the safer choice, and it is what most statistics software means by "standard deviation". In spreadsheets, STDEV.S is the sample version and STDEV.P is the population version; the same split applies to VAR.S and VAR.P.

What Is the Standard Deviation of the Mean?

The phrase usually means the standard error of the mean, the card at the end of the list. It answers a different question from the standard deviation. The standard deviation describes individual values; the standard error describes how precisely the sample mean pins down the true mean.

For the Repeated measurements preset, five readings of a length in millimetres, the standard deviation is 0.0158113883008 mm and the standard error is 0.00707106781187 mm. The standard error is smaller, and it keeps shrinking as you take more readings, while the standard deviation settles near the true spread.

Standard Deviation of Small Data Sets

The reference table runs the calculator on several short lists. Notice the row 1, 1, 1, 1: identical values have no spread, so both standard deviations are zero. The row 0, 10 shows how large the gap between the two versions can be when n is only 2.

What does this calculator not account for?

  • Weighted or grouped data. Each value counts once. For a frequency table, list each value as many times as it occurs.
  • Outliers. The standard deviation squares each deviation, so one extreme value can dominate it. The calculator reports what the data gives; deciding whether a point is a mistake is up to you.
  • The shape of the distribution. Rules of thumb such as "about two thirds of values lie within one standard deviation of the mean" hold for normally distributed data, not for every data set. Nothing here tests for normality.
  • Unbiased standard deviation. Dividing by n - 1 makes the sample variance an unbiased estimate of the population variance, but its square root is still slightly biased low for small samples. The small correction factor some fields apply is not used here.
  • Hypothesis tests and intervals. For a confidence interval or a test of the mean, use the t-test calculator, which builds on these same figures.

What mistakes do people make with this?

  • Using the wrong divisor. The difference matters most for small samples. With the two values 0 and 10, the sample standard deviation is 7.07106781187 and the population one is 5.
  • Reporting the variance as if it were the standard deviation. The variance is in squared units. Take its square root before comparing it with the data.
  • Confusing the standard deviation with the standard error. Error bars labelled "SE" are much narrower than "SD" bars on the same data. Say which one you plotted.
  • Rounding the mean before computing deviations. A mean rounded to one decimal can shift every deviation and change the result. The calculator keeps the exact mean.
  • Thousands separators. 1,200 is read as two values, 1 and 200. Type 1200.

Frequently Asked Questions

How do I calculate standard deviation by hand?

Find the mean, subtract it from each value, square each difference, add the squares, divide by n - 1 for a sample or n for a population, and take the square root. The worked example above follows those steps.

What is the difference between variance and standard deviation?

Variance is the average squared deviation and standard deviation is its square root. They carry the same information, but the standard deviation is in the same units as the data, which makes it easier to read.

Why divide by n - 1?

Because the deviations are measured from the sample's own mean, which is the point that makes them as small as possible. Dividing by n - 1 instead of n corrects for that, so that on average the sample variance equals the population variance.

Can the standard deviation be negative?

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

How do I find the variance from the standard deviation?

Square it. A sample standard deviation of 2.1380899353 squares back to the sample variance, 4.57142857143.

How many values do I need?

One value gives a population standard deviation of zero and no sample standard deviation. Two values are the minimum for a sample, but estimates from very small samples are rough.

Sources

Did this calculator answer your question?

How this calculator is tested

This calculator is checked by 6 automated test cases: specific inputs whose correct result is known in advance, and rules the output must always obey. They run on every change to the site. See the testing and corrections policy.

Show the test cases
  • Default: 2, 4, 4, 4, 5, 5, 7, 9 has sample SD sqrt(32/7) and population SD 2
  • the population choice changes only the headline
  • ten test scores
  • keeps small decimal spreads exact
  • edge cases: identical values, one value, no values
  • builds the reference table from compute()

Add This Website as Preferred Source on Google

See Bedrock Calculator first in your Search results & AI Overviews