Median Calculator

Type or paste your numbers to find the median, the middle value once they are sorted, with every step shown.

Separate with commas, spaces or new lines

What you can type:

  • Lists: 4, 7 10; 12 is four numbers. Commas, spaces, new lines, tabs and semicolons all separate numbers.
  • Pasted columns: 4 ↵ 7 ↵ 10 pasted as a column from Excel, Google Sheets or a CSV file is three numbers.
  • Fractions: 7/10, 3/4 is 0.7 and 0.75. Write a mixed number such as 1 1/2 as 3/2 or 1.5.
  • Decimal commas: 1,5; 2,5 is 1.5 and 2.5. A comma is read as a decimal comma when the numbers are separated by spaces, semicolons or new lines and none uses a decimal point.
  • Thousands: 1,200, 1,500 is 1200 and 1500. Commas before groups of three digits are thousands separators when the numbers are also separated some other way.
  • Percent and currency signs: 12%, $40, €3.50 is 12, 40 and 3.5.
  • Exponents and minus signs: 1e3, −4 is 1000 and -4.
  • Anything else: Score: 4, 7 reads 4 and 7 and names “Score:” as ignored. Words, a header row or a date are never dropped silently: the line under the field names everything that was ignored.

↵ is a new line and ⇥ a tab.

Values used: 12, 5, 3, 8, 21, 7

12, 5, 3, 8, 21, 7

Median 7.5, 6 values.

Worked example for 12, 5, 3, 8, 21, 7.

Median 7.5

Mean
9.3333
Mode
None
Q1 (lower quartile)
5
Q3 (upper quartile)
12
Interquartile range
7
Minimum
3
Maximum
21
Count
6
12538217321Median 7.51253821732110Median 7.5
Each dot is a value.
Show the steps
  1. Sort the values from smallest to largest (6 values):
    1. position 1 3
    2. position 2 5
    3. position 3 7
    4. position 4 8
    5. position 5 12
    6. position 6 21
  2. The count, 6, is even, so the median is the mean of the two middle values, at positions 3 and 4: (7 + 8) ÷ 2 = 7.5
  3. Quartiles: Q1 is the median of the lower half (positions 1 to 3), 5; Q3 is the median of the upper half (positions 4 to 6), 12; IQR = 12 − 5 = 7

Report a problem

How to find the median

  1. Sort the values from smallest to largest.
  2. With an odd count, the median is the value in the middle.
  3. With an even count, the median is the mean of the two values in the middle.

The middle position is (n + 1) ÷ 2, where n is the number of values; for an even count it falls halfway between two positions.

Odd number of values

For 7, 1, 3, 9, 4: sorted, they are 1, 3, 4, 7, 9. There are 5, so the middle is position (5 + 1) ÷ 2 = 3, and the median is 4. Open this example in the calculator.

Even number of values

For 12, 5, 3, 8, 21, 7: sorted, they are 3, 5, 7, 8, 12, 21. There are 6, so the middle falls between positions 3 and 4. The median is the mean of those two values: (7 + 8) ÷ 2 = 7.5. Open this example in the calculator.

Median vs mean

The mean adds up every value, so one very large or very small value pulls it along. The median depends only on the order of the values, so it stays with the bulk of the data. For 10, 12, 13, 15, 16, 18, 100 the mean is 26.2857, pulled up by the 100, while the median, 15, is a fair picture of a typical value. See it in the calculator.

101213151618101815Mean 26.29 →1 value at 100 →101213151618101815▲ 26.29 →1 value at100 →
The one large value pulls the mean away from the other 6, beyond the break, so its ▲ is pinned at the end; the median stays with them.

That is why the median is used for skewed data such as incomes and house prices. When the data is roughly symmetric the two are close, and the mean, which uses every value, is the usual choice. The guide to mean, median and mode compares all three.

Quartiles and the interquartile range

The median splits the sorted values into a lower and an upper half. The lower quartile (Q1) is the median of the lower half and the upper quartile (Q3) the median of the upper half; when the count is odd the middle value is left out of both halves. The interquartile range, Q3 − Q1, is the spread of the middle half of the data. This is the method most textbooks and the TI-84 use; Excel’s QUARTILE.INC interpolates and can give different quartiles.

Median of grouped data

When the data is a frequency table with classes such as 10–20 and 20–30, the median is estimated from the class that contains it:

median ≈ L + ((n ÷ 2 − F) ÷ f) × w

It is an estimate: it assumes the values are spread evenly within the median class.

Related

For the average, use the mean calculator; for the spread, the standard deviation calculator; and for everything at once, with outliers and a box plot, the descriptive statistics calculator.

Common questions

How do you find the median of an even number of values?

Sort them and take the mean of the two in the middle. For 12, 5, 3, 8, 21, 7 the sorted values are 3, 5, 7, 8, 12, 21; the middle two are 7 and 8, so the median is 7.5.

Does the median have to be one of the numbers?

Not when the count is even: the median is then halfway between the two middle values, which may not appear in the data. When the count is odd it is always the middle value itself.

What if some numbers repeat?

Keep every repeat in the sorted list. For 2, 3, 3, 3, 9 the middle value is the third, 3.

Is the median the same as the average?

No. “Average” usually means the mean: the sum divided by the count. The median is the middle value. They are close for symmetric data and can be far apart when a few values are very large or very small.

How do I calculate this in Excel or Google Sheets?

Use =MEDIAN(A1:A20) with your own range, in Excel or Google Sheets. It sorts the values for you and averages the two middle ones when the count is even, as this calculator does. For quartiles, Excel’s QUARTILE.INC interpolates, so it can differ from the quartiles here, which are the medians of the two halves.

Cite this page

Median Calculator. https://meancalculator.com/median-calculator.html