Skip to content
Statculator
Descriptive Statistics

Median Calculator

Free median calculator and median finder. Enter numbers in any order to get the median with steps, the sorted list with the middle highlighted, and the mean.

Free, no sign-up Runs in your browserBy Hira Noor, BS MathematicsUpdated

Try
8 values

Enter the values in any order; the calculator sorts them for you.

Results

Median
300
Average of positions 4 and 5
Middle position, (n + 1) / 2
4.5
Count, n
8
Odd or even count
even
Two middle values
290 and 310
Mean (for comparison)
318.75
Mean − median
18.75
Values below / above the median
4 / 4
Minimum, maximum
180, 500

Interpretation: Half of the values are at or below 300 and half are at or above it. The mean is 318.75, 18.75 above the median, so large values are pulling the mean up while the median stays with the bulk of the data.

Sorted data

PositionValueEntered as #Part of the data
11802lower half
22306lower half
32703lower half
42908middle
53107middle
63504upper half
74201upper half
85005upper half

Highlighted: the two middle values, positions 4 and 5. The median is their average.

Step-by-step solution

  1. 1

    Sort the values from smallest to largest

    180, 230, 270, 290, 310, 350, 420, 500
  2. 2

    Locate the middle position

    n = 8 is even, so 4.5 falls halfway between positions 4 and 5.

    (n + 1) / 2 = (8 + 1) / 2 = 4.5
  3. 3

    Average the two middle values

    Median = (290 + 310) / 2 = 600 / 2 = 300
  4. 4

    Check

    The same number of values lie on each side, as they should.

    4 values below 300, 4 values above 300

What is a Median Calculator?

A median calculator (or median finder) sorts your numbers and returns the middle one. With an odd count n, the median is the value in position (n + 1) / 2; with an even count, it is the average of the two middle values. Half the data lie at or below the median and half at or above it, and unlike the mean it is barely moved by outliers.

What the Median Calculator does

Enter a list of numbers in any order. The calculator sorts them, shows the sorted list with the middle position highlighted, and returns the median along with the position rule it used. For an odd number of values you get the single middle value; for an even number you see the two middle values and their average. Each sorted row also shows where that value appeared in your original list, so you can trace any number back. It works as a median finder for any list, sorted or not, from two numbers to several thousand.

The median is the go-to measure of a typical value when the data are skewed or contain outliers: house prices, incomes, rents, waiting times and reaction times are usually summarized by their median. The calculator therefore also shows the mean for comparison and says which way, and how far, the mean is being pulled. If you need the mean, median, mode and range together, use the Mean, Median, Mode Calculator instead; this page is for the median alone, with the full sorted list and position working.

How to use the Median Calculator

  1. Type or paste your numbers into Data values, separated by commas, spaces or new lines. You do not need to sort them, and you can paste a column straight from Excel or Google Sheets.
  2. Read the median and the note underneath, which says whether it is a single middle value or the average of two.
  3. Look at the highlighted rows in the Sorted data table to see exactly which values are in the middle.
  4. Compare the median with the mean in the statistics panel. A large gap means the data are skewed.

How to calculate the median by hand

To calculate the median of a data set, follow three steps, whatever its size:

  1. Sort the values from smallest to largest.
  2. Count the values to get n, then find the middle position, (n + 1) / 2.
  3. Read off the middle value. If (n + 1) / 2 ends in .5, there is no single middle value, so average the two values on either side of it.

Median with an odd number of values

Take the seven values 14, 3, 9, 21, 7, 12, 5. Sorted, they are 3, 5, 7, 9, 12, 14, 21. The middle position is (7 + 1) / 2 = 4, and the 4th value is 9. Three values lie below 9 and three above it, so 9 is the median.

With an odd count, the median is always one of the data values. Click Odd count in the examples above the calculator to see this data set worked through.

Median with an even number of values

