standarddeviationcalculator.net

Median calculator

Enter your numbers to get the median, with the sorted list and the middle position shown. The mean is reported beside it — the gap between the two is the quickest read on whether your data is skewed.

Separate values with commas, spaces, tabs or new lines — paste a column straight from a spreadsheet and it will parse. Decimals and negatives are fine.

Treat the data as
Median 9
Count (n)7
Mean (x̄)10.1429
Standard deviation6.38823
ModeNo mode (all values appear once)
Variance40.8095
Sum71
Σ(x − x̄)²244.857
Standard error2.41453
Coefficient of variation0.629826
Relative SD (%RSD)62.9826%
Minimum3
Maximum21
Range18
Median (Q2)9
Q15.5
Q313.5
IQR8
x̄ = 10.14 −1σ +1σ -9.022 29.31

The shaded bands are one, two and three standard deviations either side of the mean. 5 of 7 values — 71% — fall inside the innermost band.

Show the working, step by step

How the median is found

Sort the values, then take the middle position. Which position that is depends on the count:

A worked example

Seven values: 12, 3, 7, 21, 15, 9, 4.

Add one more value — say 100 — and the sorted list becomes 3, 4, 7, 9, 12, 15, 21, 100. The median moves only from 9 to 10.5, while the mean jumps from 10.1 to 21.4. That is the robustness of the median in one line.

Why the median resists outliers

The mean uses the magnitude of every value. The median uses only their order. Replacing the largest value with one ten times larger does not change its position in the sorted list, so the median does not move at all.

DataMeanMedian
38, 41, 44, 47, 5244.444
38, 41, 44, 47, 48013044
38, 41, 44, 47, 480099444

The mean triples, then multiplies eightfold. The median does not move once. Statisticians call this a breakdown point: the median tolerates up to half the data being arbitrarily corrupted before it becomes meaningless, while a single bad value is enough to send the mean anywhere.

When the mean is the better choice

Robustness is not free. The median throws away information — it ignores every value except the one or two in the middle — and that costs precision when the data is well behaved:

Median, quartiles and the box plot

The median splits the data in half. Applying the same idea to each half gives the quartiles: Q1 is the median of the lower half, Q3 the median of the upper. Those three numbers plus the minimum and maximum are the five-number summary, and drawing them is exactly what a box plot does. The interquartile range, Q3 − Q1, is the median's natural companion measure of spread — robust for the same reason the median is.

Common questions

How do you find the median?

Sort the values from smallest to largest, then take the middle one. With an odd count there is a single middle value. With an even count there are two, and the median is their average.

Sorting first is not optional — the median is defined by position, so it cannot be found until the data is in order.

What is the median of an even number of values?

The average of the two middle values. For 3, 7, 8, 12 the middle pair is 7 and 8, so the median is 7.5. Note that the median then need not be a number that appears in the data at all — which is perfectly normal.

Why use the median instead of the mean?

Because the median ignores how extreme the extreme values are. It only cares about their position in the order, so a single enormous value moves it barely at all while it drags the mean substantially.

That robustness is why incomes, house prices, response times and survival times are reported as medians. Each has a long right tail that would otherwise pull the average somewhere no typical case sits.

Is the median the same as the second quartile?

Yes. The median is Q2, the 50th percentile, and the middle line of a box plot — four names for the same number. It splits the data into a lower half and an upper half, and the interquartile range measures the spread of the middle half around it.

Can a dataset have two medians?

No. Unlike the mode, the median is always unique. With an even count you average the two middle values into a single number rather than reporting both.

What does it mean when the mean and median are far apart?

The data is skewed. If the mean is above the median, a tail of large values is pulling it up — the usual pattern for incomes and waiting times. If the mean is below, a tail of small values is pulling it down. When the two nearly coincide, the distribution is roughly symmetric. This calculator reports both so the comparison is immediate.

Related calculators

Written and reviewed by our editorial team. Last updated . Method and sources: how these numbers are computed.