PrimeCalcPro
All articles
Math7 min readApril 4, 2026

How to Calculate Standard Deviation — Step by Step

A clear step-by-step guide to calculating sample and population standard deviation, with the 68-95-99.7 rule and real-world applications.

Standard deviation is the most widely used measure of spread in statistics. It tells you how far a typical value sits from the mean — whether your data is tightly clustered or widely scattered. Once you've worked through the calculation by hand once, the concept becomes intuitive.

What Standard Deviation Tells You

If a class of students has a mean exam score of 70 with a standard deviation of 5, most scores fall between 65 and 75. If the standard deviation were 20, scores would range much more widely — from 50 to 90 and beyond.

A small standard deviation means consistency. A large one means variability.

Population vs Sample Standard Deviation

There are two versions, and choosing the right one matters:

Population standard deviation (σ): Use when you have data for every member of the group you care about. Divides by n.

Sample standard deviation (s): Use when your data is a sample drawn from a larger population. Divides by n − 1 (Bessel's correction, which accounts for the uncertainty introduced by sampling).

In practice, you almost always use sample standard deviation — unless you're analysing a complete census or a controlled dataset with no missing members.

Step-by-Step Calculation

Dataset: 4, 7, 13, 2, 1 (a sample of 5 values)

Step 1: Calculate the mean

Mean (x̄) = (4 + 7 + 13 + 2 + 1) / 5 = 27 / 5 = 5.4

Step 2: Find each deviation from the mean

Subtract the mean from each value:

| Value (x) | Deviation (x − x̄) | |-----------|-------------------| | 4 | 4 − 5.4 = −1.4 | | 7 | 7 − 5.4 = +1.6 | | 13 | 13 − 5.4 = +7.6 | | 2 | 2 − 5.4 = −3.4 | | 1 | 1 − 5.4 = −4.4 |

Step 3: Square each deviation

Squaring eliminates negative signs and emphasises larger deviations:

| Deviation | Squared deviation | |-----------|------------------| | −1.4 | 1.96 | | +1.6 | 2.56 | | +7.6 | 57.76 | | −3.4 | 11.56 | | −4.4 | 19.36 |

Step 4: Sum the squared deviations

Sum = 1.96 + 2.56 + 57.76 + 11.56 + 19.36 = 93.2

Step 5: Divide by n − 1 (for sample standard deviation)

Variance (s²) = 93.2 / (5 − 1) = 93.2 / 4 = 23.3

Step 6: Take the square root

Standard deviation (s) = √23.3 = 4.83

Interpretation: Values in this dataset typically sit about 4.83 units away from the mean of 5.4.

The Formula Written Out

Sample standard deviation:

s = √[ Σ(x − x̄)² / (n − 1) ]

Population standard deviation:

σ = √[ Σ(x − μ)² / n ]

Where μ (mu) is the population mean.

The Empirical Rule (68-95-99.7 Rule)

For data that follows a normal distribution, standard deviation has a reliable relationship with the proportion of data within each range:

| Range | Proportion of data | |-------|--------------------| | Mean ± 1 SD | ~68% | | Mean ± 2 SD | ~95% | | Mean ± 3 SD | ~99.7% |

Applied example: IQ scores have a mean of 100 and SD of 15.

  • 68% of people score between 85 and 115
  • 95% score between 70 and 130
  • 99.7% score between 55 and 145

This rule only applies to normally distributed data. For skewed or heavy-tailed distributions, use Chebyshev's inequality instead.

Variance vs Standard Deviation

Variance is the squared deviation (step 5 above) — standard deviation is its square root. Both measure spread, but standard deviation is expressed in the same units as the original data, making it more interpretable.

If your data is in kilograms, your standard deviation is in kilograms. Your variance is in kilograms-squared, which is harder to interpret meaningfully.

Common Applications

Finance: Measuring investment volatility. A stock with daily returns having a high SD is more volatile — higher potential gain and higher potential loss.

Quality control: Manufacturing uses SD to ensure products stay within tolerance. A process with SD too large produces too many defective items.

Education: Standardising test scores. A z-score tells you how many standard deviations a score sits above or below the mean: z = (x − mean) / SD.

Science: Expressing measurement uncertainty and comparing experimental results.

Shortcut for Calculation

For large datasets, use the computational formula which avoids calculating deviations individually:

s² = [Σx² − (Σx)²/n] / (n − 1)

This is mathematically equivalent but requires only two passes through the data rather than three.

Use our Standard Deviation Calculator to calculate SD, variance, and a full breakdown for any dataset you enter.

standard deviationstatisticsvariancemaths

Related articles

Settings

Theme

Light

Dark

Layout

Language

PrivacyTermsAbout© 2025 PrimeCalcPro