HomeArticlesHow ToHow to Calculate Standard Deviation
HOW TO

How to Calculate Standard Deviation

Calculate standard deviation step by step — the formula for population vs sample SD, worked examples, and what it tells you about your data.

Reviewed by the thecalcu.com team · Last updated August 4, 2026

Free calculators used in this guide

Standard Deviation CalculatorZ-Score Calculator

Standard deviation is one of the most important numbers in statistics. It answers a simple question about your data: how spread out are the values? A small standard deviation means most values cluster tightly around the average, and a large one means values scatter widely. This guide walks through the exact calculation steps with a worked example, explains the population versus sample distinction, and shows you how to interpret the result.

What is Standard Deviation?

Standard deviation measures dispersion, the degree to which individual values in a dataset differ from the mean. It comes out in the same units as your original data, so it's easy to read alongside the mean itself. If a class of students has a mean exam score of 70 with a standard deviation of 5, you already know most students scored between 65 and 75. Push the standard deviation to 20 and the scores spread from 50 to 90 or beyond.

The underlying concept is variance, the average of squared differences from the mean. Standard deviation is the square root of variance, which converts those squared units back into the original scale.

Step 1: Find the Mean

Add all values and divide by the count.

Dataset: {4, 7, 13, 2, 1}

Sum = 4 + 7 + 13 + 2 + 1 = 27 n = 5 Mean = 27 ÷ 5 = 5.4

The Statistics Calculator can verify the mean quickly, especially on a larger dataset.

Step 2: Find Each Deviation from the Mean

Subtract the mean from each value:

Value Deviation (value − mean)
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

The deviations sum to zero. That's always true, and it's a handy check that your mean is correct.

Step 3: Square Each Deviation

Squaring removes the negative signs and gives extra weight to larger deviations:

Deviation Squared
−1.4 1.96
1.6 2.56
7.6 57.76
−3.4 11.56
−4.4 19.36

Sum of squared deviations = 93.20

Step 4: Calculate the Variance

Population and sample SD part ways here.

Population variance (use when you have data for every member of the group): σ² = 93.20 ÷ 5 = 18.64

Sample variance (use when your data is a subset estimating a larger population): s² = 93.20 ÷ (5 − 1) = 93.20 ÷ 4 = 23.30

Dividing by N−1 instead of N is called Bessel's correction. It compensates for the fact that a sample tends to underestimate the true spread of the full population.

Step 5: Take the Square Root

Converting variance back to standard deviation restores the original units:

Population SD: σ = √18.64 ≈ 4.32 Sample SD: s = √23.30 ≈ 4.83

For this dataset, the sample standard deviation is 4.83, meaning a typical value sits about 4.83 units away from the mean of 5.4. The Standard Deviation Calculator runs all five steps automatically and shows the intermediate working, which helps when you're checking a manual calculation.

Population vs Sample: Which Formula to Use?

Use population SD when:

  • Your dataset includes every member of the group being studied (all 50 employees in a company, all 30 students in a specific class).
  • You aren't trying to generalize beyond the data you have.

Use sample SD in virtually every other case:

  • Survey data representing a larger population
  • Quality control samples from a production run
  • Medical study participants representing all patients with a condition
  • Financial return data for a stock (past returns are a sample of all possible future returns)

Sample SD is the default for almost all research, data analysis, and business work. If you're unsure which to use, use sample SD.

How to Interpret Standard Deviation

The 68-95-99.7 Rule

For data that follows a normal distribution, roughly:

  • 68% of values fall within 1 SD of the mean
  • 95% fall within 2 SDs
  • 99.7% fall within 3 SDs

Apply this to the S&P 500, which has a historical annual standard deviation of roughly 15-17%: in any given year, about 68% of annual returns should fall within one SD of the long-run average. Extreme years, crashes or booms, correspond to returns that sit 2 or 3 SDs away from the mean.

Z-Scores

A z-score converts an individual value into a standard deviation count, telling you how many SDs above or below the mean that value sits. The formula: z = (value − mean) ÷ SD. A z-score of 2.0 puts a value 2 standard deviations above average, roughly the top 2.3% of a normal distribution. The Z-Score Calculator computes this instantly for any dataset.

What Makes an SD "Large" or "Small"?

No universal threshold exists here. You have to read standard deviation relative to the mean and the context. The coefficient of variation (CV = SD ÷ mean × 100%) gives you a dimensionless way to compare. A CV of 10% signals low variability; a CV of 50% signals high variability. This lets you compare spread across datasets measured in different units or at different scales.

When Standard Deviation Can Mislead

Standard deviation has real limits:

  • Outliers inflate it. Because deviations get squared, one extreme value can dominate the result. A single 1,000 in a dataset of mostly single-digit numbers pushes the SD dramatically upward.
  • Skewed distributions cause trouble. Income, wealth, and property prices run right-skewed. Mean and SD describe these poorly; median and interquartile range tell you more.
  • Non-normal data breaks the rule. The 68-95-99.7 rule only applies to normally distributed data. Apply it elsewhere and you get incorrect probability estimates.
  • Small samples add noise. With fewer than 30 observations, sample SD is itself an unreliable estimate of the population SD.

When your data is skewed or carries outliers, report the median and range alongside mean and SD, or in place of them.

Quick Reference: The Formula

Population SD: σ = √( Σ(xᵢ − μ)² ÷ N )

Sample SD: s = √( Σ(xᵢ − x̄)² ÷ (N−1) )

