StatGardenREF. DESK
Calculators/Statistics/Median Calculator
Statistics

Median Calculator calculator

The middle value of a data set, sorted, with the position(s) used shown.

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

FormulaMedian = middle value of the sorted data (average of the two middle values if n is even)

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.

TermMeaning
MedianThe middle value of the sorted data, or the average of the two middle values when the count is even.
nThe number of data points entered.
MeanThe arithmetic average: sum of all values ÷ n, shown here for comparison against the median.

The inputs explained

FieldWhat 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.

Six example data sets
Data enteredMedianMean, for comparison
1,2,32.0002.000
1,2,3,42.5002.500
4,8,15,16,23,42,815.00016.571
2,4,6,8,106.0006.000
1,1,1,1,1001.00020.800
10,20,30,40,50,6035.00035.000
For a symmetric, evenly spread set like 2, 4, 6, 8, 10 the median and mean are identical at 6.000. For 1, 1, 1, 1, 100 the median stays at 1.000 (the middle of four low values and one high one), while the mean is pulled up to 20.800 by that single outlier.

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.

Five values held fixed, the sixth increased
Data enteredMedianMean, for comparison
10,12,13,14,15,2013.50014.000
10,12,13,14,15,5013.50019.000
10,12,13,14,15,10013.50027.333
10,12,13,14,15,50013.50094.000
10,12,13,14,15,500013.500844.000
10,12,13,14,15,5000013.5008,344.00
The median holds steady at 13.500 across every row here, since it only depends on the two middle-ranked values, both unchanged. The mean, by contrast, climbs from 14.000 to 8,344.00 as that single sixth value grows, which is exactly why the median is described as resistant to outliers.

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.