Skip to main content
MC

Median Calculator

Find the true middle value of any data set, sorted automatically, so outliers cannot skew your result.

Did you like the tool? Thanks!
Share:

How to Use Median Calculator

Enter numbers separated by commas, spaces, or new lines. The calculator sorts them automatically and shows the median (the middle value), the sorted list itself, and the total count, updating live as you edit the input.

About Median Calculator

The median is the middle value of a data set once every number has been arranged in order from smallest to largest. Unlike the mean, which is calculated using every value in a formula, the median only cares about position: it is whichever number sits exactly in the middle of the sorted list. If there is an even number of values, there is no single middle number, so the median is defined as the average of the two values closest to the middle. To find a median by hand, first sort the list. If you have 5, 3, 9, 1, 7, sorting gives 1, 3, 5, 7, 9. With five values (an odd count), the middle position is the third number, which is 5. That is your median. Now suppose you have six values: 1, 3, 5, 7, 9, 11. There is no single middle number, so you average the two values sitting in positions three and four, which are 5 and 7. Their average is 6, so the median is 6. Why does the median matter? Because it is resistant to outliers in a way the mean is not. Go back to the salary example: five employees earning £30,000, £31,000, £32,000, £35,000, and £500,000. Sorted, the middle value (position three) is £32,000. That single number is a far better description of what a "typical" employee earns than the mean of £125,600, which is dragged upward by one unusually high salary. This is exactly why household income statistics, home prices, and similar figures are almost always reported as medians in the news rather than means — a handful of very wealthy households or very expensive properties would otherwise distort the picture. A common misconception is that the median is always close to the mean. That is only true for roughly symmetric data. For skewed data — where a few values are far larger (or smaller) than the rest — the mean and median can diverge substantially, and the gap between them is itself a useful signal: a big gap tells you your data has significant outliers or a heavy tail in one direction. Another misunderstanding is about the even-count case. Some people assume you just pick "one of the two middle numbers," but the correct definition always averages them. If your two middle values are 4 and 10, the median is 7, not 4 or 10. This calculator handles that automatically and also shows you the full sorted list, so you can see exactly which two numbers were averaged (or which single number was chosen, in the odd case) rather than trusting a black box. The median pairs naturally with the mean and mode. Comparing all three, alongside the standard deviation and range, gives a much richer picture of a data set than any single statistic alone — which is exactly what the companion Statistics Calculator on this site computes in one pass.

Details & Tips

**Formula:** Sort all n values from smallest to largest. If n is odd, the median is the value at position (n+1)/2. If n is even, the median is the average of the values at positions n/2 and n/2 + 1. **Worked example 1 (odd count):** Numbers: 4, 8, 15, 16, 23, 42, 8. That is 7 values. Sorted: 4, 8, 8, 15, 16, 23, 42. With 7 values, the middle position is the 4th, which is 15. Median = 15. **Worked example 2 (even count):** Numbers: 4, 8, 15, 16, 23, 42. That is 6 values. Sorted: 4, 8, 15, 16, 23, 42. The two middle positions are the 3rd and 4th values, 15 and 16. Median = (15 + 16) ÷ 2 = 15.5. **How this calculator parses input:** Just like the Average Calculator, numbers can be typed with commas, spaces, or line breaks in any combination, and decimals and negative numbers are fully supported. Non-numeric tokens are silently dropped so a messy paste still works. **Edge cases handled:** - Empty input, or input with no valid numbers, shows a dash (—) rather than a misleading value. - A single number is a valid list — its median is simply itself, and the sorted list shows that one value. - Duplicate values are kept in the sorted list and factored into the middle-position calculation exactly as they should be — duplicates are not removed. - Negative numbers sort correctly (before zero and smaller positives), so a mixed list like -10, 5, -2, 8 sorts to -10, -2, 5, 8. - The sorted list is displayed alongside the median so you can visually verify which value (or pair of values) produced the result. **Practical tip:** Use the median instead of the mean whenever your data might contain outliers — house prices, incomes, response times, and file sizes are classic examples where a handful of extreme values can badly distort an average but barely move the median. A good habit is to compute both: if mean and median are close, your data is roughly symmetric and either statistic works well; if they are far apart, report the median as the more representative "typical" value and consider mentioning the outliers separately. The Mode Calculator and Standard Deviation Calculator on this site are useful next steps for understanding the same data set from different angles.

Frequently Asked Questions

What is the median of a data set?
The median is the middle value once all numbers are sorted in order. If there is an even number of values, it is the average of the two middle numbers.
How is median different from average (mean)?
The mean uses every value in a sum-and-divide formula, while the median only depends on position after sorting, making it far less affected by extreme outliers.
How do you find the median with an even number of values?
Sort the list, take the two values sitting exactly in the middle, and average them. For example, with middle values 6 and 10, the median is 8.
Why use the median instead of the mean?
The median better represents a "typical" value when your data contains outliers, such as one very high salary or one very expensive house in an otherwise ordinary list.
Does the calculator sort my numbers automatically?
Yes, it sorts the entered numbers ascending and displays the sorted list alongside the median so you can verify the result.
Can the median be a number not in my original list?
Yes, when the list has an even count, the median is the average of the two middle values and may not match any single entered number.
Do duplicate numbers affect the median?
Yes, duplicates are kept in the sorted list and count toward the total, so they can shift which value ends up in the middle position.
What is the median of one number?
It is that number itself — a single value is trivially both the smallest, largest, and middle value of its own list.
Are negative numbers handled correctly?
Yes, negative numbers sort correctly relative to zero and positive numbers, and are included in the median calculation as expected.
Is my data sent to a server when I use this calculator?
No, all sorting and calculation happens directly in your browser; nothing is transmitted or stored remotely.
When do median and mean give the same result?
They are equal (or very close) when the data is roughly symmetric with no significant outliers pulling the mean in one direction.

Also Available As

median finder, middle value calculator, statistical median, find median online, sorted median calculator, median vs mean

Found a Problem?

Let us know if something with Median Calculator isn't working as expected.

Thanks — we'll take a look.