Connect via MCP →

Enter Calculation

Formula

Formula: Median Calculator

Advertisement

Results

Median
15.5
middle value of the data set
Count of values 6
Sum 108
Mean (average) 18

What Is the Median?

The median is the middle value of a data set when the numbers are arranged in order from smallest to largest. Unlike the mean (average), the median is not skewed by extreme outliers, which makes it a robust measure of central tendency — especially useful for income, house prices, and other skewed data.

A row of sorted number tiles with the center tile highlighted as the median
The median is the middle value of a data set sorted in order.

How to Use This Calculator

Type your numbers into the box separated by commas or spaces (for example 4, 8, 15, 16, 23, 42) and the calculator sorts them, finds the median, and also reports the count, sum, and mean. There is no limit on how many values you can enter.

The Formula Explained

First sort the values. If the count n is odd, the median is the value in position \((n+1)/2\). If \(n\) is even, there is no single middle value, so the median is the average of the two central values — positions \(n/2\) and \(n/2+1\).

$$\text{Median} = \begin{cases} x_{\frac{n+1}{2}} & n \text{ odd} \\[0.6em] \dfrac{x_{\frac{n}{2}} + x_{\frac{n}{2}+1}}{2} & n \text{ even} \end{cases}$$

$$x = \operatorname{sort}\left(\text{Numbers}\right)$$

Advertisement
Comparison of finding the median for an odd count versus an even count of values
Odd counts have one middle value; even counts average the two central values.

Worked Example

Take the set 4, 8, 15, 16, 23, 42. It is already sorted and has 6 values (even). The two middle values are 15 and 16. The median is $$\frac{15 + 16}{2} = \textbf{15.5}$$ Now take 3, 7, 9 — an odd set of 3 — the middle value is simply 7.

FAQ

Is the median the same as the average? No. The average (mean) sums all values and divides by the count, while the median is the positional middle. They can differ greatly for skewed data.

Why use the median instead of the mean? The median resists outliers. One very large or very small value can drag the mean far from the typical value, but barely moves the median.

Do the numbers need to be sorted first? No — the calculator sorts them for you automatically.

Last updated: