Statistics & Probability

Standard Deviation Calculator

This standard deviation calculator finds the sample standard deviation ss (divide by n − 1) or the population standard deviation σ\sigma (divide by n) of a list or a frequency table, with the variance, mean, standard error, a dot plot and every step shown.

Try

Numbers separated by commas, spaces or new lines (up to 10,000). With frequencies, list each distinct value or class midpoint once.

Data format

Use values with frequencies for grouped data or a frequency table.

Type of data

Sample: your values are part of a larger group. Population: they are the whole group.

Result

Sample standard deviation (s): 2.138089935

Sample standard deviation (s)

s=2.138089935s = 2.138089935

Sample variance (s²)
4.571428571
Mean (x̄)
5
Count (n)
8
Sum of squares Σ(x − x̄)²
32
Population standard deviation (σ)If these 8 values were the whole population (divide by n)
2
Population variance (σ²)
4
Minimum, maximum and range
2 to 9, range 7
Standard error of the mean (s/√n)How precisely the sample mean estimates the population mean
0.755928946
Coefficient of variation (s/|mean|)Also called the relative standard deviation (RSD)
42.7618%
Values within 1 standard deviation (mean ± s)About 68% for bell-shaped data (empirical rule)
75% (6 of 8)
Values within 2 standard deviations (mean ± 2s)About 95% for bell-shaped data (empirical rule)
100% (8 of 8)

On average the values lie about 2.138 away from the mean of 5. The population version is 2; the sample value is the larger of the two because it divides by n − 1 instead of n.

Dot plot with the mean and ±1s, ±2s bounds
0242468ValueCountData valuesMean±1s and ±2s
Deviations from the mean
ixx − mean(x − mean)²
12−39
24−11
34−11
44−11
5500
6500
7724
89416
Sum40032
Step-by-step working (4 steps)
  1. Find the mean

    Add the 8 values and divide by n.

    x¯=2+4+4+4+5+5+7+98=408=5\bar{x} = \frac{2 + 4 + 4 + 4 + 5 + 5 + 7 + 9}{8} = \frac{40}{8} = 5
  2. Subtract the mean and square

    For every value, find its deviation from the mean and square it (the table below lists each one). Squaring makes every term positive.

    ∑(x−x¯)2=9+1+1+1+0+0+4+16=32\sum (x - \bar{x})^2 = 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32
  3. Divide by n − 1 (sample variance)

    A sample divides by n − 1 = 7 (Bessel’s correction).

    s2=327=4.571428571s^2 = \frac{32}{7} = 4.571428571
  4. Take the square root

    s=4.571428571=2.138089935s = \sqrt{4.571428571} = 2.138089935
By Hira Noor, mathematicianLast reviewed Free, no sign-up, runs in your browserReport a problem

How to use this calculator

  1. Type or paste the numbers into Data set, separated by commas, spaces or new lines. A column copied from Excel or Google Sheets works as is.
  2. For grouped data or a frequency table, choose Values with frequencies, list each distinct value (or class midpoint) once, and enter how often each occurs under Frequencies.
  3. Choose Sample if the values are a subset of a larger group (the usual case in surveys, experiments and quality checks). Choose Population only if you have every member of the group.
  4. Read the standard deviation at the top. The other version, the variance, mean, range, standard error and the share of values within 1 and 2 standard deviations are listed underneath.
  5. Use the deviation table, the steps and the dot plot to check a hand calculation line by line.

Formulas

Sample standard deviation

s=∑i=1n(xi−x¯)2n−1s = \sqrt{\frac{\sum_{i=1}^{n} (x_i - \bar{x})^2}{n - 1}}

Plain-text formula: s = √((∑_{i = 1}^n (x_i − x̄)^2)/(n − 1))

x¯\bar{x}
sample mean
nn
number of values (at least 2)

Dividing by n − 1 instead of n (Bessel’s correction) makes the sample variance an unbiased estimate of the population variance.

Population standard deviation

σ=∑i=1N(xi−μ)2N\sigma = \sqrt{\frac{\sum_{i=1}^{N} (x_i - \mu)^2}{N}}

Plain-text formula: σ = √((∑_{i = 1}^N (x_i − μ)^2)/N)

μ\mu
population mean
NN
number of values in the population

