Median calculator
Paste or type your numbers and see the median, the first and third quartiles, the mode and the mean straight away. The numbers don't need to be in order.
Separate the numbers with a semicolon, space or new line. Commas work as long as you don't use decimal commas.
Fill in the fields; the answer appears here straight away.
How it's worked out
How it works
-
Enter the values
Type the numbers or the formula. Decimals may use a point or a comma. No idea? Click Fill in an example.
-
Instant answer
The answer appears as you type, with the most important intermediate values.
-
See the working
Under "How it's worked out" you see the steps, handy for checking your own calculation.
What is the median?
The median is the middle number when you put all the numbers in order from smallest to largest. Half of the numbers are smaller (or equal), the other half larger.
- Odd count: the median of 3, 5, 8, 12 and 20 is 8.
- Even count: take the mean of the two middle ones. For 3, 5, 8 and 12 that is (5 + 8) ÷ 2 = 6.5.
Median or mean?
One outlier pushes the mean up, but not the median. If four people earn 2,500 and one earns 25,000, the mean is 7,000 but the median is 2,500. That is why incomes and house prices are usually reported as medians. Only need the mean? Use the average calculator.
Quartiles and box plots
The first quartile (Q1) is the median of the lower half, the third quartile (Q3) that of the upper half. With an odd count, the middle number is left out of both halves. The interquartile range Q3 − Q1 shows how spread out the middle half of the numbers is. Together with the smallest and largest number you have everything for a box plot. Spreadsheets sometimes use a different method for quartiles, so small differences are normal.
Worked example
Take 7, 3, 9, 4, 12, 3, 8 and 5. Sorted: 3, 3, 4, 5, 7, 8, 9, 12. With eight numbers the median is the mean of the 4th and 5th: (5 + 7) ÷ 2 = 6. The lower half is 3, 3, 4, 5, so Q1 = (3 + 4) ÷ 2 = 3.5. The upper half is 7, 8, 9, 12, so Q3 = (8 + 9) ÷ 2 = 8.5. The interquartile range is 8.5 − 3.5 = 5.
Spotting outliers
A common rule flags values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR. In the example the limits are −4 and 16, so every value is inside them; a 40 in the list would not be. Want the spread as one number? The standard deviation calculator gives it, and the mean is in the average calculator.
Frequently asked questions
How do you find the median of an even number of values?
Sort the numbers and take the mean of the two middle ones. For 3, 5, 8 and 12 that is (5 + 8) ÷ 2 = 6.5, a value that is not in the list.
Do the numbers need to be sorted first?
No. Enter them in any order; the calculator sorts them and shows the sorted list so you can check it.
Why does Excel give different quartiles?
Spreadsheets offer several quartile methods, such as QUARTILE.INC and QUARTILE.EXC. This calculator takes the median of the lower and upper half, leaving out the middle number when the count is odd, so small differences are normal.
Is the median or the mean better?
It depends on the data. With outliers or skewed values, such as incomes, the median describes the typical case better. With evenly spread values the two are close.