Take the ten values 3, 7, 2, 4, 7, 5, 7, 1, 8, 8. Sorted, they are 1, 2, 3, 4, 5, 7, 7, 7, 8, 8. The middle position is (10 + 1) / 2 = 5.5, so the median lies halfway between the 5th value (5) and the 6th value (7): (5 + 7) / 2 = 6.

With an even count, the median can be a number that is not in the data, as 6 is here. The same rule gives the median of 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10: the 5th and 6th values are 5 and 6, so the median is 5.5.

What is the median of the following numbers? Quick examples
DataSortednMedian
40, 30, 10, 7, 5, 3, 2, 2, 11, 2, 2, 3, 5, 7, 10, 30, 409 (odd)5
45, 52, 38, 61, 4438, 44, 45, 52, 615 (odd)45
19, 44, 16, 26, 1212, 16, 19, 26, 445 (odd)19
12, 16, 0, 8, 31, 28, 170, 8, 12, 16, 17, 28, 317 (odd)16
82, 85, 85, 9082, 85, 85, 904 (even)(85 + 85) / 2 = 85
82, 91, 88, 9382, 88, 91, 934 (even)(88 + 91) / 2 = 89.5
26, 30, 24, 32, 32, 31, 27, 2924, 26, 27, 29, 30, 31, 32, 328 (even)(29 + 30) / 2 = 29.5

Median formula

Sort the data so that x₍₁₎ ≤ x₍₂₎ ≤ … ≤ x₍ₙ₎. Then:

Position of the median
position = (n + 1) / 2
n odd
median = x₍(n+1)/2₎
n even
median = [ x₍n/2₎ + x₍n/2 + 1₎ ] / 2
Formula symbols
SymbolMeaning
nnumber of values
x₍ₖ₎the k-th smallest value (the k-th value after sorting)

A common slip is to use n / 2 as the position. For n = 7, n / 2 = 3.5, but the middle value is the 4th one: (7 + 1) / 2 = 4. For data already grouped into classes, the median is estimated by interpolation; the Grouped Data Mean Calculator does this for a frequency table.

These definitions follow the NIST/SEMATECH e-Handbook of Statistical Methods, Measures of Location.

Worked example

Worked example: weekly rents

Problem. Eight listings quote weekly rents of $420, $180, $270, $350, $500, $230, $310 and $290. What is the median rent?

  1. 01Sort: 180, 230, 270, 290, 310, 350, 420, 500.
  2. 02Position: (8 + 1) / 2 = 4.5, so the median lies halfway between the 4th and 5th values.
  3. 03The 4th value is 290 and the 5th is 310.
  4. 04Median = (290 + 310) / 2 = 300.
  5. 05For comparison, the mean is 2,550 / 8 = 318.75, pulled up by the $500 and $420 listings.

Answer. The median weekly rent is $300: four listings are cheaper and four are more expensive. The mean of $318.75 is higher because the two priciest listings stretch the upper end.

How to find the median between two numbers

With only two numbers, both of them are the middle values, so the median between two numbers is their average: (a + b) / 2. The median of 14 and 27 is (14 + 27) / 2 = 20.5, which is also the midpoint halfway between them on the number line. Enter the two numbers in the calculator above to check any pair.

Median vs mean vs mode

All three describe the center of a data set, but they answer slightly different questions. In symmetric data they are close together; in skewed data the mean is pulled toward the long tail while the median stays with the bulk of the values. To get all three at once, use the Mean, Median, Mode Calculator; for the mean alone, use the Mean Calculator; for the most frequent value, the Mode Calculator.

Median, mean and mode compared
MeasureHow to find itAffected by outliers?Best for
MedianMiddle value when sortedBarelySkewed data: incomes, house prices, rents, waiting times
MeanSum ÷ countYes, stronglySymmetric numeric data, totals
ModeMost frequent valueNoCategories and the most common value

Median symbol and notation