Used when the data are the entire population. It is always a little smaller than the sample version for the same numbers.

Grouped data (values with frequencies)

s=∑f(x−x¯)2∑f−1,x¯=∑fx∑fs = \sqrt{\frac{\sum f (x - \bar{x})^2}{\sum f - 1}}, \qquad \bar{x} = \frac{\sum f x}{\sum f}

Plain-text formula: s = √((∑f(x − x̄)^2)/(∑f − 1)), x̄ = (∑fx)/(∑f)

Each value x is counted f times. For classes such as 10–20, use the class midpoint as x; the result is then an estimate, because the values inside each class are unknown. For a population, divide by Σf instead of Σf − 1.

Variance

s2=SSn−1,σ2=SSN,SS=∑(x−x¯)2s^2 = \frac{SS}{n - 1}, \qquad \sigma^2 = \frac{SS}{N}, \qquad SS = \sum (x - \bar{x})^2

Plain-text formula: s^2 = (SS)/(n − 1), σ^2 = (SS)/N, SS = ∑(x − x̄)^2

The variance is the standard deviation squared. It is in squared units (for example cm²), which is why the standard deviation is easier to interpret.

Standard error of the mean

SE=snSE = \frac{s}{\sqrt{n}}

Plain-text formula: SE = s/√(n)

The standard error measures how much the sample mean would vary from sample to sample. It shrinks as n grows, while the standard deviation does not.

Reading the result

The standard deviation is in the same units as your data and measures how far values typically are from the mean. A small value means the data cluster tightly around the mean; a large value means they are spread out.

For data that are roughly bell-shaped, the empirical rule says about 68% of values fall within one standard deviation of the mean, about 95% within two and about 99.7% within three. The calculator shows the actual shares for your data, so you can see how close to normal they are.

A value more than about two standard deviations from the mean is unusual, and one more than three is rare. Divide a value’s distance from the mean by the standard deviation to get its z-score.

Compare spreads of data on different scales with the coefficient of variation (standard deviation divided by the mean, also called the relative standard deviation), not with the raw standard deviations.

How to calculate standard deviation by hand

1. Add the values and divide by how many there are to get the mean.

2. Subtract the mean from each value to get its deviation. The deviations always add up to 0.

3. Square each deviation and add the squares. This total is the sum of squares, SS.

4. Divide SS by n − 1 for a sample or by n for a population. The result is the variance.

5. Take the square root of the variance. That is the standard deviation.

For 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5, the squared deviations add to 32, the sample variance is 32 / 7 ≈ 4.571 and the sample standard deviation is about 2.138. The worked example below lays out every row, and the calculator’s steps do the same for your own numbers.

Sample vs population standard deviation

The difference is only the divisor. A sample tends to sit closer to its own mean than to the true population mean, so the squared deviations are slightly too small; dividing by n − 1 instead of n corrects this on average.

If you measured the heights of 25 students to learn about all students at a school, use the sample formula. If you are describing the final exam scores of every student in one class and only that class, use the population formula. When in doubt, use the sample version: most software defaults to it.

Which function gives which standard deviation
ToolSample (n − 1)Population (n)
Excel and Google SheetsSTDEV.S (or STDEV)STDEV.P (or STDEVP)
TI-83 and TI-84 (1-Var Stats)Sxσx
Casio scientific (STAT mode)sx (xσn−1 on older models)σx (xσn on older models)
Rsd(x)sd(x) × √((n − 1)/n)
Pythonstatistics.stdev(x)statistics.pstdev(x)
NumPynp.std(x, ddof=1)np.std(x)

Standard deviation for grouped data

When data come as a frequency table, you do not need to type every repeated value. Choose Values with frequencies, enter each value once and its count beside it. The calculator multiplies each squared deviation by its frequency, f(x − x̄)², and divides the total by Σf − 1 for a sample or Σf for a population.

For class intervals such as 0–10, 10–20 and 20–30, enter the midpoints 5, 15 and 25 as the values. This treats every value in a class as if it sat at the midpoint, so the answer is an approximation of the standard deviation of the raw data.

Standard deviation vs standard error

The standard deviation describes the spread of the individual values. The standard error of the mean, s/√n, describes how precisely the sample mean estimates the population mean. Collecting more data does not make the standard deviation smaller, but it does shrink the standard error.

