To find standard deviation, you measure how far data values typically are from their mean (average). It’s a single number that tells you how “spread out” your data is.

What standard deviation means

  • It shows on average how far each value lies from the mean.
  • A small standard deviation ⇒ data are tightly clustered near the mean.
  • A large standard deviation ⇒ data are more spread out.

A quick way to picture it: test scores where everyone scored around 80 will have a low standard deviation, but a class where some got 40 and some 100 will have a high one.

Basic steps: population standard deviation

Use this when you have all values from the group you care about (the whole “population”).

Given data values x1,x2,…,xnx_1,x_2,\dots,x_nx1​,x2​,…,xn​:

  1. Find the mean
    xˉ=x1+x2+⋯+xnn\bar{x}=\dfrac{x_1+x_2+\dots +x_n}{n}xˉ=nx1​+x2​+⋯+xn​​ (average of all values).
  1. Find each deviation from the mean
    For each value, compute xi−xˉx_i-\bar{x}xi​−xˉ.
  1. Square each deviation
    Compute (xi−xˉ)2(x_i-\bar{x})^2(xi​−xˉ)2 for every value.
  1. Find the variance
    Add all squared deviations and divide by nnn:

Variance=∑(xi−xˉ)2n\text{Variance}=\dfrac{\sum (x_i-\bar{x})^2}{n}Variance=n∑(xi​−xˉ)2​

  1. Take the square root

σ=∑(xi−xˉ)2n\sigma =\sqrt{\dfrac{\sum (x_i-\bar{x})^2}{n}}σ=n∑(xi​−xˉ)2​​

This result σ\sigma σ is the population standard deviation.

Basic steps: sample standard deviation

When your numbers are just a sample from a larger population, you slightly tweak the formula.

  1. Compute the sample mean xˉ\bar{x}xˉ as before.
  1. Compute (xi−xˉ)2(x_i-\bar{x})^2(xi​−xˉ)2 for each data point.
  1. Add them up: ∑(xi−xˉ)2\sum (x_i-\bar{x})^2∑(xi​−xˉ)2.
  1. Divide by n−1n-1n−1 (not nnn):

s2=∑(xi−xˉ)2n−1s^2=\dfrac{\sum (x_i-\bar{x})^2}{n-1}s2=n−1∑(xi​−xˉ)2​

This is the sample variance.

  1. Take the square root:

s=∑(xi−xˉ)2n−1s=\sqrt{\dfrac{\sum (x_i-\bar{x})^2}{n-1}}s=n−1∑(xi​−xˉ)2​​

This sss is the sample standard deviation.

Using n−1n-1n−1 instead of nnn helps correct for the fact that a sample tends to underestimate the spread of the full population.

Quick worked example

Imagine the data: 2, 4, 4, 4, 5, 5, 7, 9 (treat as a population).

  1. Mean:
    xˉ=(2+4+4+4+5+5+7+9)/8=40/8=5\bar{x}=(2+4+4+4+5+5+7+9)/8=40/8=5xˉ=(2+4+4+4+5+5+7+9)/8=40/8=5.
  1. Deviations from mean:
    • 2 → 2 − 5 = −3
    • 4 → 4 − 5 = −1
    • 4 → −1
    • 4 → −1
    • 5 → 0
    • 5 → 0
    • 7 → 2
    • 9 → 4
  1. Squared deviations:
    • 9,1,1,1,0,0,4,169,1,1,1,0,0,4,169,1,1,1,0,0,4,16.
  1. Sum: 9+1+1+1+0+0+4+16=329+1+1+1+0+0+4+16=329+1+1+1+0+0+4+16=32.
  1. Variance: 32/8=432/8=432/8=4.
  1. Standard deviation: 4=2\sqrt{4}=24​=2.

So the standard deviation is 2, meaning values are on average about 2 units from the mean.

HTML table: formulas at a glance

html

<table>
  <thead>
    <tr>
      <th>Type</th>
      <th>When to use</th>
      <th>Formula</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Population standard deviation σ</td>
      <td>Data are the entire population</td>
      <td>σ = √( Σ (xᵢ − μ)² / N )</td>
    </tr>
    <tr>
      <td>Sample standard deviation s</td>
      <td>Data are a sample from a larger population</td>
      <td>s = √( Σ (xᵢ − x̄)² / (n − 1) )</td>
    </tr>
  </tbody>
</table>

(μ is the population mean, x̄ is the sample mean, N is population size, n is sample size.)

Extra tips and “quick scoop” notes

  • Many tutorials recommend first deciding: “Is this a sample or my whole population?” and then picking the matching formula.
  • Modern calculators and software (Excel, Python, online calculators) have built‑in functions for standard deviation; you mainly need to know which version (population vs sample) to pick and how to interpret the number.

TL;DR: Find the mean, subtract it from each value, square those distances, average the squares (using nnn or n−1n-1n−1), then take the square root—that’s your standard deviation.

Information gathered from public forums or data available on the internet and portrayed here.