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, when to use each, and what standard deviation tells you about your data.

Updated 2026-06-26

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. A large standard deviation means values are scattered 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 quantifies dispersion — the degree to which individual values in a dataset differ from the mean. It is expressed in the same units as your original data, which makes it easy to interpret alongside the mean itself. If a class of students has a mean exam score of 70 with a standard deviation of 5, you immediately know that most students scored between 65 and 75. If the standard deviation were 20, the scores would be spread from 50 to 90 or beyond.

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

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

Use the Mean, Median and Mode Calculator if you need to verify the mean quickly or are working with 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

Note that the deviations sum to zero — this is always true and is a useful 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

This is where population and sample SD diverge.

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

The division 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. This means a typical value in the dataset sits about 4.83 units away from the mean of 5.4. The Standard Deviation Calculator handles all five steps automatically and shows the intermediate working, which is useful when checking your manual calculations.

Population vs Sample: Which Formula to Use?

Use population SD when:

  • Your dataset includes every member of the group being studied (e.g., all 50 employees in a company, all 30 students in a specific class).
  • You are not trying to generalise beyond the data you have.

Use sample SD in virtually all other cases:

  • 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)

In practice, sample SD is the default for almost all research, data analysis, and business contexts. If you are unsure, use sample SD.

How to Interpret Standard Deviation

The 68-95-99.7 Rule

For data that follows a normal distribution, approximately:

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

Applied 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 would be expected to fall within one SD of the long-run average return. Extreme years — crashes or booms — correspond to returns that are 2 or 3 SDs away from the mean.

Z-Scores

A z-score converts any individual value into a standard deviation count — it tells you how many SDs above or below the mean a particular value sits. The formula is: z = (value − mean) ÷ SD. A z-score of 2.0 means the value is 2 standard deviations above average, which puts it in roughly the top 2.3% of a normal distribution. Use the Z-Score Calculator to compute this instantly for any dataset.

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

There is no universal threshold. Standard deviation must always be interpreted relative to the mean and the context. A useful dimensionless measure is the coefficient of variation (CV = SD ÷ mean × 100%). A CV of 10% indicates low variability; a CV of 50% indicates 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 limitations:

  • Outliers inflate it. Because deviations are squared, a single extreme value can dominate the result. One value of 1,000 in a dataset of mostly single-digit numbers will push the SD dramatically upward.
  • Skewed distributions. Income, wealth, and property prices are right-skewed. The mean and SD describe these distributions poorly; the median and interquartile range are more informative.
  • Non-normal data. The 68-95-99.7 rule only applies to normally distributed data. Applying it to other distributions produces incorrect probability estimates.
  • Small samples. With fewer than 30 observations, the sample SD is itself an unreliable estimate of the population SD.

When your data is skewed or contains outliers, always report the median and range alongside mean and SD, or instead of them.

Quick Reference: The Formula

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

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

Where 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, returning both population and sample SD simultaneously.

Frequently Asked Questions

Population standard deviation (σ) is used when you have data for every member of the group you are studying — for example, the test scores of every student in a single classroom. Sample standard deviation (s) is used when your dataset is a subset meant to represent a larger population, which applies to almost all real-world research. The key formula difference is 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 occurs when working with a subset.
There is no universal good or bad value — it depends entirely 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 to express SD as a percentage of the mean (the coefficient of variation). For stock market returns, the S&P 500 has a historical annual SD of roughly 15–17%, which is generally considered the baseline for equity risk.
Excel provides two dedicated functions: STDEV.P for population standard deviation and STDEV.S for sample standard deviation (the default for most analytical work). Simply type =STDEV.S(A1:A10) and replace the range with your actual data range. The older STDEV function also calculates sample SD and remains in Excel for compatibility. Avoid the legacy STDEVP function if you are on a modern version of Excel, as STDEV.P is its accurate replacement.
In finance, standard deviation of returns is the primary measure of volatility — it tells you how much a stock or portfolio's return tends to deviate from its average return over a given period. A stock with an annualised SD of 30% is far more volatile than one with an SD of 10%, meaning returns can swing more dramatically in both directions. The S&P 500's long-run annual SD is approximately 15–17%, so funds and individual stocks are often benchmarked against this figure to assess relative risk.
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. The process involves four steps: subtract the mean from each value, square those differences, average them (using N or N−1), and take the square root. The result is expressed in the same units as your original data, which makes it directly interpretable.
The most direct interpretation is that 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 that follows a normal distribution, the 68-95-99.7 rule applies: approximately 68% of values fall within 1 SD of the mean, 95% within 2 SDs, and 99.7% within 3 SDs. This rule does not apply to skewed or non-normal distributions.
The normal distribution (the bell curve) is fully described by just two numbers: its mean and its standard deviation. The mean sets the centre of the curve, and the SD controls its width — a small SD produces a tall, narrow peak, while a large SD produces a wide, flat curve. The 68-95-99.7 empirical rule is a direct consequence of this relationship. However, many real-world datasets are not normally distributed, so always check the shape of your data before applying these percentages.
Variance is the average of the squared deviations from the mean, and standard deviation is simply the square root of the variance. Variance (σ² or s²) is used extensively in mathematical and statistical derivations because it has convenient algebraic properties. Standard deviation is preferred for communication and interpretation because it is expressed in the same units as the original data — if you are measuring height in centimetres, your SD is also in centimetres, while variance would be in centimetres squared, which is not intuitive.
The coefficient of variation (CV) is standard deviation divided by the mean, usually expressed as a percentage. It normalises spread so you can compare variability across datasets measured on different scales or with different means. For example, comparing the SD of salaries in rupees with the SD of heights in centimetres is meaningless — but comparing their CVs is valid. A CV below 15% is often considered low variability in many fields, though this benchmark varies by discipline.
Standard deviation can be misleading when data is heavily skewed or contains significant outliers, because it is based on squared deviations and therefore gives disproportionate weight to extreme values. For example, income data in most countries is right-skewed, and the mean and SD are dominated by a small number of very high earners, making them poor representatives of the typical person's experience. In these cases, the median and interquartile range (IQR) give a more honest picture of spread. SD also assumes that the data's distribution is relevant to the mean, which breaks down for multimodal data.
In finance, standard deviation is the foundational measure of risk. Portfolio theory, developed by Harry Markowitz, defines risk as the standard deviation of returns, and the entire framework of mean-variance optimisation is built on this definition. It appears in the Sharpe ratio (excess return divided by SD), in options pricing through implied volatility, and in Value at Risk (VaR) models. A lower SD portfolio for the same expected return is strictly preferable under this framework, which is the mathematical basis for diversification.
Standard deviation becomes less reliable as sample size decreases. With fewer than 30 data points, the sample SD can vary substantially from the true population SD just due to chance, and confidence intervals around the SD itself become very wide. For very small samples (under 10), the t-distribution should be used instead of the normal distribution when making inferences. Increasing sample size is the most direct way to improve the accuracy of your SD estimate — doubling the sample size 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