How to find the median
- Put the numbers in order from smallest to largest.
- Count the values. Call the count n.
- If n is odd, the median is the value in position (n + 1) ÷ 2.
- If n is even, take the two values in positions n ÷ 2 and n ÷ 2 + 1, add them and divide by 2.
What is the median?
The median is the middle value of a data set when the values are sorted in order. Half of the values are at or below the median and half are at or above it. It is one of the three common averages, along with the mean and the mode.
odd n: median = value in position (n + 1) ÷ 2 | even n: median = (value at n ÷ 2 + value at n ÷ 2 + 1) ÷ 2 How do you find the median of an odd number of values?
Sort the values and take the one in the exact middle. For 15, 3, 8, 22, 10, the sorted list is 3, 8, 10, 15, 22. There are 5 values, so the middle is position (5 + 1) ÷ 2 = 3, and the median is 10.
How do you find the median of an even number of values?
With an even count there are two middle values, so the median is their mean. For 7, 3, 9, 4, 12, 5, the sorted list is 3, 4, 5, 7, 9, 12. There are 6 values, so the middle positions are 3 and 4. Those values are 5 and 7, and the median is (5 + 7) ÷ 2 = 6.
Why use the median instead of the mean?
The median is resistant to outliers. One very large or very small value can drag the mean far away from most of the data, but the median stays near the middle. That is why house prices and incomes are usually reported as medians. In the price list 245, 310, 189, 1250, 275, 330, 298 (thousands of dollars), the one $1,250k house pulls the mean up to 413.857143, while the median is 298.
| Data | n | Median | Mean |
|---|---|---|---|
| 1, 2, 3, 4, 5 | 5 | 3 | 3 |
| 1, 2, 3, 4, 100 | 5 | 3 | 22 |
| 10, 20, 30, 40 | 4 | 25 | 25 |
| 6, 6, 7, 9, 9, 9 | 6 | 8 | 7.666667 |
| -4, -1, 0, 3 | 4 | -0.5 | -0.5 |
Compare the first two rows: changing the 5 to 100 moves the mean from 3 to 22 but leaves the median at 3.
Common mistakes
- Not sorting first. The middle of the list as written is not the median unless the list is already in order.
- Picking one of the two middle values. With an even count, average the two middle values.
- Sorting negatives the wrong way. −8 is smaller than −3, so it comes first.
- Dropping repeated values. Keep every value, including duplicates, when you sort and count.
For the mean, mode, range, quartiles and a box plot of the same data, use the statistics calculator.
Frequently asked questions
How do you find the median?
Sort the numbers from smallest to largest and pick the middle one. If there is an even number of values, the median is the mean of the two middle values. For 7, 3, 9, 4, 12, 5, the sorted list is 3, 4, 5, 7, 9, 12, the middle values are 5 and 7, and the median is 6.
How do you find the median of an even set of numbers?
Sort the values, find the two in the middle (positions n ÷ 2 and n ÷ 2 + 1), add them and divide by 2. With 6 values, the middle ones are the 3rd and 4th. The median does not have to be one of the numbers in the list.
What is the difference between the median and the mean?
The mean adds every value and divides by the count, while the median is the middle value. An outlier moves the mean a lot but barely moves the median. For house prices of 245, 310, 189, 1250, 275, 330, 298 (in thousands), the mean is 413.857143 but the median is 298.
Can the median be a decimal?
Yes. When the two middle values are different, their mean can be a decimal even if every value is a whole number. The median of 1, 2, 3 and 4 is (2 + 3) ÷ 2 = 2.5.
What are Q1 and Q3?
Q1 (the lower quartile) is the median of the lower half of the data, and Q3 (the upper quartile) is the median of the upper half. This calculator uses the median-of-halves method taught in most US schools, which leaves the median out of both halves when n is odd.
Does the median have to be in the data set?
Only when there is an odd number of values. With an even number, the median is halfway between the two middle values, so it may not appear in the list.
Last reviewed November 27, 2026 by the ChalkStation team.