How to Calculate Mean, Median, Mode & Standard Deviation (2026 Guide)
Quick Answer
- *Mean: Sum all values and divide by count. Formula: μ = Σx / n
- *Median: Sort the values, then take the middle one (or average the two middle values for even-count datasets).
- *Standard deviation: Square root of variance. Formula: σ = √[Σ(x − μ)² / n]
- *Use median over mean whenever your data has outliers — income, house prices, and test scores are prime examples.
What Are Descriptive Statistics?
Descriptive statistics summarize and describe the key features of a dataset. Rather than presenting every individual data point, they give you a compact picture: where the center is, how spread out the values are, and what the most typical value looks like.
The six core measures covered in this guide — mean, median, mode, range, variance, and standard deviation — are the foundation of data analysis in every field from science to finance to sports. According to the US Bureau of Labor Statistics, data scientist employment is projected to grow 36% from 2023 to 2033, making statistical literacy more valuable than ever. The American Statistical Association (2024) reports that statistical competency now appears in over 70% of Fortune 500 job postings.
Throughout this guide, we use a single example dataset to show every calculation:
Dataset: [4, 7, 13, 2, 7, 8, 3, 7, 9, 15]— 10 values
Mean (Average)
The mean is the arithmetic average. Add all values and divide by how many there are.
Formula: μ = Σx / n
Step-by-Step Calculation
Step 1 — Add all values:
4 + 7 + 13 + 2 + 7 + 8 + 3 + 7 + 9 + 15 = 75
Step 2 — Divide by the count (n = 10):
75 ÷ 10 = 7.5
The mean of our dataset is 7.5.
The mean is intuitive and widely used, but it has a weakness: a single extreme value can distort it significantly. Add one outlier — say, 100 — to our dataset and the mean jumps from 7.5 to 16.8. That’s why the median often tells a more honest story.
Median
The median is the middle value when the data is sorted in order. For an even number of values, it’s the average of the two middle values.
Step-by-Step Calculation
Step 1 — Sort the dataset:
[2, 3, 4, 7, 7, 7, 8, 9, 13, 15]
Step 2 — Find the middle position. With 10 values, the two middle positions are 5th and 6th.
5th value = 7, 6th value = 7
Step 3 — Average the two middle values:
(7 + 7) ÷ 2 = 7.0
The median of our dataset is 7.0.
Notice how close the mean (7.5) and median (7.0) are for this dataset. That’s typical when data is roughly symmetric. With skewed data, the gap between mean and median is the signal that outliers are present.
Mode
The mode is the value that appears most often. A dataset can have one mode (unimodal), two modes (bimodal), or more (multimodal).
Step-by-Step Calculation
Count how many times each value appears in [4, 7, 13, 2, 7, 8, 3, 7, 9, 15]:
| Value | Frequency |
|---|---|
| 2 | 1 |
| 3 | 1 |
| 4 | 1 |
| 7 | 3 |
| 8 | 1 |
| 9 | 1 |
| 13 | 1 |
| 15 | 1 |
The value 7 appears 3 times — more than any other value. The mode is 7.
Range
The range is the simplest measure of spread: the difference between the largest and smallest values.
Formula: Range = Max − Min
From our sorted dataset [2, 3, 4, 7, 7, 7, 8, 9, 13, 15]:
Range = 15 − 2 = 13
The range is easy to compute but sensitive to outliers. Two datasets can have the same range but very different distributions. That’s why variance and standard deviation are more informative.
Variance
Variance measures how far each value deviates from the mean, on average. It squares those deviations so negative and positive differences don’t cancel out.
Population variance: σ² = Σ(x − μ)² / n
Sample variance: s² = Σ(x − μ)² / (n − 1)
The difference matters. Use population variance when your dataset is the entire population you care about. Use sample variancewhen your data is a subset drawn from a larger population — which is almost always the case in practice. Dividing by n−1 (Bessel’s correction) makes the sample variance an unbiased estimator.
Step-by-Step Calculation (Sample Variance)
Mean = 7.5 (calculated above)
| x | x − μ | (x − μ)² |
|---|---|---|
| 4 | −3.5 | 12.25 |
| 7 | −0.5 | 0.25 |
| 13 | 5.5 | 30.25 |
| 2 | −5.5 | 30.25 |
| 7 | −0.5 | 0.25 |
| 8 | 0.5 | 0.25 |
| 3 | −4.5 | 20.25 |
| 7 | −0.5 | 0.25 |
| 9 | 1.5 | 2.25 |
| 15 | 7.5 | 56.25 |
| Sum | — | 152.50 |
Sample variance = 152.50 ÷ (10 − 1) = 152.50 ÷ 9 = 16.94
Population variance = 152.50 ÷ 10 = 15.25
Standard Deviation
Standard deviation is simply the square root of variance. It brings the spread measure back to the same units as the original data, making it more interpretable.
The concept was formalized by Karl Pearson in 1894, building on Francis Galton’s earlier work on variation — and it remains one of the most widely used statistics in science, finance, and engineering.
Population standard deviation: σ = √σ²
Sample standard deviation: s = √s²
Step-by-Step Calculation
Sample standard deviation = √16.94 ≈ 4.12
Population standard deviation = √15.25 ≈ 3.91
Interpretation: most values in our dataset fall within about 4 points of the mean (7.5). Values like 2, 3, 13, and 15 are further out — more than one standard deviation from the mean.
Summary: All Statistics for the Example Dataset
| Statistic | Value | Notes |
|---|---|---|
| Dataset | [4, 7, 13, 2, 7, 8, 3, 7, 9, 15] | n = 10 |
| Mean | 7.5 | Sum ÷ count |
| Median | 7.0 | Average of 5th & 6th values |
| Mode | 7 | Appears 3 times |
| Range | 13 | 15 − 2 |
| Sample Variance | 16.94 | Divide by n−1 |
| Population Variance | 15.25 | Divide by n |
| Sample Std Dev | 4.12 | √16.94 |
| Population Std Dev | 3.91 | √15.25 |
When to Use Mean vs Median
This is one of the most practical questions in applied statistics. The answer comes down to one thing: are outliers present?
A single extreme value can shift the mean by 10–20% but won’t affect the median at all. Income data is the canonical example. According to the US Census Bureau (2024), the median US household income is $80,610. The mean is considerably higher because a small number of extremely high earners pull the average upward. The median — the value that half of households fall above and half fall below — is more representative of the typical American family.
The same logic applies to house prices, net worth, executive compensation, and any dataset where a long right tail distorts the average. Real estate listings invariably report median home prices, not mean prices, for exactly this reason.
Use the mean when:
- The data is roughly symmetric (no strong skew)
- There are no significant outliers
- You need to perform further calculations (variance, regression) that build on the mean
- You’re working with normally distributed data like heights, measurement errors, or test scores in a large class
Use the median when:
- The data is skewed (income, house prices, response times)
- There are outliers you don’t want distorting the picture
- You want to describe the “typical” value rather than the mathematical average
- Reporting to a general audience who might misinterpret a mean inflated by outliers
The 68-95-99.7 Rule
For data that follows a normal distribution (the bell curve), standard deviation has a precise interpretation. This is called the empirical rule or the 68-95-99.7 rule.
| Range from Mean | % of Data Included | Example (Mean = 100, SD = 15) |
|---|---|---|
| μ ± 1σ | 68.27% | 85 to 115 |
| μ ± 2σ | 95.45% | 70 to 130 |
| μ ± 3σ | 99.73% | 55 to 145 |
In practical terms: if you know a dataset is normally distributed with a mean of 100 and a standard deviation of 15 (like IQ scores), you can immediately say that about 68% of people score between 85 and 115, and about 95% score between 70 and 130.
Normal distributions appear throughout the real world — heights, blood pressure readings, measurement errors, and many natural phenomena. The 68-95-99.7 rule is why standard deviation is so powerful: it converts a single number into a precise statement about the spread of your data.
Keep in mind: this rule only applies to normal distributions. For skewed datasets (like our income example), standard deviation alone doesn’t tell the full story.
Calculate all of these instantly
Use our free Statistics Calculator →Also useful: Standard Deviation Calculator & Normal Distribution Calculator
Frequently Asked Questions
How do you calculate the mean of a dataset?
Add all values together and divide by the count. For [4, 7, 13, 2, 7, 8, 3, 7, 9, 15], the sum is 75 and there are 10 values, so the mean is 75 ÷ 10 = 7.5. Every value contributes equally to the mean, which is why a single large outlier can pull it significantly.
What is the difference between mean and median?
The mean is the arithmetic average of all values. The median is the middle value when the data is sorted. They measure the same thing — central tendency — but respond differently to extreme values. For symmetric, outlier-free data they’ll be close. For skewed data like income, they diverge meaningfully. The US Census Bureau reports median household income (not mean) precisely because top earners would inflate the average.
How do you calculate standard deviation by hand?
Five steps: (1) find the mean, (2) subtract the mean from each value, (3) square each difference, (4) average those squared differences to get variance — using n−1 for a sample, or n for a population — and (5) take the square root. For our dataset with mean 7.5, the sum of squared deviations is 152.5. Sample variance = 152.5 ÷ 9 = 16.94. Sample standard deviation = √16.94 ≈ 4.12.
What does a high standard deviation mean?
High standard deviation means the data values are spread far from the mean — high variability. Low standard deviation means values cluster tightly around the mean. In investing, standard deviation measures price volatility. In manufacturing, it measures consistency. In test scores, it tells you whether students performed similarly or ranged widely. Context matters: a standard deviation of 10 is high for a dataset ranging 0–20, but low for one ranging 0–1000.
What is the difference between population and sample variance?
Population variance divides by n (all members of the population). Sample variance divides by n−1. The n−1 adjustment — known as Bessel’s correction — corrects for the fact that a sample tends to underestimate the spread of the full population. In practice, use sample variance unless you truly have data on every member of the population you care about.
When should I use median instead of mean?
Use the median whenever outliers or skewness would make the mean misleading. Income and house prices are the textbook cases: a few very high values inflate the mean far above what a typical person earns or pays. The US Census Bureau (2024) puts median US household income at $80,610 — the mean is higher due to top earners. Median is also preferred for ordinal data (like satisfaction ratings on a 1–5 scale) where the arithmetic average has limited meaning.