---
title: "Mean, Median and Mode Explained, With Examples"
description: "Mean, median and mode explained with worked examples: how to find each, the median of an even set, multiple modes, outliers, frequency tables."
slug: mean-median-mode-explained
canonical: https://learn.modernagecoders.com/blog/mean-median-mode-explained/
date: 2026-09-28
dateModified: 2026-09-28
category: "Mathematics"
tags: ["Maths", "Statistics", "Students", "Averages"]
keywords: ["mean median mode", "mean median and mode explained", "how to find the median", "how to find the mean", "what is the mode in maths", "mean median mode range", "median of even numbers", "which average to use"]
readTime: "9 min read"
author: "Modern Age Coders Team"
---
# Mean, Median and Mode Explained

> Three ways to describe a typical value, each worked through with checked examples, plus the range, frequency tables, and why one extreme value can make the mean misleading.

![Mean, median and mode explained: a dot plot of nine quiz scores with each average marked](/images/blog/mean-median-mode-explained/00-hero.png)

*By Modern Age Coders Team · 2026-09-28 · 9 min read*

**Quick answer:** The mean is the total of the values divided by how many there are. The median is the middle value once the values are sorted, or halfway between the two middle values if there is an even number. The mode is the value that appears most often, and there can be several or none. The range, highest minus lowest, measures spread. Use the median when a few extreme values would distort the mean, which is why pay and house prices are usually reported as medians.

Mean, median and mode are three different ways of answering the same question: what is a typical value in this set of numbers? Each gives a different answer, and each is the right one in different situations. Students often learn the three definitions, get them muddled in exams, and never learn the more useful part: which one to trust when you see an "average" in the news, a pay report or a school result.

This guide explains all three, plus the range, with worked examples calculated by Python's statistics module so every answer is checked. It covers the median with an even number of values, what to do when there is more than one mode, why one very large value can make the mean misleading, and the classic exam question where you work backwards from a mean.

## The three averages, with one set of numbers

Take nine quiz scores out of 10: 7, 9, 6, 9, 5, 8, 9, 4, 3. Here are all three averages and the range, worked out by Python:

**averages.py**

```python
from statistics import mean, median, mode, multimode

scores = [7, 9, 6, 9, 5, 8, 9, 4, 3]
print("sorted:", sorted(scores))
print("mean:  ", round(mean(scores), 2), "  (total", sum(scores), "/", len(scores), "scores)")
print("median:", median(scores), "     (the middle one of 9)")
print("mode:  ", mode(scores), "     (appears", scores.count(mode(scores)), "times)")
print("range: ", max(scores) - min(scores), "     (highest minus lowest)")
```

**Output**

```text
sorted: [3, 4, 5, 6, 7, 8, 9, 9, 9]
mean:   6.67   (total 60 / 9 scores)
median: 7      (the middle one of 9)
mode:   9      (appears 3 times)
range:  6      (highest minus lowest)
```

![Mean, median, mode and range calculated for the scores 7, 9, 6, 9, 5, 8, 9, 4, 3](/images/blog/mean-median-mode-explained/01-definitions.png)

*One data set, three different typical values.*

- **Mean:** add all the values and divide by how many there are. The nine scores add up to 60, and 60 ÷ 9 = 6.67. This is what most people mean by "the average".
- **Median:** sort the values into order and take the middle one. Sorted, the scores are 3, 4, 5, 6, 7, 8, 9, 9, 9. With nine values the middle is the 5th, which is 7.
- **Mode:** the value that appears most often. 9 appears three times, more than any other score.
- **Range:** the highest value minus the lowest. 9 − 3 = 6. The range is not an average. It tells you how spread out the data is.

> **A rhyme that helps in exams**

> "Hey diddle diddle, the median's the middle; you add and divide for the mean. The mode is the one that appears the most, and the range is the difference between." Silly, but students who learn it rarely mix the definitions up.

## Finding the median with an even number of values

When there is an odd number of values, the median is simply the middle one. When there is an even number, there are two middle values, and the median is halfway between them.

**median_and_modes.py**

