The median is the middle value of a dataset once the numbers are arranged in order. To find it, sort your data from smallest to largest and apply the median position formula: the median sits at position (n + 1) ÷ 2, where n is the number of values. If n is odd, that position gives you a single middle value; if n is even, you take the average of the two middle values.
When working with data in statistics, one question comes up almost immediately: what does a “typical” value really look like? In the UK education system, from GCSE Maths to A‑level Statistics and university research, students are often taught that averages explain data. But not all averages tell the full story, and that is where the median becomes essential.
Unlike the mean, the median is not distorted by extremely high or low values — a common issue when analysing real‑world data such as household incomes, property prices, exam results, or medical studies. For this reason, the median is widely used by UK statisticians, researchers, and government bodies, including the Office for National Statistics, to present fair and realistic insights. This guide walks through the median formula, worked examples for both odd and even datasets, when to choose the median over the mean, and how it is used in research.
“The median is the value below which 50% of the data lie. It is a useful measure when a distribution is skewed or contains outliers, because it is not affected by extreme values.” — Office for National Statistics, Statistical literacy guidance
What Is the Median?
The median is the middle value in a dataset when all observations are arranged in ascending (or descending) order. Exactly half the values in the dataset fall below the median and half fall above it. It is a measure of central tendency that describes the typical or central value but, unlike the mean, it is not pulled by extreme values at either end of the distribution.
The median is one of three main measures of central tendency, alongside the mean and the mode. Each summarises a dataset with a single representative number, but they answer slightly different questions:
- Mean: the arithmetic average — add every value and divide by the count.
- Median: the middle value of the ordered data — the focus of this guide.
- Mode: the value that occurs most frequently.
Because the median depends only on the rank (position) of values rather than their magnitude, it is described as a robust or resistant statistic — it stays stable even when a dataset contains outliers.
Looking for statistical analysis help?
ResearchProspect to the rescue!
Our expert statisticians can calculate, interpret and report the right measures of central tendency for your dataset — try our statistical analysis service and present your data with confidence.
The Median Formula & How To Calculate It
There is no single arithmetic formula for the median in the way there is for the mean. Instead, you use a position formula to locate the middle value within the ordered data. Follow these three steps.
Step 1: Sort Your Data
Arrange all values from smallest to largest. This step is non‑negotiable — skipping it will almost always give you the wrong answer.
Step 2: Apply the Median Position Formula
Count the number of values, n, and find the median’s position:
- Odd number of values: (n + 1) ÷ 2 lands exactly on one observation — that value is the median.
- Even number of values: (n + 1) ÷ 2 lands halfway between two observations. Take the two middle values — at positions n ÷ 2 and (n ÷ 2) + 1 — and average them.
Step 3: Read Off (or Average) the Middle Value
Identify the value at the calculated position. For an even dataset, add the two middle values and divide by two. The table below shows the formula applied to three datasets.
| Ordered Dataset | n | Step (Position Formula) | Median |
|---|---|---|---|
| 12, 15, 18, 22, 27 | 5 (odd) | Position = (5 + 1) ÷ 2 = 3rd value | 18 |
| 12, 15, 18, 22, 27, 31 | 6 (even) | Average of 3rd & 4th values = (18 + 22) ÷ 2 | 20 |
| 4, 7, 9, 11, 14, 17, 19, 24 | 8 (even) | Average of 4th & 5th values = (11 + 14) ÷ 2 | 12.5 |
Why The Median Is Preferred For Skewed Data
When data is normally distributed, the mean, median and mode are all approximately equal, and the mean works perfectly well. But most real‑world data is not symmetrical. Income, house prices, hospital waiting times and scores on easy tests all tend to be skewed, and in skewed distributions the mean gets dragged towards the long tail.
| Distribution Type | Relationship | When To Use The Median |
|---|---|---|
| Symmetric (normal) | Mean ≈ Median ≈ Mode | Not essential, but harmless |
| Positive skew (right tail) | Mean > Median > Mode | Recommended — the mean is inflated by high outliers |
| Negative skew (left tail) | Mean < Median < Mode | Recommended — the mean is deflated by low outliers |
Median Vs Mean: Which Should You Use?
Here is the key distinction: the mean treats every value as equally important and uses every value’s magnitude, so a single extreme value can swing it significantly. The median depends only on rank, so an outlier barely moves it. A quick comparison:
| Feature | Mean | Median |
|---|---|---|
| What it measures | Arithmetic average of all values | Middle value of ordered data |
| Affected by outliers? | Yes — sensitive | No — resistant/robust |
| Best for | Symmetric data with no extreme values | Skewed data or data with outliers |
| Data type required | Interval or ratio | Ordinal, interval or ratio |
| Uses every value’s size? | Yes | No — only its rank |
Real‑world examples where the median is the fairer summary:
- UK house prices: The median house price in England was around £290,000 in 2023 (ONS), while the mean is substantially higher because multi‑million‑pound properties in London and the South East drag the average upwards.
- NHS waiting times: The median wait for a first outpatient appointment gives a clearer picture of the typical patient’s experience than a mean inflated by a small number of very long waits.
- Student essay grades: If most students score 55–68 and one scores 22, the median is more representative of what the class achieved.
The Median & Levels Of Measurement
The median requires that you can order your data, so it is appropriate for ordinal, interval and ratio data. It is not appropriate for nominal data (unordered categories such as eye colour or nationality), where the mode is the only valid measure of central tendency.
The Median & Measures Of Spread
When you report the median, always pair it with the interquartile range (IQR) — the range covering the middle 50% of the data. The IQR is to the median what the standard deviation is to the mean: it tells your reader how spread out the data is around the central value. You can read more in our guide to the interquartile range and to measures of variability.
Median In Inferential Statistics
The median is the basis in inferential statistics for several important non‑parametric statistical tests — tests used when data does not meet the assumptions of parametric methods. The Mann‑Whitney U, Wilcoxon signed‑rank and Kruskal‑Wallis tests all work with ranked data and are appropriate when your outcome variable is ordinal or skewed. Choosing a median‑based test in these situations protects your conclusions from being distorted by outliers.