Median Calculator

Find the median of a dataset, with handling for even-count sets by averaging the two middle values, plus count, min, max, and mean.

Share this calculator

15.5

Median

18

Mean

6

Count

Middle values15 and 16
Minimum4
Maximum42
Sum108
Count6

Also in Statistics

Central Tendency

Median — the middle value of a sorted dataset

The median is the value that sits exactly in the middle of a sorted dataset — half the values are below it and half are above. Unlike the mean, the median is not affected by extreme outliers, making it the preferred measure of central tendency for skewed distributions such as household income, house prices, and response times.

How to find the median

Sort the dataset from smallest to largest. If the count is odd, the median is the middle value. If the count is even, the median is the average of the two middle values.

For example, the dataset 3, 7, 8, 12, 15 has five values — the middle value is 8, so the median is 8. For 3, 7, 8, 12, the two middle values are 7 and 8, so the median is (7 + 8) / 2 = 7.5.

Odd n: median = value at position (n + 1) / 2

In a sorted dataset with an odd count, the median is the value at the exact midpoint.

Even n: median = (value at n/2 + value at n/2 + 1) / 2

In a sorted dataset with an even count, the median is the average of the two middle values.

Median versus mean

The mean sums all values and divides by count. A single large outlier can pull the mean far from the typical value. The median, by contrast, depends only on the middle position — outliers have no effect beyond shifting where the middle lies.

This is why median income and median house price are reported instead of averages: in a distribution with a long upper tail (a few very high earners or very expensive properties), the mean overstates what is "typical". The median gives the value that a randomly selected member of the population is equally likely to be above or below.

When to use the median

Use the median when: your data is skewed or has outliers; you are measuring economic data (incomes, prices, costs); response times, wait times, or latencies are involved; or the data is ordinal rather than truly numeric.

The mean is preferred when: the distribution is roughly symmetric without extreme outliers; you need to use the result in further calculations (such as standard deviation, regression, or hypothesis tests); or every data point should genuinely influence the result.

Frequently asked questions

Can there be more than one median?

No — a dataset has exactly one median. For even-count datasets, the median is defined as the average of the two middle values, which is always a single number. Even if that average is not itself a value in the dataset, it is still the unique median.

Is the median always one of the values in the dataset?

Not necessarily. For odd-count datasets, the median is always one of the actual values. For even-count datasets, the median is the average of two middle values, which may or may not appear in the dataset. For example, {1, 2, 3, 4} has median 2.5, which is not in the dataset.

What is the relationship between median and percentiles?

The median is the 50th percentile — the value below which 50% of the data falls. It is also the second quartile (Q2). Percentiles generalise this concept: the 25th percentile (Q1) has 25% of values below it, and the 75th percentile (Q3) has 75% below.

Does sorting order matter for the median?

No — the median is defined on the sorted version of the dataset and gives the same result regardless of the original order. This calculator sorts the values automatically before finding the middle position.

Related

More from nearby categories

These related calculators come from the same leaf category, nearby sibling categories, or the same top-level topic.