```python
from statistics import median, multimode

even = [3, 8, 5, 12, 10, 6]
print("sorted:", sorted(even))
print("median:", median(even), "  (halfway between the two middle values, 6 and 8)")

print("modes of [2, 3, 3, 5, 5, 7]:", multimode([2, 3, 3, 5, 5, 7]))
print("modes of [1, 2, 4, 9]:      ", multimode([1, 2, 4, 9]), "  (every value once: no useful mode)")
```

**Output**

```text
sorted: [3, 5, 6, 8, 10, 12]
median: 7.0   (halfway between the two middle values, 6 and 8)
modes of [2, 3, 3, 5, 5, 7]: [3, 5]
modes of [1, 2, 4, 9]:       [1, 2, 4, 9]   (every value once: no useful mode)
```

![Finding the median of an odd-length list and an even-length list, where the median is halfway between the two middle values](/images/blog/mean-median-mode-explained/03-median-even.png)

*With an even count, average the two middle values.*

A quick way to find the middle position: add one to the number of values and halve it. For 9 values, (9 + 1) ÷ 2 = 5, so the 5th value. For 6 values, (6 + 1) ÷ 2 = 3.5, which tells you the median sits between the 3rd and 4th values.

## When there is more than one mode, or none

A data set can have one mode, several modes, or no useful mode at all. The output above shows [2, 3, 3, 5, 5, 7] has two modes, 3 and 5, because both appear twice. This is called bimodal. If every value appears exactly once, there is no meaningful mode. Some textbooks say "no mode" in that case, and it is worth checking which convention your exam board uses.

The mode is also the only average that works for data that is not numbers. You cannot find the mean of favourite colours, but you can say the most popular one is blue.

## Why one extreme value can make the mean misleading

This is the most useful idea in the whole topic, because it explains how "average" figures in the news can mislead. Imagine eight people working in a small company, and then the owner's pay is added to the list. Salaries are in thousands per year:

**outlier.py**

```python
from statistics import mean, median

salaries = [28, 30, 31, 32, 33, 35, 36, 38]        # yearly pay, in thousands
print(f"8 staff:          mean {mean(salaries):6.1f}   median {median(salaries):5.1f}")
salaries.append(400)                               # the owner joins the list
print(f"owner added:      mean {mean(salaries):6.1f}   median {median(salaries):5.1f}")
below = sum(s < mean(salaries) for s in salaries)
print(f"people earning less than the new mean: {below} of {len(salaries)}")
```

**Output**

```text
8 staff:          mean   32.9   median  32.5
owner added:      mean   73.7   median  33.0
people earning less than the new mean: 8 of 9
```

![Effect of one very large salary on the mean and median: the mean jumps while the median barely moves](/images/blog/mean-median-mode-explained/02-outlier.png)

*An outlier drags the mean towards it. The median only cares about the middle.*

One very large value, an **outlier**, pulled the mean from 32.9 to 73.7, while the median only moved from 32.5 to 33.0. After the owner is added, 8 of the 9 people earn less than the mean. Calling 73.7 the "average salary" is technically true and practically useless. This is why official statistics on pay and house prices usually report the median, and why it is worth asking "which average?" whenever you see one quoted.

> **Mean or median: always ask**

> When a figure is described as "the average", it is usually the mean. If the data could contain a few very large values, such as incomes, company sizes or property prices, the median is almost always a better picture of a typical case.

## Working backwards from the mean

A classic exam question gives you the mean and all but one of the values, and asks for the missing one. The trick is to turn the mean back into a total: if the mean of 5 numbers is 12, their total must be 5 × 12 = 60.

**missing_value.py**

```python
# The mean of five numbers is 12. Four of them are 9, 15, 10 and 14. What is the fifth?
known = [9, 15, 10, 14]
total_needed = 12 * 5
fifth = total_needed - sum(known)
print("total must be", total_needed, "-> the fifth number is", fifth)
print("check:", sum(known + [fifth]) / 5)
```

**Output**

```text
total must be 60 -> the fifth number is 12
check: 12.0
```

## Averages from a frequency table

Exam questions often give data as a frequency table rather than a list. The idea is the same, but you multiply each value by how often it occurs before adding. Here are the goals scored in 20 football matches:

| Goals in a match | 0 | 1 | 2 | 3 | 4 |
| --- | --- | --- | --- | --- | --- |
| Number of matches | 3 | 6 | 7 | 3 | 1 |

**frequency_table.py**

```python
# how many goals were scored in 20 matches
goals =   [0, 1, 2, 3, 4]
matches = [3, 6, 7, 3, 1]

total_goals = sum(g * m for g, m in zip(goals, matches))
total_matches = sum(matches)
print("total goals:", total_goals, " matches:", total_matches)
print("mean goals per match:", total_goals / total_matches)

# the median is the average of the 10th and 11th match in order
in_order = [g for g, m in zip(goals, matches) for _ in range(m)]
print("10th and 11th values:", in_order[9], in_order[10], "-> median", (in_order[9] + in_order[10]) / 2)
print("mode:", goals[matches.index(max(matches))], "goals (7 matches)")
```

**Output**

```text
total goals: 33  matches: 20
mean goals per match: 1.65
10th and 11th values: 2 2 -> median 2.0
mode: 2 goals (7 matches)
```

For the mean, multiply each number of goals by its frequency and add: 0 + 6 + 14 + 9 + 4 = 33 goals, over 20 matches, so 1.65. For the median, find the 10th and 11th matches in order by counting through the frequencies. For the mode, find the highest frequency: 7 matches had 2 goals.

## Which average should you use?

![Table comparing when to use the mean, median and mode, with the strength and weakness of each](/images/blog/mean-median-mode-explained/04-which-average.png)

*Each average answers a slightly different question.*

- **Use the mean** when the data has no extreme values and you want every value to count, such as test scores in a class or daily temperatures.
- **Use the median** when a few very large or very small values could distort the picture, such as pay, house prices or waiting times.
- **Use the mode** for categories, or when you want the most common single value, such as the most popular shoe size to stock.

In data science, analysts check all three routinely, because the gap between the mean and the median is itself a clue that the data is lopsided. It is one of many places where school statistics leads straight into real analytics, as our post on [how data analytics helps businesses decide](/blog/data-analytics-math-help-businesses-better-decisions) explains.

> Whenever someone quotes an average, ask which one. The answer tells you a lot about what they want you to believe.

## How we teach it

In our [live online maths classes](/online-maths-tuition), we often show the same problem more than one way until it lands, and averages are a good example: the same data, three answers, and a discussion about which one tells the truth. The approach is described on our [how we teach](/how-we-teach) page. Classes are one to one or in small groups of 5 to 10, for syllabuses from primary to [GCSE](/gcse-maths-tuition-online) and Class 10.

[Book a free maths class](/book-demo) [Book a priority demo](/book-demo)

## Frequently asked questions

**What is the difference between mean, median and mode?**

The mean is the total of the values divided by how many there are. The median is the middle value when the values are sorted. The mode is the value that appears most often. They are three different ways of describing a typical value.

**How do you find the median of an even set of numbers?**

Sort the numbers, find the two values in the middle, add them together and divide by 2. For 3, 5, 6, 8, 10, 12, the middle values are 6 and 8, so the median is 7.

**Can there be more than one mode?**

Yes. If two or more values share the highest frequency, they are all modes. A data set with two modes is called bimodal. If every value appears only once, there is no useful mode.

**Which average is best?**

It depends on the data. The mean uses every value but is pulled by extreme values. The median is better when there are outliers, such as pay or house prices. The mode is best for categories and the most common single value.

**Is the range an average?**

No. The range is the highest value minus the lowest value. It measures how spread out the data is, not what a typical value is, but it is usually taught alongside the averages.

**How do you find a missing number when you know the mean?**

Multiply the mean by the number of values to get the total, then subtract the values you know. If the mean of five numbers is 12, the total is 60, so the missing number is 60 minus the sum of the other four.

**Why do news reports use the median for house prices?**

Because a small number of very expensive homes would pull the mean upwards and make typical prices look higher than they are. The median shows the price of the home in the middle, which is closer to what most people pay.

---

*Source: https://learn.modernagecoders.com/blog/mean-median-mode-explained/*
