Median Calculator

Median calculator: paste numbers in any order to find the middle value, for odd or even counts, alongside the mean, min, max and count.

Runs in your browser. Files never leave your device.

Use a dot for decimals. Commas, spaces, semicolons and new lines all separate numbers, so you can paste a spreadsheet column.

7.75
Mean (Average)
6.5
Median
3.799671
Std Deviation (population σ, ÷ n)
4.062019
Std Deviation (sample s, ÷ n−1)
14.4375
Variance (population σ²)
16.5
Variance (sample s²)
3
Min
14
Max
8
Count
62
Sum

Use the population figures (÷ n) when your numbers are the whole group; use the sample figures (÷ n−1) when they are a sample used to estimate a larger group. Results are calculated with decimal arithmetic to 60 significant digits and shown to 6 decimal places (6 significant digits for values below 1).

About the Median Calculator

Find the median of a set of numbers: the middle value once they're sorted. Type or paste your data, with a comma, space, semicolon or line break between values, and the median calculator sorts it and picks out the middle, whether the count is odd or even. The median is the figure to use for house prices, incomes, response times and any data where a few extreme values would distort the mean.

There's no need to put the numbers in order first. The results also list the mean, minimum, maximum, count and standard deviation; a big gap between the median and the mean is a quick sign that your data is lopsided.

How to find the median

First the numbers are sorted from smallest to largest. With an odd count, the median is the single value in the middle position. With an even count there are two middle values, and the median is halfway between them: their sum divided by 2. So the median of an even-sized list can be a number that isn't in the data at all.

1. Sort the values from smallest to largest
2. n odd:   median = the value in position (n + 1) ÷ 2
   n even:  median = (value in position n ÷ 2 + value in position n ÷ 2 + 1) ÷ 2

n = how many values there are

Duplicates are kept, negative numbers sort below zero, and the halfway value for an even count is worked out with exact decimal arithmetic: middle values of 0.95 and 1.1 give exactly 1.025.

Because only the middle position matters, the median ignores how far the largest and smallest values stretch. That makes it the usual choice for skewed data, such as incomes or house prices, where the mean is dragged towards a few very high values.

Assumptions and limits

  • Separate values with commas, spaces, semicolons or line breaks (one value per line, as in a pasted spreadsheet column, works too) and write decimals with a dot. Thousands separators split numbers apart (5,000 becomes 5 and 0), and a warning is shown when that seems to have happened.
  • Every entry must be a number. A word, a unit or a symbol such as % or $ shows a message naming it, rather than being skipped silently.
  • A single value is its own median. Up to 100,000 values can be entered.
  • A median of 1 or more is shown to at most 6 decimal places, rounded half up; a median between −1 and 1 keeps 6 significant digits instead, so 0.0000123456 isn't shown as 0.
  • This is the ordinary median of the values you enter. Grouped data from a frequency table, such as 'ages 20 to 29: 14 people', needs an interpolation formula instead.

Worked examples

Odd number of values

3, 9, 4, 7 and 1 sorted are 1, 3, 4, 7, 9. With five values, the third one is in the middle.

Sorted: 1, 3, [4], 7, 9
Median = 4     (mean = 4.8)

Even number of values: house prices

Six homes sold for 210000, 245000, 189000, 1200000, 232000 and 199000. One very expensive house pulls the mean up to about 379,167, while the median stays with the typical home.

Sorted: 189000, 199000, [210000, 232000], 245000, 1200000
Median = (210000 + 232000) ÷ 2 = 221000
Mean   = 2275000 ÷ 6 = 379166.666667

Page load times in seconds

Six measurements of 0.82, 1.45, 0.67, 3.9, 1.1 and 0.95 seconds. One slow load of 3.9 s lifts the mean, so the median is the fairer typical time.

Sorted: 0.67, 0.82, [0.95, 1.1], 1.45, 3.9
Median = (0.95 + 1.1) ÷ 2 = 1.025
Mean   = 8.89 ÷ 6 = 1.481667

How to use the Median Calculator

  1. Paste or type the data. In any order, separated by commas, spaces, semicolons or new lines, such as 3 9 4 7 1.
  2. Fix anything flagged. Entries that aren't numbers are named under the box; remove units, currency signs and thousands separators.
  3. Read the Median card. It's the second result, next to the mean, with Min, Max and Count further down.

Frequently asked questions

How do you find the median of an even set of numbers?

Sort the numbers, take the two in the middle, add them and divide by 2. For 10, 4, 8 and 6 the sorted list is 4, 6, 8, 10; the middle pair is 6 and 8, so the median is 7. It doesn't have to be one of your numbers.

What is the difference between the median and the mean?

The mean uses every value; the median uses only the middle one. Because the mean adds everything up and divides by the count, each value pulls on it. For 2, 3, 3, 5 and 87 the mean is 20 but the median is 3, which describes four of the five values far better.

When should I use the median instead of the average?

When the data is skewed or has outliers: incomes, house prices, waiting times and load times are common cases. A handful of extreme figures drags the mean towards them, while the median stays with the typical case. For evenly spread data with no extremes, the two are close and either works.

Do I need to sort the numbers before finding the median?

Not here. The calculator sorts the values itself, smallest to largest with negative numbers first, before picking the middle one. Enter them in whatever order you have them, for example straight from a list of results or readings.

What if a number appears more than once?

Every copy is kept and counted, because each one is a separate observation. In 2, 2, 2, 5 and 9 the middle value is 2, so the median is 2. Removing the duplicates would leave 2, 5 and 9 and give a different median of 5.

Can the median be a decimal when all my numbers are whole?

Yes, when there is an even count. If the two middle values are 7 and 8, the median is (7 + 8) ÷ 2 = 7.5. With an odd count the median is always one of the values you entered, so whole numbers give a whole-number median.

This tool runs entirely in your browser. What you enter or upload stays on your device and is never sent to our servers.