The median is the value that splits an ordered dataset into two equal halves: half of the observations are less than or equal to it and half are greater than or equal to it. In statistics, it is a measure of central tendency alongside the mean and the mode, and it is identical to the 50th percentile.
Its defining property is robustness. Because the median depends only on the order of values and not on their magnitude, a few extreme outliers barely move it, which makes it the preferred summary for skewed quantities such as income, house prices, response times and waiting times.
How the median is calculated
To compute the median, sort the values in ascending order and locate the middle position. With an odd number of observations n, the median is the value at position (n + 1) / 2. With an even number, it is conventionally the average of the two middle values.
For grouped data in a frequency table, the median is estimated by linear interpolation within the median class, the interval where the cumulative frequency crosses half of the total. Statistical software also offers several quantile definitions that can return slightly different medians for small even-sized samples.
The following worked cases show how the rules apply.
| Dataset | Sorted values | Median | Rule applied |
|---|---|---|---|
| Odd count | 3, 5, 8, 9, 14 | 8 | Middle value at position 3 |
| Even count | 2, 4, 7, 10 | 5.5 | Average of 4 and 7 |
| With an outlier | 3, 5, 8, 9, 1400 | 8 | Outlier does not change the middle |
| Ties | 4, 6, 6, 6, 9 | 6 | Repeated values count individually |
Median, mean and mode compared
The three classic measures answer different questions. The mean balances all values and uses every magnitude, the median marks the typical middle position, and the mode reports the most frequent value. Their relative positions reveal the shape of a distribution.
| Measure | Definition | Sensitivity to outliers | Best suited for |
|---|---|---|---|
| Median | Middle of ordered values | Very low | Skewed data, ordinal scales |
| Mean | Sum divided by count | High | Symmetric data, totals and further modeling |
| Mode | Most frequent value | None | Categorical data, peaks |
| Trimmed mean | Mean after cutting tails | Moderate | Compromise between mean and median |
In a right-skewed distribution, a long tail of high values pulls the mean above the median, as with salaries. In a left-skewed distribution, the mean falls below it. When mean and median are close, the data is roughly symmetric, although that alone does not prove normality.
Robustness and statistical properties
Robustness is measured by the breakdown point, the share of observations that can be corrupted arbitrarily before the estimate becomes meaningless. The median has the maximum possible breakdown point of 50 percent, while a single extreme value can push the mean anywhere, giving it a breakdown point of essentially zero.
The median also minimizes the sum of absolute deviations, whereas the mean minimizes the sum of squared deviations. This is why median regression, a special case of quantile regression, is used when errors are heavy-tailed. The robust spread measure that pairs naturally with the median is the median absolute deviation (MAD) or the interquartile range.
The price of robustness is lower efficiency on clean normal data. For large normally distributed samples, the median’s sampling variance is about 1.57 times that of the mean, so it needs more observations for the same precision.
| Property | Median | Mean |
|---|---|---|
| Breakdown point | 50 percent | Effectively 0 percent |
| Loss it minimizes | Absolute deviations | Squared deviations |
| Natural spread measure | IQR or MAD | Variance or standard deviation |
| Efficiency on normal data | About 64 percent | Reference, 100 percent |
| Combining group results | Not directly possible | Weighted average of group means |
Using the median in analysis
The median is the standard summary for household income, property prices, latency and durations, where long right tails are normal. In performance monitoring it appears as p50, usually reported next to higher percentiles such as p95 and p99 that capture tail behavior.
For uncertainty, a bootstrap confidence interval is a reliable general method, and the Wilcoxon signed-rank and Mann-Whitney tests are common nonparametric tools when comparing location without assuming normality. Survival analysis reports the median survival time, because many subjects have not yet experienced the event.
| Situation | Preferred summary | Reason |
|---|---|---|
| Income or wealth | Median | Few very high values distort the mean |
| Budget totals or forecasts | Mean | Mean times count gives the total |
| Ordinal survey ratings | Median | Intervals between categories are not equal |
| Symmetric measurement errors | Mean | More efficient estimate |
| Web response times | Median plus tail percentiles | Shows typical and worst experience |
Common mistakes with the median
- Averaging medians of subgroups to obtain an overall median, which is generally wrong; the median must be recomputed from the combined data.
- Reporting the median alone without a spread measure, hiding whether values cluster tightly or vary widely.
- Forgetting to sort or including missing values coded as zero, which shifts the middle position.
- Assuming the median is the most common value, which is the definition of the mode.
- Comparing medians computed with different quantile definitions across tools on small samples.
In simple terms
The median is the value in the middle once everything is lined up from smallest to largest. If eleven people stand in a row ordered by height, the median height belongs to the sixth person.
Its big advantage is that a few extreme values cannot pull it away. If a billionaire joins a room of teachers, the average income in the room jumps enormously, but the median income hardly changes. That is why the median often describes what is typical better than the average does.
A practical example
A city housing office publishes a quarterly report on apartment sale prices. In one district, 240 apartments were sold, most between 180,000 and 320,000 in local currency, but three luxury penthouses sold for more than 2 million each.
The mean price comes out at about 290,000, higher than what most buyers actually paid, while the median price is 238,000. The office reports the median as the headline figure, adds the interquartile range from 205,000 to 271,000, and lists the mean separately for completeness.
Readers comparing districts now see a stable, representative price level that does not jump from quarter to quarter simply because a few exceptional properties happened to sell.