There is no single universal symbol. The sample median is most often written x̃ (x-tilde) or M, and sometimes Md or Med. In formulas, the sorted values are written with bracketed subscripts, x₍₁₎ ≤ x₍₂₎ ≤ … ≤ x₍ₙ₎, so x₍₄₎ means the 4th smallest value. Because the median is the 50th percentile, it is also written Q₂ (the second quartile) or P₅₀; see the Quartile Calculator and Percentile Calculator.

How to calculate the median in Excel or Google Sheets

Put the values in one column, for example A2:A11, and type =MEDIAN(A2:A11). Excel and Google Sheets sort the values internally, so the data do not need to be in order, and they return the same result as this calculator, including the average of the two middle values for an even count.

MEDIAN skips empty cells and text but counts zeros, so a blank and a 0 give different answers. To check a spreadsheet, paste the same column into the calculator above and compare.

Common use cases

  • Prices and incomes: median house prices, rents and household incomes are standard because a few very high values would distort the mean.
  • Waiting and response times: service levels and app response times are often reported as medians (the 50th percentile).
  • Test and exam scores: the median score shows where the middle student sits, even when a few very low or very high marks skew the class average.
  • Ordinal data: survey ratings such as 1 to 5 stars have a meaningful middle even when averaging them is questionable.
  • Robust summaries: report the median with the IQR or median absolute deviation for data with outliers.

Assumptions and limitations

  • The median ignores how far the extreme values are from the center; two datasets with the same median can have very different tails. Look at the five-number summary for the full picture.
  • For symmetric data without outliers, the mean is a more efficient estimate of the center, meaning it varies less from sample to sample.
  • Medians cannot be combined like means: the median of a combined dataset is not the average of the group medians. Recompute from all the values.
  • For data grouped into class intervals, the exact median is unknown; it can only be estimated by interpolation.

Frequently asked questions

How do you calculate the median of a set of numbers?

Sort the numbers from smallest to largest and find the middle one. If there is an odd number of values, the median is the value in position (n + 1) / 2. If there is an even number, it is the average of the two values in the middle.

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

Sort the values, take the two in the middle (positions n / 2 and n / 2 + 1) and average them. For 3, 5, 8 and 10 the middle values are 5 and 8, so the median is (5 + 8) / 2 = 6.5.

How do you find the median between two numbers?

Add the two numbers and divide by 2. With two values, both are middle values, so their average is the median. The median of 14 and 27 is (14 + 27) / 2 = 20.5, the point halfway between them.

When should you use the median instead of the mean?

Use the median when the data are skewed or contain outliers, such as incomes, house prices, rents or waiting times, and for ordered ratings such as 1 to 5 stars. Use the mean for roughly symmetric numeric data, or when you need a total, because the mean times n gives back the sum.

Why is the median better than the mean for skewed data?

The median depends only on the order of the values, not on how large the extremes are. Replacing the largest income in a sample with a billion dollars changes the mean enormously but leaves the median exactly where it was, so the median keeps describing a typical member of the group.

Is the median the same as the 50th percentile?

Yes. The median is the 50th percentile and the second quartile (Q₂): half of the data fall at or below it. Different percentile methods agree on the median even though they can disagree on other percentiles such as Q₁ and Q₃.

Can the median be a value that is not in the data?

Yes, when the number of values is even and the two middle values differ. The median of 10, 20, 30 and 40 is 25, which is not one of the data values. With an odd number of values, the median is always one of the data values.

What is the symbol for the median?

The sample median is usually written x̃ (x-tilde) or M, and sometimes Md. Because the median is the 50th percentile and the second quartile, you will also see it written as P₅₀ or Q₂.

How do you find the median of grouped data?

Find the median class, the class containing the (n / 2)-th value, then interpolate: median ≈ L + ((n / 2 − F) / f) × h, where L is the lower boundary of the median class, F the cumulative frequency before it, f its frequency and h the class width. The Grouped Data Mean Calculator does this for a frequency table.

Cite this page

Statculator. (2026, November 14). Median Calculator. Retrieved November 14, 2026, from https://statculator.com/descriptive-statistics/median-calculator/