Skip to main content
All resources

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

Blake Boege
Blake BoegeFounder, Calculator AnswersPublished August 23, 2026

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.

  1. Sort the values from smallest to largest.
  2. If the count is odd, the median is the single middle value.
  3. 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:

Mean and median compared before and after an outlier
Data setMeanMedian
4, 8, 15, 16, 23, 421815.5
4, 8, 15, 16, 23, 4208115.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.

The three measures of centre and the question each answers
MeasureQuestion it answersRobust to outliers?
MeanWhat if the total were shared equally?No
MedianWhat is the middle case?Yes
ModeWhat 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.

Run the numbers

Frequently asked questions

The median is the middle value of a data set after the values are sorted in order. Half the values are at or below it and half at or above. For 3, 7, 9, 15 and 21 the median is 9.

Sort the values from smallest to largest. If the count is odd, take the single middle value. If it is even, take the mean of the two middle values. For 4, 8, 15, 16, 23, 42 that is (15 + 16) / 2 = 15.5.

The mean is the total divided by the count and uses every value. The median is the middle value by rank and ignores magnitude. Replacing 42 with 420 in 4, 8, 15, 16, 23, 42 moves the mean from 18 to 81 while the median stays at 15.5.

Yes, whenever the count is even. The median of 4, 8, 15, 16, 23, 42 is 15.5, which is not one of the six values. With an odd count the median is always one of the values.

Because those distributions have long right tails. A small number of very high values pulls the mean upward, so a median describes the typical case far better. The median is decided by position, so extreme values cannot drag it.

Position = (n + 1) / 2 in a sorted list of n values. For n = 5 that gives position 3. For n = 6 it gives 3.5, which means average the third and fourth values.

Always. The median is the middle value by size, not the value sitting in the middle of the list as it was written. Skipping the sort is the single most common error.

Not usually. Average is a general word for any measure of centre, and the median is one of them, but in everyday speech average almost always means the arithmetic mean. The two coincide only when the data is symmetric.