Median Calculator
The median is the value that splits your data in half. It is the summary that survives outliers, which is why incomes, house prices and response times are reported this way.
Formula
- x₍ᵢ₎
- = the value at position i in the sorted list
- n
- = the number of values
- IQR
- = Q3 − Q1, the range covering the middle half of the data
Quartiles here use linear interpolation between the two nearest ranks, which is the method used by most statistical software and by spreadsheet QUARTILE functions.
How to use this calculator
- Paste your numbers in any order — sorting is done for you.
- Press Calculate. The median appears with a note saying whether the count was odd or even and how the middle was found.
- Compare the median with the mean shown in the breakdown. A large gap indicates skew.
- Check the outlier note. It applies Tukey's 1.5 × IQR rule, the standard test behind box-plot whiskers.
Worked example
Seven salaries in a small team
Six staff earn between $32,000 and $52,000, and a founder takes $210,000. The mean says the "average" salary is over $64,000 — a figure nobody in the team recognises.
- Sorted: 32k, 35k, 38k, 41k, 44k, 52k, 210k
- n = 7 (odd), middle is position 4
- Median = 41,000
Answer: $41,000 median against a $64,571 mean. The median describes the team; the mean describes the founder.
Why the median resists outliers
The mean multiplies every value by 1/n and adds them, so a value ten times larger than the rest contributes ten times as much. The median only cares about a value's position in the ordering. Change the largest number from $210,000 to $2.1 million and the median does not move at all — it is still the fourth of seven values.
Statisticians call this a high breakdown point: you can corrupt almost half the data set before the median becomes unreliable, whereas a single bad value can move the mean arbitrarily far. That property is why the median is the default for reporting incomes, house prices, wait times and any distribution with a long right tail.
Quartiles and the interquartile range
Quartiles extend the same idea. Q1 is the value below which a quarter of the data falls, Q3 the value below which three quarters falls, and the median is Q2. The interquartile range, Q3 − Q1, describes the spread of the middle half of the data while ignoring both tails entirely.
The IQR is the robust counterpart to the standard deviation. Where standard deviation is inflated by outliers in the same way the mean is, the IQR is not — which makes the median and IQR a matched pair for describing skewed data, just as the mean and standard deviation are for symmetric data.
Detecting outliers with the 1.5 × IQR rule
Tukey's convention flags any value more than 1.5 interquartile ranges below Q1 or above Q3 as a potential outlier. Those fences are exactly what a box plot's whiskers mark, and points beyond them are drawn individually.
The rule identifies candidates, not errors. An outlier may be a typo, a measurement fault, or the single most important observation in the data set. Investigate it; do not delete it because a rule flagged it. The calculator reports flagged values so you know they are there, and leaves the decision to you.
Where different quartile methods disagree
There is no single universal definition of a quartile for small samples. Different textbooks and software packages use at least nine methods, which differ in whether the median is included in each half and how they interpolate between ranks. On a data set of 7 values these can produce visibly different Q1 and Q3.
This calculator uses linear interpolation on the ranks (equivalent to the common "exclusive-of-nothing" method used by most spreadsheet QUARTILE functions and by NumPy's default). For large samples every method converges; for small ones, state which method you used.
Important considerations
- The median requires ordered data, so it cannot be used on unordered categories.
- With an even count the median may not be a value that appears in the data.
- Quartile definitions vary between software packages on small samples.
- The median discards information about how far away the extreme values are.
- For symmetric data with no outliers, the mean is more statistically efficient.
Common mistakes to avoid
- Forgetting to sort. The median is a positional statistic; unsorted data gives a meaningless middle.
- Taking the middle of an even list without averaging. Both central values contribute.
- Deleting flagged outliers automatically. The 1.5 × IQR rule identifies candidates for investigation, not errors.
- Reporting a median without a spread measure. Pair it with the IQR or the range.
- Averaging medians of subgroups. That does not give the median of the combined data.
Frequently asked questions
How do I find the median?
Sort the values from smallest to largest. With an odd count, the median is the middle value. With an even count, it is the average of the two middle values.
Why use the median instead of the mean?
Because the median is not distorted by extreme values. In a team where six people earn around $40,000 and one earns $210,000, the median of $41,000 describes the team accurately while the mean of $64,571 describes nobody.
What is the interquartile range?
Q3 minus Q1 — the range covering the middle 50% of your data. It measures spread while ignoring the extremes, which makes it the natural partner to the median just as standard deviation partners the mean.
Can the median be a number not in my data?
Yes, whenever you have an even count. For 10, 20, 30 and 40 the median is 25, which never appears in the data. That is expected and correct.
What counts as an outlier?
The usual convention flags values more than 1.5 interquartile ranges beyond Q1 or Q3. That identifies points worth investigating — it does not prove they are wrong, and they should never be removed automatically.
Why does my quartile differ from another calculator?
Because there is no single agreed definition of quartiles for small samples; at least nine methods are in use. This tool uses linear interpolation between ranks, matching most spreadsheet and NumPy defaults. The differences vanish as samples grow.
Related calculators
Tools people usually open alongside this one.