Here xᵢ is each individual value, μ (or x̄) is the mean, and N is the count of values. The Standard Deviation Calculator applies this formula to any dataset you paste in and returns both population and sample SD at once.

Frequently Asked Questions

What is the difference between population and sample standard deviation?
Population standard deviation (σ) applies when you have data for every member of the group you are studying, for example the test scores of every student in one classroom. Sample standard deviation (s) applies when your dataset is a subset meant to represent a larger population, which covers almost all real-world research. The formulas differ in the denominator: population SD divides by N, while sample SD divides by N−1 (Bessel's correction) to correct for the underestimation of spread that shows up when you work with a subset.
What counts as a good standard deviation?
There is no fixed good or bad value. It depends on the context and the scale of your data. A standard deviation of 5 kg in human body weight is unremarkable, but a standard deviation of 5 kg in the weight of mobile phones would be enormous. The most useful benchmark is expressing SD as a percentage of the mean, known as the coefficient of variation. For stock market returns, the S&P 500 has a historical annual SD of roughly 15-17%, often treated as the baseline for equity risk.
How do I calculate standard deviation in Excel?
Excel gives you two dedicated functions: STDEV.P for population standard deviation and STDEV.S for sample standard deviation, the default for most analytical work. Type =STDEV.S(A1:A10) and swap in your actual data range. The older STDEV function also calculates sample SD and stays in Excel for compatibility. Skip the legacy STDEVP function on a modern version of Excel; STDEV.P replaced it.
What does the standard deviation of stock returns tell me?
In finance, standard deviation of returns is the primary measure of volatility. It tells you how much a stock or portfolio's return typically deviates from its average over a given period. A stock with an annualized SD of 30% is far more volatile than one at 10%, meaning returns can swing harder in both directions. The S&P 500's long-run annual SD sits around 15-17%, so funds and individual stocks often get benchmarked against that figure to gauge relative risk.
What is the formula for standard deviation?
For population standard deviation: σ = √(Σ(xᵢ − μ)² / N), where μ is the population mean and N is the total count. For sample standard deviation: s = √(Σ(xᵢ − x̄)² / (N−1)), where x̄ is the sample mean. Four steps get you there: subtract the mean from each value, square those differences, average them using N or N−1, then take the square root. The result comes out in the same units as your original data, so it stays directly interpretable.
How do I interpret a standard deviation value?
Standard deviation tells you the typical distance of any data point from the mean. If exam scores have a mean of 70 and an SD of 8, most students scored somewhere between 62 and 78. For data following a normal distribution, the 68-95-99.7 rule kicks in: about 68% of values fall within 1 SD of the mean, 95% within 2 SDs, and 99.7% within 3 SDs. Skewed or non-normal distributions don't follow this rule.
How does standard deviation relate to the normal distribution?
Two numbers fully describe the normal distribution, or bell curve: its mean and its standard deviation. The mean sets the center of the curve, and the SD controls its width. A small SD produces a tall, narrow peak; a large SD spreads it into a wide, flat curve. The 68-95-99.7 empirical rule falls directly out of this relationship. Plenty of real-world datasets aren't normally distributed, though, so check the shape of your data before applying these percentages.
What is the difference between standard deviation and variance?
Variance is the average of the squared deviations from the mean, and standard deviation is just the square root of that. Variance (σ² or s²) shows up constantly in mathematical and statistical derivations because it has convenient algebraic properties. Standard deviation wins for communication and interpretation because it comes out in the same units as the original data. Measure height in centimeters and your SD is also in centimeters, while variance would land in centimeters squared, which nobody finds intuitive.
What is the coefficient of variation and when should I use it?
The coefficient of variation (CV) is standard deviation divided by the mean, usually shown as a percentage. It normalizes spread so you can compare variability across datasets measured on different scales or with different means. Comparing the SD of salaries in rupees against the SD of heights in centimeters tells you nothing useful, but comparing their CVs works fine. A CV below 15% often counts as low variability in many fields, though the exact cutoff shifts by discipline.
When is standard deviation a misleading measure of spread?
Standard deviation misleads when data is heavily skewed or carries significant outliers, since it's built on squared deviations and gives disproportionate weight to extreme values. Income data in most countries runs right-skewed, for instance, and the mean and SD end up dominated by a small number of very high earners, which makes them poor stand-ins for a typical person's experience. The median and interquartile range (IQR) give a more honest picture of spread in these cases. SD also assumes the data's distribution is meaningfully centered on the mean, an assumption that breaks down for multimodal data.
How is standard deviation used in finance and investing?
Standard deviation is the foundational risk measure in finance. Portfolio theory, developed by Harry Markowitz, defines risk as the standard deviation of returns, and mean-variance optimization is built entirely on that definition. It shows up in the Sharpe ratio (excess return divided by SD), in options pricing through implied volatility, and in Value at Risk (VaR) models. Under this framework, a lower-SD portfolio for the same expected return wins every time, which is the mathematical case for diversification.
How reliable is standard deviation for small samples?
Reliability drops as sample size shrinks. With fewer than 30 data points, sample SD can swing substantially away from the true population SD just by chance, and confidence intervals around the SD itself widen considerably. Below 10 observations, use the t-distribution rather than the normal distribution for inference. Growing your sample size is the most direct fix for accuracy; doubling it roughly halves the standard error of the SD.

Related Articles

HOW TO

How to Calculate Z-Score

HOW TO

How to Run an A/B Test Significance Test

BEST OF

Best Free Calculators for Students 2026

HOW TO

How to Calculate Probability

HOW TO

How to Calculate Burn Rate and Runway