Median Calculator

Statistics

Median Calculator

Find the middle value of a dataset. Robust to outliers, easy to interpret.

Input Data

Results

Median (50th Percentile)
5.0000
Count (n)
5
Min
2.0000
Median
5.0000
Max
8.0000
Sorted: [2.0, 4.0, 5.0, 7.0, 8.0]

What is the Median?

Median is the middle value in a sorted dataset. It divides data into two equal halves: 50% below, 50% above. Also called the 50th percentile.

For odd count: median = middle value
For even count: median = average of two middle values

Why Use Median?

  • Robust: Outliers don't affect it much. One extreme value barely moves median position.
  • Interpretable: Always an order statistic (from the data or between values). No calculations like mean.
  • Skewed data: Best represents "typical value" when data skews left or right.
  • Ordinal scales: Applicable to ranked data (1st, 2nd, 3rd—not just numbers).
  • Real-world: Income, house prices, test scores often use median for central tendency.

Median vs Mean: Mean assumes normal distribution (sensitive to outliers). Median works with any distribution (resistant to extremes). Compare both to assess skewness.

How to Calculate Median

1

Sort the data

Arrange all values from smallest to largest. Order matters for finding middle.

2

Count the values

Determine if count is odd or even. This decides whether median is a single value or average.

3

Find the middle(s)

Odd count: pick center value. Even count: identify two middle values at positions n/2 and n/2+1.

4

Calculate if needed

For even count, average the two middle values. For odd, median is already found.

Example Calculation

Dataset (unsorted): 5, 7, 2, 8, 4 Step 1: Sort Sorted: [2, 4, 5, 7, 8] Step 2: Count n = 5 (odd number) Step 3: Find middle Position = (5 + 1) / 2 = 3rd value 3rd value in [2, 4, 5, 7, 8] = 5 Result: Median = 5

Dataset (unsorted): 3, 1, 4, 2 Step 1: Sort Sorted: [1, 2, 3, 4] Step 2: Count n = 4 (even number) Step 3: Find two middles Positions: 2nd and 3rd values Values: 2 and 3 Step 4: Average Median = (2 + 3) / 2 = 2.5

Frequently Asked Questions

Related Tools