Median Calculator

Median of any number list, with count, sorted middle, and mean.

Math and PercentUpdated 2026-10-112 min read
Median Calculator
Commas, spaces, or new lines between numbers.
Median
...
Count...
Mean...

What it does

The median is the middle rank of sorted data: half the values sit below it and half above. One billionaire joins a room of interns and the mean salary explodes while the median barely moves, which is why pay and house reports lead with it.

The tool above takes numbers separated by commas, spaces, or new lines. It returns the median with the count and the mean beside it. The default 3, 7, 7, 2, 5, 9 sorts to 2, 3, 5, 7, 7, 9 with median 6 and mean 5.5.

Rules match NIST and OpenStax statistics texts: odd counts take the value at (n+1)/2, even counts average the two middles. Worked checks agree, from 1, 2, 3, 4 at 2.5 to the 40 value set centering on 24.

Location shorthand speeds hand work: with 100 values the median sits midway between the 50th and 51st, and with 97 it is exactly the 49th. Sorting is the whole job; everything after is reading a position.

How to use

  1. Paste or type the numbers in any order.
  2. Separate with commas, spaces, or new lines.
  3. Read median first, count beside it.
  4. Compare mean to spot skew or outliers.
  5. For hand checks, sort and count to the middle.
  6. Keep units consistent across the list.

Formula

Sort ascending. Odd n: median is value at (n+1)/2. Even n: mean of values at n/2 and n/2 + 1.
n
Count of values in the list.
(n+1)/2
Median rank; halves mean two middles.
mean
Sum over n, shown for skew contrast.

Decimals, negatives, and repeats all sort normally. A single value list returns itself as the median.

Worked example

Example: 3, 7, 7, 2, 5, 9

Default list of 6 values.

  1. Sort: 2, 3, 5, 7, 7, 9.
  2. Count: n is 6, even.
  3. Middles: 3rd is 5, 4th is 7.
  4. Median: (5 + 7) / 2 = 6.
  5. Mean check: 33 / 6 = 5.5.
  6. Tool shows 6, 6 values, 5.5.

Reference table

Checked median cases
ListSorted middleMedian
1, 2, 3, 42 and 32.5
2, 3, 5, 7, 73rd is 55
3, 7, 7, 2, 5, 95 and 76
97 values49th valueMiddle rank
100 values50th and 51stMean of both

Limits

  • Ranks only; gaps between values ignored.
  • Multimodal data needs modes too.
  • Text and blanks rejected, not guessed.
  • Lists cap at 10,000 values.

Common mistakes

  • Averaging without sorting first.
  • Taking the middle of unsorted entry order.
  • Reporting mean when skew rules.
  • Dropping repeats that hold ranks.
  • Mixing units inside one list.

Try it yourself

Quick checks. Answers sit tucked under each question.

Median of 1, 2, 3, 4?

(2 + 3) / 2 = 2.5.

Median of 2, 3, 5, 7, 7?

5, the 3rd of 5 sorted.

Letters in the box?

Rejected: numbers separated by commas, spaces, or lines only.

Questions

What is the default median?

6 for 3, 7, 7, 2, 5, 9.

Odd or even rule?

Odd takes the center; even averages the two middles.

Median or mean?

Median resists outliers; mean uses every value. Report both when skew looms.

Location shortcut?

(n+1)/2: 50.5 for 100 values, 49th for 97.

Single value?

It is its own median.

Separators allowed?

Commas, spaces, semicolons, and new lines.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.