The median is the value that splits an ordered dataset into two equal halves.
Exactly fifty percent of the observations lie below or equal to the median, and fifty percent lie above or equal to it.
To determine the median, observations must first be sorted in ascending order from lowest to highest.
When the sample size n is odd, the median occupies the exact rank position calculated as n plus one divided by two.
For example, given the five sorted values twelve, fifteen, nineteen, twenty-four, and eighty, the median is nineteen.
When the sample size n is even, no single middle observation exists in the sequence.
In that case, analysts average the two middle values located at position n divided by two and position n divided by two plus one.
For example, given four sorted values of ten, twenty, thirty, and forty, the median is twenty-five.
The median possesses a breakdown point of fifty percent, meaning nearly half the dataset can be corrupt before the median collapses.
Unlike the mean, which minimises squared deviations, the median minimises the sum of absolute deviations across all observations.
This mathematical trait makes the median the natural objective function in robust regression and L1 error estimation.
In skewed distributions, such as household net worth or software response latency, the median provides a stable typical value.
However, the median has limitations: it is less mathematically tractable than the mean when combining independent subgroups.
Computing medians on massive streaming datasets requires sorting or specialised approximate quantile algorithms.
Analysts should report both mean and median together, because the gap between them exposes the extent of distributional skew.