What this calculator does
The median is the middle value of a data set once it has been sorted from smallest to largest: half the values sit at or below it, and half sit at or above it. This median calculator sorts whatever numbers you enter, picks out that middle value (or averages the two middle values, if there is an even count), and shows the position used so the working is visible.
The median is often preferred over the mean when a data set has extreme values or a skewed shape, because a single very high or very low number can drag the mean a long way from where most of the data actually sits, while the median barely moves. This calculator shows both figures side by side so that difference is easy to see for a given data set.
The formula
Sort the values from smallest to largest. If the count is odd, the median is the single middle value. If the count is even, the median is the average of the two middle values. The mean is shown alongside as a simple sum-divided-by-count for comparison.
| Term | Meaning |
|---|---|
| Median | The middle value of the sorted data, or the average of the two middle values when the count is even. |
| n | The number of data points entered. |
| Mean | The arithmetic average: sum of all values ÷ n, shown here for comparison against the median. |
The inputs explained
| Field | What to enter |
|---|---|
| Data (comma or space separated) | Your list of numbers, separated by commas, spaces or line breaks; any mix works. |
When to use it
Summarising typical income or price data
Income, house prices and similar figures are usually skewed by a small number of very high values, so the median is the standard way to describe a "typical" figure without one outlier distorting it.
Comparing the median to the mean
Running the same data set through this calculator and a mean calculation shows at a glance how far apart the two are, which is itself a useful signal of how skewed the data is.
Finding the middle result in a small sample
For a small, informal data set, such as response times or scores from a handful of trials, the median gives a quick, outlier-resistant summary without needing the fuller spread of a descriptive-statistics workup.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
What is the median for a range of small data sets?
The median and mean for a spread of small data sets, from three points to seven.
| Data entered | Median | Mean, for comparison |
|---|---|---|
| 1,2,3 | 2.000 | 2.000 |
| 1,2,3,4 | 2.500 | 2.500 |
| 4,8,15,16,23,42,8 | 15.000 | 16.571 |
| 2,4,6,8,10 | 6.000 | 6.000 |
| 1,1,1,1,100 | 1.000 | 20.800 |
| 10,20,30,40,50,60 | 35.000 | 35.000 |
How does the median change as one value in the set grows?
A base set of 10, 12, 13, 14, 15, with the sixth value increased from 20 up to 50,000.
| Data entered | Median | Mean, for comparison |
|---|---|---|
| 10,12,13,14,15,20 | 13.500 | 14.000 |
| 10,12,13,14,15,50 | 13.500 | 19.000 |
| 10,12,13,14,15,100 | 13.500 | 27.333 |
| 10,12,13,14,15,500 | 13.500 | 94.000 |
| 10,12,13,14,15,5000 | 13.500 | 844.000 |
| 10,12,13,14,15,50000 | 13.500 | 8,344.00 |
Questions
What is the median, in plain terms?
It is the value in the middle once every number is lined up in order, so exactly as many values fall below it as above it (or as close to that as an even count allows). It answers "what is typical" without letting one extreme number skew the answer.
How do I calculate the median by hand?
Sort the numbers from smallest to largest. If there is an odd count, take the single middle value. If there is an even count, take the two middle values and average them. This calculator does exactly that, and shows which position or positions were used.
How do I find the median when two numbers tie in the middle?
Ties are handled the same way as any other values: they are simply sorted along with everything else, and if the tied numbers land in the middle position, they are used (or averaged with their neighbour) exactly as any other middle value would be.
Should I use the median or the mean?
Use the median when the data set has outliers or a skewed shape you do not want distorting the summary, such as income or property prices. Use the mean when the data is roughly symmetric and every value should count toward the average without dampening extreme ones.
For the mean, mode, standard deviation and quartiles from the same data set in one pass, see the descriptive statistics calculator.