The median of a collection of values is the middle value when the values are ordered from smallest to largest. If n is odd, the median is the ((n+1)/2)-th value; if n is even, it is typically taken as the average of the two middle values. The median divides the data in half: at least 50% of values are at or below it, and at least 50% are at or above it.

The median is a robust measure of central tendency: unlike the mean, it is not sensitive to outliers. If one value in a dataset is replaced with an extreme outlier, the mean changes dramatically but the median may not change at all. This makes the median preferable for skewed distributions (income data, for example, is typically summarized by median rather than mean).

The median minimizes the sum of absolute deviations Σ |xᵢ − c|, just as the mean minimizes the sum of squared deviations. In a symmetric distribution, mean and median coincide. In a skewed distribution, the median lies between the mean and the mode, closer to the bulk of the data.