Mathematics & Statistics

How to Calculate Standard Deviation:
A Step-by-Step Guide

Published May 19, 2026 • 7 min read

In the field of data science and statistics, identifying the middle of a data set (using the mean or median) is only half the battle. To truly understand your data, you must measure its **dispersion**—how spread out the individual values are from that middle point. The most authoritative, universally accepted measure of this dispersion is **Standard Deviation**.

Standard Deviation measures the average distance of each data point from the mean of the dataset. A low standard deviation indicates that the data points tend to be close to the mean, while a high standard deviation indicates that the data points are spread out over a wider range of values.

1. Population vs. Sample Standard Deviation

Before writing down the formulas, we must determine if we are calculating standard deviation for a **Population** (the entire group of interest) or a **Sample** (a subset representing the population).

A. Population Formula

Use this formula when you possess data for every single member of the target population. It is denoted by the Greek letter **sigma (\(\sigma\))**:

$$\sigma = \sqrt{\frac{\sum (x - \mu)^2}{N}}$$

Where \(\mu\) is the population mean, \(x\) is each individual value, and \(N\) is the total population size.

B. Sample Formula

Use this formula when you are using a sample to estimate the standard deviation of a larger population. It is denoted by **\(s\)** and uses Bessel's correction (\(n - 1\)) to adjust for bias:

$$s = \sqrt{\frac{\sum (x - \bar{x})^2}{n - 1}}$$

Where \(\bar{x}\) is the sample mean, \(x\) is each individual value, and \(n\) is the sample size.

2. Step-by-Step Worked Example (Sample)

Let's calculate the sample standard deviation for a simple dataset representing student exam scores: **[10, 12, 14, 16, 18]**.

Data Value (\(x\)) Difference from Mean (\(x - \bar{x}\)) Squared Difference (\((x - \bar{x})^2\))
10 -4 16
12 -2 4
14 0 0
16 2 4
18 4 16
Sum = 70 Mean (\(\bar{x}\)) = 14 Sum of Squares = 40

Finalizing the Calculation:

  • Step 1: Sum of Squares = 40
  • Step 2: Divide by \(n - 1\) (where \(n = 5\), so \(n-1 = 4\)): \(\frac{40}{4} = 10\) (This value is the **Variance**).
  • Step 3: Take the square root of the variance: \(\sqrt{10} \approx 3.16\)
  • Result: The sample standard deviation is **3.16**.

3. Practical Application & Meaning

Why does standard deviation matter? In normal distributions (bell curves), standard deviation dictates the **empirical rule**:

  • **68%** of all data points lie within 1 standard deviation of the mean.
  • **95%** of all data points lie within 2 standard deviations of the mean.
  • **99.7%** of all data points lie within 3 standard deviations of the mean.
Launch the Standard Deviation Calculator

Avoid manual calculations, sum of squares, and square roots. Paste your raw dataset into our **Standard Deviation Calculator** to instantly view both sample and population outputs, variance, count, and summary statistics.

Open Standard Deviation Calculator Page →