Median Calculator

The median is the exact midpoint of an ordered dataset. For an odd count of numbers, it is the center item; for an even count, it is the average of the two middle values. For example, the median of 3, 5, 12 is 5, while the median of 2, 3, 5, 12 is (3 + 5) / 2 = 4.
Enter Numbers (Separated by Commas or Spaces)
Enter numbers in any order; the calculator will sort them automatically
Try an example:
Rounding rule: standard arithmetic half-away-from-zero (e.g., 2.55 rounded to 1 decimal is 2.6).
Median (Middle Value):
15.00
Count: 7 (Odd count: exact middle value)
Step 1: Count of values: n = 7.
Step 2: Sort all numbers in ascending order: [10, 11, 13, 15, 16, 23, 26].
Step 3: Since n = 7 is odd, the median is the single middle element at position 4: 15.
Step 4: Apply rounding: 15.00.

How to Find the Median of Odd and Even Number Sets

The median is a foundational measure of central tendency representing the exact 50th percentile of a numerical dataset. Fifty percent of the numbers lie below the median, and fifty percent lie above it.

To find the median, you must first sort the entire dataset in ascending order from lowest to highest: x₁ ≤ x₂ ≤ ... ≤ xₙ.

Case 1: Odd Count of Values (n is odd). The median is the single middle element located at index (n + 1) ÷ 2. For instance, in the sorted five-item list [10, 11, 13, 15, 16], the median is the 3rd value: 13.

Case 2: Even Count of Values (n is even). There is no single center item. Instead, take the two middle elements at positions n ÷ 2 and (n ÷ 2) + 1, and calculate their arithmetic mean: (mid₁ + mid₂) ÷ 2. For instance, in [2, 3, 5, 12], the middle elements are 3 and 5, producing a median of (3 + 5) ÷ 2 = 4.

Unlike the arithmetic mean, the median is a robust statistic: extreme outliers (such as an ultra-luxury mansion in a modest neighborhood) do not distort the median.

\text{Median} = \begin{cases} x_{(n+1)/2} & \text{if } n \text{ is odd} \\ \frac{x_{n/2} + x_{n/2 + 1}}{2} & \text{if } n \text{ is even} \end{cases}

Worked Real Estate Example (Outlier Resistance)

Worked Example: Real Estate Neighborhood Sale Prices

Six homes in a suburban neighborhood sell for the following prices: $320,000, $345,000, $310,000, $360,000, $330,000, and an expansive multi-acre estate for $2,800,000. What is the median home price?

  1. Sort all sale prices in ascending order: [$310,000, $320,000, $330,000, $345,000, $360,000, $2,800,000].
  2. Count the number of sales: n = 6 (even count).
  3. Identify the two middle elements at positions 6/2 = 3rd and 4th: $330,000 and $345,000.
  4. Calculate their arithmetic average: ($330,000 + $345,000) ÷ 2 = $675,000 ÷ 2 = $337,500.
  5. Notice the contrast: The arithmetic mean is $744,167 (distorted by the $2.8M estate), whereas the median of $337,500 accurately captures typical home values.

The median home sale price is $337,500.00, providing an accurate, outlier-resistant benchmark.

Odd vs. Even Median Sample Calculations Table

Observe how the median identifies the single central item for odd sample sizes, and averages the two middle values for even sizes.

Dataset ElementsSorted DatasetCount TypeMiddle Position(s)Median Value
7, 1, 91, 7, 9Odd (n=3)2nd position (7)7.00
10, 4, 2, 82, 4, 8, 10Even (n=4)2nd & 3rd (4, 8)6.00
15, 20, 25, 30, 3515, 20, 25, 30, 35Odd (n=5)3rd position (25)25.00
1, 2, 3, 4, 5, 61, 2, 3, 4, 5, 6Even (n=6)3rd & 4th (3, 4)3.50
-5, 10, 0, -10, 5-10, -5, 0, 5, 10Odd (n=5)3rd position (0)0.00
10, 20, 30, 100010, 20, 30, 1000Even (n=4)2nd & 3rd (20, 30)25.00

Common Median Mistakes to Avoid

Statistical Pitfalls
  • Forgetting to sort the numbers before picking the middle value: In [12, 3, 5, 2], picking 3 or 5 without sorting yields incorrect results. Always sort ascending first: [2, 3, 5, 12].
  • Picking only one middle value for even counts: For an even number of values, you must average the two center numbers.
  • Confusing median with mean: The mean is the total sum divided by count; the median is the midpoint rank.
  • Ignoring duplicates: If a dataset is [4, 4, 4, 9, 10], keep all three 4s in the ordered list.

Suggested Tools & Learning Resources

Independent, reputable tools to accelerate your mathematical problem solving and study.

Frequently Asked Questions About the Median

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

Sort the numbers, locate the two middle values at positions n/2 and (n/2)+1, add them together, and divide by 2.

Why is the median preferred over the mean for income and home prices?

Because income and home prices are heavily skewed by a tiny percentage of ultra-high values. The median represents what a typical person earns or pays without distortion.

Can the median be a number that is not in the original dataset?

Yes. When the count of numbers is even, the average of the two middle values can produce a number not present in the list (e.g., median of [1, 2] is 1.5).

What is the median of 1, 2, 3, 4, 5?

The median is 3. Since there are 5 numbers (an odd count), the exact center element is 3.

What happens to the median if you add an extreme outlier?

The median moves at most to the adjacent number in the sorted list, unlike the mean which can shift dramatically.

How does this calculator handle negative numbers?

Negative numbers are sorted in order from most negative to least negative (e.g. -10, -5, 0, 5), and the exact midpoint is identified.

Related Calculators

Want an in-depth breakdown of Mean vs Median vs Mode?Read our Complete Central Tendency Guide →