Skip to content

Median Formula

All Calculators

The median is the middle value of the sorted data. It answers the question “what does a typical value look like?” without letting one extreme value decide the answer.

The rule

  • Odd count: sort the values, then take the one in the middle position, which is (n + 1) ÷ 2.
  • Even count: sort the values, take the two in the middle, and average them.

Worked example: odd count

For 12, 15, 15, 18, 20 the sorted list is 12, 15, 15, 18, 20. Position (5 + 1) ÷ 2 = 3 holds 15, so the median is 15.

Worked example: even count

For 1, 2, 3, 4 the sorted list is 1, 2, 3, 4. The middle positions are 2 and 3, holding 2 and 3, so the median is (2 + 3) ÷ 2 = 2.5.

Notice that 2.5 is not one of the values in the dataset. That is completely normal: with an even count the median is often a value that was never entered.

Worked example: negative numbers

For −5, −10, 3, 7 the sorted list is −10, −5, 3, 7, because negative numbers sit to the left of zero. The middle positions are 2 and 3, so the median is (−5 + 3) ÷ 2 = −1.

Why sorting matters

Without sorting, the middle of the list you typed means nothing. The order you enter values in never affects the mean, but it decides everything about the median, which is why every median result shows the sorted data beside it.

Common mistakes

  • Forgetting to sort first, and taking the middle of the typed order instead.
  • Taking one of the two middle values instead of averaging them when the count is even.
  • Placing negative numbers after positive numbers. They are smaller, so they come first.
  • Assuming the median must be a whole number. It can be a decimal, including when every value you typed was a whole number.
Scroll to Top