Imagine you and your friends compare how much pocket money you get, and one friend happens to be very rich. The average would make everyone look rich. The value right in the middle gives a fairer picture of what's typical — and that middle value is the median.
The median is the value in the middle of the data once it is lined up from smallest to largest. Half the values sit below it and half sit above. It answers a different question from the mean: not "what is the fair share?" but "what is the value right in the middle of the pack?"
Imagine a class lined up shortest to tallest. The child standing exactly in the centre of the line is the median height — there are just as many shorter children on one side as taller children on the other.
Here are five animals sorted from shortest to tallest:
Two animals are shorter than the dog and two are taller, so the dog in the middle is the median. Notice we did not have to know any exact heights — the median is about position in the sorted line, not about adding anything up.
The median lives in the middle of the sorted list, so you must sort the data first. The middle of the unsorted list means nothing.
Worked example (odd count). Find the median of
First sort from smallest to largest:
There are five values, so the middle one is the 3rd. The median is
With an even number of values there is no single middle value — there are two. The median is then the mean of those two middle values (add them and halve).
Worked example (even count). Find the median of
Sort them:
The two middle values are
The median does not have to be one of the original numbers — here it is
Below is a row of numbers already sorted from smallest to largest. The tile in the very middle is highlighted — that is the median. Count from each end and you will reach it at the same time. Press Refresh for a brand-new row.
The median's superpower is that it is robust: because it only cares about the middle position, one wild value at an end barely moves it. The mean, where every value gets a vote, is dragged along instead. That is why incomes and house prices are usually reported as medians — a single billionaire would yank the mean upward, but the typical person's experience is captured far better by the middle value.
Five pets. Four are small and one is enormous:
The mean weight would be huge — the rhino drags it up so far that it no longer describes any of the small pets. But the median is just the middle animal, so it stays sensibly small. Swap the rhino for an even bigger elephant and the median does not budge at all.
Drag the orange point toward an extreme. Two lines track the data: the mean chases the outlier, while the median barely flinches — it stays anchored at the middle of the sorted values. This is exactly why incomes and house prices are usually reported as medians.