Calculator Problems

How to Find the Median of a Set of Numbers

The median is the middle value in an ordered data set. It is often useful when a few unusually high or low values would make an average less representative.

Last updated: 2 November 2026

Open Median Calculator →

Step-by-step

  1. Collect the numbers in your data set.
  2. Arrange the values from smallest to largest.
  3. If there is an odd number of values, select the middle value.
  4. If there is an even number of values, calculate the mean of the two middle values.
  5. Check that every intended value was included exactly once.

Median formula for even-sized data

When the number of observations is even, add the two central values and divide their sum by two. For an odd-sized set, the median is the single central value after sorting.

Median versus average

The arithmetic mean uses every value and can be pulled by extreme values. The median depends on the middle position, so it can better represent skewed data such as home prices or response times.

Worked examples

For 3, 9, 1 and 7, sorting gives 1, 3, 7, 9. There are four values, so the median is the mean of 3 and 7, which is 5.

With an outlier the difference is clear. For 20, 22, 25 and 500, the mean is 141.75 but the median is 23.5, which describes the typical value far better.

USE THE TOOL

Finish the task with DevUtilityKits

Use the relevant online utility, check the result, and continue with your development workflow.

Open Median Calculator →
FAQ

Frequently asked questions

Do I need to sort numbers to find the median?

Yes. Sort the values first so the middle position can be identified correctly.

What if two values are in the middle?

For an even number of observations, average the two middle values to get the median.

When is the median better than the mean?

Use the median for skewed data or data with outliers, such as incomes, home prices or response times.

What is the median of an even number of values?

The mean of the two middle values after sorting.