Resources · Education
What Is Median in Math?
The median is the middle value of a data set once the values are sorted. Half sit at or below it, half at or above. This guide covers how to find it for odd and even counts, the position formula, and the comparison that matters most — median against mean, and why one outlier moves one of them and not the other. The mean, median and mode calculator returns all three measures of centre at once.
6 min read
What does median mean in math?
The median is the middle value of a data set once the values are sorted in order. Half the values sit at or below it and half sit at or above it. For 3, 7, 9, 15 and 21 the median is 9, because two values fall below it and two above.
Sorting first is not optional. The median of an unsorted list is not the value sitting physically in the middle of the list as written; it is the middle value by size.
How to find the median
The method depends on whether you have an odd or an even count of values.
- Sort the values from smallest to largest.
- If the count is odd, the median is the single middle value.
- If the count is even, there are two middle values, and the median is the mean of those two.
- Odd count. 3, 7, 9, 15, 21 has five values, so the third is the median: 9.
- Even count. 4, 8, 15, 16, 23, 42 has six, so average the third and fourth: (15 + 16) / 2 = 15.5.
With an even count the median often is not one of the original values, and that is expected. 15.5 does not appear in the set anywhere.
Median vs mean
This is the comparison that matters, and the reason the median exists as a separate measure at all. The mean uses every value; the median only cares about position. Watch what one changed number does:
| Data set | Mean | Median |
|---|---|---|
| 4, 8, 15, 16, 23, 42 | 18 | 15.5 |
| 4, 8, 15, 16, 23, 420 | 81 | 15.5 |
Replacing 42 with 420 moved the mean from 18 to 81 and left the median exactly where it was. The median is robust: it resists extreme values because it is decided by rank, not by magnitude.
That is why incomes, house prices and response times are usually reported as medians. A handful of very large values would drag a mean somewhere no ordinary case resembles. See what mean means in math for the other side of the comparison.
Median, mean and mode together
The three measures of centre answer three different questions about the same data, and choosing between them is the actual skill.
| Measure | Question it answers | Robust to outliers? |
|---|---|---|
| Mean | What if the total were shared equally? | No |
| Median | What is the middle case? | Yes |
| Mode | What is the most common case? | Yes |
For 4, 8, 15, 16, 23, 42 the mean is 18, the median is 15.5, and there is no mode because no value repeats. All three are correct answers to different questions. The companion guides cover what mean means in math and what mode means in math in full.
The median position formula
For larger sets, counting to the middle by eye is unreliable. The position of the median in a sorted list of n values is:
position = (n + 1) / 2
With n = 5 that gives position 3, the third value. With n = 6 it gives 3.5, which is not a position at all — it is the instruction to take the mean of the third and fourth. The half is the formula telling you the count is even.
Common mistakes
- Not sorting first. The median is the middle by value, not the middle of the list as typed.
- Taking one middle value when the count is even. Two middle values means averaging them.
- Dropping duplicates before sorting. Every occurrence counts as its own value.
- Reporting a mean for skewed data when the median is the honest summary.
Quick summary
- The median is the middle value of a sorted set.
- Odd count: the middle one. Even count: the mean of the two middle ones.
- It is robust — an outlier that moves the mean from 18 to 81 leaves it at 15.5.
- Position (n + 1) / 2; a half tells you the count is even.
The mean, median and mode calculator returns the median alongside the mean, the mode and the range.




