Median Calculator
Median of any number list, with count, sorted middle, and 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
- Paste or type the numbers in any order.
- Separate with commas, spaces, or new lines.
- Read median first, count beside it.
- Compare mean to spot skew or outliers.
- For hand checks, sort and count to the middle.
- Keep units consistent across the list.
Formula
- 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.
- Sort: 2, 3, 5, 7, 7, 9.
- Count: n is 6, even.
- Middles: 3rd is 5, 4th is 7.
- Median: (5 + 7) / 2 = 6.
- Mean check: 33 / 6 = 5.5.
- Tool shows 6, 6 values, 5.5.
Reference table
| List | Sorted middle | Median |
|---|---|---|
| 1, 2, 3, 4 | 2 and 3 | 2.5 |
| 2, 3, 5, 7, 7 | 3rd is 5 | 5 |
| 3, 7, 7, 2, 5, 9 | 5 and 7 | 6 |
| 97 values | 49th value | Middle rank |
| 100 values | 50th and 51st | Mean 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
- NIST/SEMATECH e-Handbook: Measures of Location
- OpenStax Introductory Statistics: Measures of the Center