Median Calculator

Reviewed by CalcMulti Editorial Team·Last updated: ·Statistics Hub

The median is the middle value of a sorted dataset. Unlike the mean, it is not affected by outliers — making it the preferred measure of central tendency for skewed distributions such as income, housing prices, and reaction times.

Enter your values below to instantly find the median. The calculator also shows Q1, Q3, and the interquartile range (IQR).

Formula

Odd n: Median = x[(n+1)/2] | Even n: Median = (x[n/2] + x[n/2+1]) / 2

n
number of values in the dataset
x[k]
the k-th value in the sorted (ascending) dataset

Why the Median Is Resistant to Outliers

The median only depends on the middle value(s) — not the magnitude of extreme values. This makes it the preferred measure of central tendency for skewed distributions.

DatasetMeanMedianBest choice
Salaries: $40K, $42K, $44K, $46K, $800K$194K$44KMedian — outlier distorts mean
Test scores: 70, 72, 74, 76, 787474Either — symmetric data
House prices in a citySkewed high by mansionsMiddle market valueMedian for "typical" price
Response times: 1.1, 1.2, 1.3, 1.4, 9.8 sec2.96 sec1.3 secMedian — latency spike outlier

Step-by-Step Example

Dataset: { 8, 3, 11, 5, 7, 1, 9 }

  1. 1Sort ascending: 1, 3, 5, 7, 8, 9, 11
  2. 2Count values: n = 7 (odd)
  3. 3Find middle position: (7 + 1) / 2 = position 4
  4. 4Read the value: 4th value in sorted list = 7

Even dataset example — { 4, 8, 12, 16 }: middle positions are 2 and 3 → values 8 and 12 → median = (8 + 12) / 2 = 10

Mean vs Median — Which to Report?

ScenarioMeanMedianUse
Salaries: $40K, $45K, $50K, $55K, $500K$138K$50KMedian — outlier skews mean
Exam scores: 70, 72, 74, 76, 787474Either — symmetric, no outliers
House prices in a cityPulled high by mansionsMiddle marketMedian for "typical" price
Lab measurements (normal distribution)Best estimateSimilar to meanMean — uses all info

Common Mistakes with the Median

Forgetting to sort first

The median requires sorted data. Finding the middle of unsorted values gives a random result, not the median.

Wrong middle index for even n

For even datasets, the median is the average of the two middle values — not the lower or upper one alone.

Confusing median with Q2

They are the same value — the median equals the 50th percentile (Q2). But Q1 and Q3 require a different calculation.

Disclaimer

This calculator is for educational purposes only and does not constitute professional advice. Results are based on standard mathematical formulas. Always verify critical calculations with a qualified professional before making important decisions.

Frequently Asked Questions