Median Calculator

Find the middle value of any dataset — the median is robust against outliers.

← All Statistics Tools

What Is the Median?

The median is the middle value of a dataset when the values are sorted in order. If there is an odd number of values, the median is the single middle value. If there is an even number, the median is the average of the two middle values. Unlike the mean, the median is not affected by extreme outliers, which makes it the preferred measure of center for skewed distributions. For example, in housing prices where a few luxury homes can inflate the average, the median price gives a much more accurate picture of what a typical home costs.

How to Find the Median

  1. Enter your numbers in the text area, separated by commas or spaces.
  2. Read the median in the highlighted purple card — it updates as you type.
  3. Check the sorted list where the median value(s) are highlighted in purple so you can see exactly which position they occupy.
  4. Compare with the mean to gauge whether your data is symmetric or skewed.

How the Median Is Calculated

To find the median manually:

  1. Sort the values from smallest to largest.
  2. If the count is odd, the median is the value at position (n + 1) / 2. For {3, 5, 7, 9, 11}, the median is 7 (the 3rd value out of 5).
  3. If the count is even, the median is the average of the values at positions n/2 and n/2 + 1. For {3, 5, 7, 9}, the median is (5 + 7) / 2 = 6.

This tool handles both cases automatically and highlights exactly which values in the sorted list are used to calculate the median.

Median vs Mean — When to Use Which

The mean and median give the same result when data is perfectly symmetric. They diverge when data is skewed. Use the median when your data has outliers or is skewed — income data, home prices, response times, and any distribution with a long tail. Use the mean when data is roughly symmetric and you want a measure that accounts for every value. For categorical data, neither works — use the mode instead.

Frequently Asked Questions

What happens when there are two middle values?

When the dataset has an even number of values, the median is the average of the two middle values after sorting. For example, in {2, 4, 6, 8}, the two middle values are 4 and 6, so the median is (4 + 6) / 2 = 5. Both values are highlighted in the sorted list.

Can the median be a value not in the dataset?

Yes. When the count is even and the two middle values differ, the median is their average, which may not appear in the original data. For {1, 3, 5, 7}, the median is 4, which is not in the dataset.

Why is the median better for income data?

Income distributions are heavily right-skewed — most people earn moderate amounts, but a small number earn extremely high salaries. These outliers pull the mean upward, making it seem like the typical person earns more than they actually do. The median, being the middle value, is not affected by these extremes and better represents the typical income.

Does the median work with decimal numbers?

Yes. The median calculation works with any numbers — integers, decimals, and negative values. The sorting and position-finding process is the same regardless of the number type.