Skip to content

Standard Deviation & Variance Calculator

Calculate standard deviation, variance, and statistical dispersion for your dataset

Calculator Details

Sample Standard Deviation (s, divides by n − 1):2.138089935See results ↓

Your dataset, separated by commas, spaces or new lines. With spaces between values, 1,000 is read as one thousand.

Your Results

Sample Standard Deviation (s, divides by n − 1): 2.138089935

Sample Standard Deviation (s, divides by n − 1)

2.138089935

Based on 8 data points. Population σ (divides by n): 2

  • Population Std Dev (σ, ÷ n)

    2

  • Sample Variance (s², ÷ n − 1)

    4.571428571

  • Population Variance (σ², ÷ n)

    4

Dataset Statistics

Mean (Average)

5

Average of all values

Range

7

Min: 2, Max: 9

Sum

40

Total of all values

Standard Error of the Mean

0.755928946

s ÷ √n: how precisely the sample mean estimates the true mean

Coefficient of Variation

42.76%

Sample SD ÷ mean × 100

Formula Comparison

Sample Statistics (n-1)

Variance (s²):4.571428571
Std Dev (s):2.138089935

Use when your data is a sample from a larger population. Divides by (n-1) to provide an unbiased estimate.

Population Statistics (n)

Variance (σ²):4
Std Dev (σ):2

Use when your data represents the entire population. Divides by n for the exact population parameter.

Compare scenarios

Save these inputs as a scenario, change them, and compare the results side by side.

Loading, available in a moment

How far each value is from the mean

How far each value is from the mean

Detailed Breakdown

Deviation table
#ValueDeviation (x − μ)Squared (x − μ)²
12-39
24-11
34-11
44-11
5500
6500
7724
89416
Sum of squared deviations32

How This Calculator Works

How Standard Deviation Works

Standard deviation measures how spread out the values in a dataset are from the mean (average). A low standard deviation means values are clustered close to the mean, while a high standard deviation means they are more spread out.

Your numbers, step by step

1. Mean: μ = Σx / n = 40 / 8 = 5
2. Deviation of each value from the mean: (x − μ) (see the deviation table)
3. Sum of squared deviations: Σ(x − μ)² = 32
4. Population variance: σ² = 32 / 8 = 4
5. Sample variance: s² = 32 / (8 − 1) = 4.571428571
6. Square roots: σ = √4 = 2; s = √4.571428571 = 2.138089935

Sample vs Population