Report the standard deviation when you describe the data (for example, “mean 5.0, SD 2.1”). Report the standard error, or a confidence interval built from it, when you describe how certain the mean is.

Worked example

Standard deviation of 2, 4, 4, 4, 5, 5, 7, 9

Treat the eight values as a sample and find s, then compare with σ.

  1. Mean: x¯=40/8=5\bar{x} = 40 / 8 = 5.
  2. Deviations: −3, −1, −1, −1, 0, 0, 2, 4. Squares: 9, 1, 1, 1, 0, 0, 4, 16.
  3. Sum of squares: SS = 32.
  4. Sample variance: s2=32/7≈4.571428571s^2 = 32 / 7 \approx 4.571428571.
  5. Sample standard deviation: s=4.571428571≈2.138089935s = \sqrt{4.571428571} \approx 2.138089935.
  6. As a population: σ2=32/8=4\sigma^2 = 32 / 8 = 4, so σ=2\sigma = 2.
  7. Empirical rule check: 6 of the 8 values (75%) lie within one standard deviation of the mean, between 2.86 and 7.14.

Answer: s ≈ 2.138089935 (sample) and σ = 2 (population).

Frequently asked questions

What is the formula for standard deviation?

For a sample, s = √(Σ(x − x̄)² / (n − 1)). For a population, σ = √(Σ(x − μ)² / N). Both take the square root of the average squared distance from the mean; only the divisor differs.

Should I use the sample or the population standard deviation?

Use the sample version unless your data include every member of the group you are describing. Survey responses, experimental measurements and quality-control samples are samples.

Why is the sample standard deviation larger?

It divides the same sum of squares by a smaller number, n − 1 instead of n. The gap shrinks as n grows: with 8 values the ratio is √(8/7) ≈ 1.069, with 100 values about 1.005.

How do I calculate standard deviation in Excel?

Use =STDEV.S(A1:A20) for a sample and =STDEV.P(A1:A20) for a population. Google Sheets uses the same function names. You can also paste the column straight into this calculator to see the working.

What is a good or normal standard deviation?

There is no universal good value, because the standard deviation is in the units of your data. Judge it against the mean with the coefficient of variation: below about 10% is usually considered low spread, though the right threshold depends on the field.

What is the relative standard deviation?

The relative standard deviation (RSD) is the standard deviation divided by the absolute value of the mean, usually written as a percentage. It is the same as the coefficient of variation, which the calculator lists under the results.

Can the standard deviation be negative?

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

Why does a sample of one value give an error?

The sample formula divides by n − 1, which is 0 for a single value, so the sample standard deviation is undefined. The population standard deviation of one value is 0.

What is the difference between variance and standard deviation?

The variance is the average squared deviation, in squared units. The standard deviation is its square root, back in the original units, which makes it easier to interpret.

Statistics Calculator

Mean, median, mode, five-number summary, IQR, outliers and SD with steps, a histogram and a box plot.

Statistics & Probability

Linear Regression Calculator

Line of best fit with r², slope p-value, 95% intervals and steps, plus five curved regression models.

Statistics & Probability

Poisson Distribution Calculator

Exact and cumulative Poisson probabilities for any average rate λ, with steps, a table and a graph.

Statistics & Probability

Binomial Distribution Calculator

Exact and cumulative binomial probabilities for up to a million trials, with steps, a table and a graph.

Statistics & Probability

Scientific Calculator

Type or tap expressions with exact fractions, memory, variables, constants and complex mode.

Tools

Sources and further reading

  1. NIST/SEMATECH e-Handbook of Statistical Methods, Section 1.3.5.6: Measures of Scale (opens in a new tab), National Institute of Standards and Technology
  2. Introductory Statistics 2e, Section 2.7: Measures of the Spread of the Data (opens in a new tab), OpenStax, Rice University
  3. STDEV.S function (opens in a new tab), Microsoft Support
  4. statistics: Mathematical statistics functions (stdev, pstdev) (opens in a new tab), Python Software Foundation

Results are calculated in your browser with methods checked by automated tests, and are intended for learning and general use. For engineering, medical, financial, legal or safety-critical decisions, verify important values independently and follow the rounding rules your work requires. How accurate are these results?