Sample (s, divide by n − 1): use when your data is a subset of a larger population. Dividing by n − 1 instead of n corrects the bias of estimating the mean from the same data (Bessel's correction). Same as Excel STDEV.S and VAR.S.

Population (σ, divide by n): use when you have every member of the group you care about. Same as Excel STDEV.P and VAR.P.

Frequently Asked Questions

What does standard deviation tell me?

Standard deviation measures how spread out your data is. A low standard deviation (close to 0) means most values are near the mean. A high standard deviation means values are more dispersed. For example, test scores with SD=2 are very consistent, while SD=15 shows high variability.

When should I use sample vs population standard deviation?

Use sample standard deviation (n-1) when your data is a sample from a larger population, which is most common in practice. Use population standard deviation (n) only when you have data for the entire population you care about. For example, all test scores in a class would be population, while a survey of 100 customers from 10,000 total would be a sample.

What is variance and how does it relate to standard deviation?

Variance is the average of squared deviations from the mean. Standard deviation is simply the square root of variance, which brings it back to the same units as your original data. Variance is useful for calculations, but standard deviation is easier to interpret because it's in the same units as your data.

What is coefficient of variation and when is it useful?

Coefficient of variation (CV) is the standard deviation divided by the mean, expressed as a percentage. It measures relative variability, which is useful for comparing datasets with different scales or units. For example, you can use CV to compare the variability of heights (in cm) versus weights (in kg).

Can standard deviation be zero?

Yes, standard deviation is zero when all values in your dataset are identical. For example, [5, 5, 5, 5] has SD=0 because there is no variation. This means perfect consistency with no spread.

Why do we square the deviations?

We square the deviations for two reasons: (1) to make all values positive (otherwise positive and negative deviations would cancel out), and (2) to give more weight to larger deviations. The square root at the end brings the result back to the original units.

How many data points do I need?

You need at least 1 value for population standard deviation, but at least 2 values for sample standard deviation (because we divide by n-1, which would be zero for n=1). With one value the calculator shows the sample figures as undefined, like Excel STDEV.S, which returns #DIV/0!. More values give a more reliable estimate of the spread.

Which Excel or Google Sheets functions match these results?

Sample standard deviation is STDEV.S (or STDEV), population standard deviation is STDEV.P, sample variance is VAR.S and population variance is VAR.P. For the example 2, 4, 4, 4, 5, 5, 7, 9, STDEV.P gives 2 and STDEV.S gives about 2.1381, the same as this calculator.

Why is the sample standard deviation always larger than the population one?

Both use the same sum of squared deviations, but the sample version divides by n − 1 instead of n, so it is larger by a factor of √(n / (n − 1)). The gap shrinks as the dataset grows: with 8 values the sample figure is about 7% higher, with 100 values about 0.5% higher.

What is the standard error of the mean?

The standard error (SE) is the sample standard deviation divided by the square root of the number of values, s ÷ √n. It measures how far the sample mean is likely to be from the true mean, so it shrinks as you collect more data: for 2, 4, 4, 4, 5, 5, 7, 9 it is 2.138 ÷ √8 ≈ 0.756. About 95% of sample means fall within 1.96 standard errors of the true mean.

Shows both sample (÷ n − 1, Excel STDEV.S) and population (÷ n, Excel STDEV.P) standard deviation and variance, with exact decimal arithmetic. The coefficient of variation and the standard error of the mean (s ÷ √n) use the sample standard deviation. Not included: grouped or weighted data, confidence intervals and outlier tests.

Standard Deviation Calculator: Sample vs Population, Step by Step

By FindMySum · Last reviewed

A standard deviation calculator measures how spread out a set of numbers is around its mean. A small standard deviation means the values cluster tightly; a large one means they are scattered. It is expressed in the same unit as the data, which makes it easier to interpret than variance, its square. This calculator gives both the sample and the population versions of each, the mean, the coefficient of variation and a table showing every value's deviation. This article walks through the formulas, explains why the sample version divides by n − 1, works through the default dataset step by step, and covers what standard deviation can and can't tell you.

The formulas

Everything starts from the mean, the sum of the values divided by how many there are:

mean = Σx ÷ n

For each value, the deviation is its distance from the mean, x − mean. Deviations above and below the mean always add up to zero, so they are squared before being combined. The total is the sum of squared deviations, often written SS.

From there, the two versions differ only in what SS is divided by:

QuantityPopulation (σ)Sample (s)
Varianceσ² = SS ÷ ns² = SS ÷ (n − 1)
Standard deviationσ = √(SS ÷ n)s = √(SS ÷ (n − 1))
Spreadsheet functionVAR.P, STDEV.PVAR.S, STDEV.S

Taking the square root at the end returns the result to the original unit: if the data are in centimetres, the variance is in square centimetres and the standard deviation is back in centimetres.

Why the sample version divides by n − 1

When your data are a sample from a larger group, the true mean of that group is unknown, so the deviations are measured from the sample's own mean. The sample mean is, by construction, the point that makes the sum of squared deviations as small as possible, so measuring from it understates the spread around the real mean. Dividing by n − 1 instead of n corrects that bias in the variance. This adjustment is known as Bessel's correction, and the n − 1 is the number of degrees of freedom: once the mean is fixed, only n − 1 of the deviations are free to vary, because the last one must make them sum to zero.

Use the population formulas when your data are the entire group you care about, such as every employee in a small company or every reading a sensor produced in a test. Use the sample formulas when the data stand in for a larger group, which is the usual situation in research, surveys and quality control. The NIST/SEMATECH handbook, like most statistics texts, uses the n − 1 version as its default definition of the sample standard deviation.

Worked example: the calculator's defaults

The calculator opens with eight values: 2, 4, 4, 4, 5, 5, 7, 9.

  1. Mean. The sum is 40, and 40 ÷ 8 = 5.
  2. Deviations. Subtract 5 from each value: −3, −1, −1, −1, 0, 0, 2, 4.
  3. Squared deviations. 9, 1, 1, 1, 0, 0, 4, 16.
  4. Sum of squares. 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32.
  5. Population variance. 32 ÷ 8 = 4, so the population standard deviation is √4 = 2.
  6. Sample variance. 32 ÷ 7 = 4.57142857143, so the sample standard deviation is its square root, 2.1380899353.

The calculator also reports a range of 7 (from 2 to 9) and a coefficient of variation of about 42.76%, which is the sample standard deviation divided by the mean, times 100.

Reading the example

With a mean of 5 and a population standard deviation of 2, six of the eight values (4, 4, 4, 5, 5, 7) lie within one standard deviation of the mean, between 3 and 7. The value 9 sits exactly two standard deviations above, and 2 sits one and a half below. The largest squared deviation, 16 from the value 9, contributes half of the entire sum of squares on its own, a reminder of how strongly squaring weights the values furthest from the mean.

The sample figure is about 7% larger than the population figure. That gap is the n − 1 correction at work, and it is worth noticing with small datasets like this: with eight values, the choice between the two formulas changes the answer more than most rounding ever will.

Standard error of the mean

The calculator also reports the standard error of the mean, the sample standard deviation divided by the square root of the count: SE = s ÷ √n. It answers a different question from the standard deviation. The standard deviation says how far a typical value sits from the mean; the standard error says how far the sample mean is likely to sit from the true mean of everything you could have measured. For the data 2, 4, 4, 4, 5, 5, 7, 9 it is 2.138 ÷ √8 ≈ 0.756. Because of the square root, four times as much data halves the standard error, and roughly 95% of sample means fall within 1.96 standard errors of the true mean, which is where the usual confidence interval comes from.

What standard deviation doesn't tell you

It assumes the mean is a sensible centre. For skewed data, such as incomes or house prices, a few very large values pull the mean and inflate the standard deviation. The median and interquartile range describe such data better.

It is sensitive to outliers. Because deviations are squared, one wild value can dominate the result. Check unusual values before you report a standard deviation.

It says nothing about shape. Two datasets can share a mean and standard deviation yet look completely different, one bell-shaped and one split into two clusters. The "68% within one standard deviation" rule only holds for roughly normal data.

Small samples give unstable estimates. With five or ten values, the sample standard deviation can differ substantially from the true spread. Treat it as a rough guide until you have more data.

It isn't a measure of error by itself. For the precision of an average, use the standard error (the standard deviation divided by √n, shown with the results), and for intervals, a confidence interval method, which the calculator doesn't compute; nor does it handle grouped or weighted data.

Using the result

Report the standard deviation together with the mean and the number of values, for example "mean 5, SD 2.14, n = 8", and say whether it is the sample or population figure. The average calculator adds the median and mode, which help when the data are skewed. When you round the result, the significant figures calculator can help match it to the precision of your measurements; a common convention is to report the standard deviation to two significant figures and the mean to the same decimal place. To test how the formulas behave, generate a large set of whole numbers with the random number generator and paste them in: for a uniform draw from 1 to 100 the standard deviation should settle near 28.9.

More questions

What share of values fall within one or two standard deviations of the mean?

For data that follow a normal (bell-shaped) distribution, about 68% of values lie within one standard deviation of the mean, about 95% within two and about 99.7% within three. For data of any shape, Chebyshev's inequality still guarantees at least 75% within two standard deviations and at least 89% within three. Check a histogram before relying on the normal figures.

What is the difference between standard deviation and standard error?

Standard deviation describes how spread out the individual values are. The standard error of the mean describes how precisely the sample mean estimates the true mean, and equals the sample standard deviation divided by the square root of n. For the default dataset that is 2.138 ÷ √8, about 0.76. Standard error shrinks as you collect more data; standard deviation does not.

How much can one outlier change the result?

A lot, because deviations are squared. Change the 9 in the default dataset to 29 and the calculator's sample standard deviation jumps from about 2.14 to about 8.80, while the mean moves only from 5 to 7.5. If a single value drives the result, check it for a typing or measurement error, and consider reporting the median and interquartile range alongside.

How do I use the standard deviation to tell whether a value is unusual?

Convert it to a z-score: subtract the mean and divide by the standard deviation. In the default dataset, using the population figure, the value 9 has z = (9 − 5) ÷ 2 = 2, so it sits two standard deviations above the mean. Values beyond about 2 or 3 in either direction are often flagged for a closer look, though with small datasets that rule is rough.

Does collecting more data make the standard deviation smaller?

Not in general. More data makes the estimate of the standard deviation more reliable, but the spread of the values themselves stays about the same. Entering the default dataset twice (16 values) leaves the population figure at exactly 2 and moves the sample figure only from about 2.138 to about 2.066, because the n − 1 correction matters less as n grows.

How many values do I need to halve the standard error?

Four times as many. The standard error is s ÷ √n, so it falls with the square root of the count: going from 25 to 100 measurements halves it, while the standard deviation of the values stays about the same.

Sources

This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy