Median Calculator
What's the middle value in your dataset?
Calculate the median (middle value) of any set of numbers. The median is the value that separates the higher half from the lower half of your dataset, making it essential for understanding data distribution and avoiding outlier bias.
—
Send feedback
💡 Share your idea or report a problem
✓ Thanks! We'll take a look.
Learn more
How It Works
The formula, explained simply
Imagine lining up every person in your company by salary from lowest to highest. The median is the salary of the person standing exactly in the middle — half earn more, half earn less. Unlike calculating an average, it doesn't matter if the CEO makes 50 times more than everyone else. That extreme value sits at the end of the line but doesn't move the middle person.
The median splits any dataset into two equal halves by count, not by value. If you have 11 test scores, the median is the 6th score when sorted — 5 scores below it, 5 above. With 10 scores, there's no single middle, so you average the 5th and 6th scores. This mathematical precision makes median perfect for datasets where a few extreme values would distort the typical picture.
What makes median powerful is its resistance to outliers. Add a billionaire to a room of middle-class workers, and the average income skyrockets while the median barely budges. Remove the billionaire, and the median stays nearly identical while the average plummets. This stability makes median the preferred measure when you want to understand what's normal or typical in your data.
When To Use This
Right tool, right situation
Use median when analyzing income, housing prices, test scores, or any data where a few extreme values might mislead. Real estate agents quote median home prices because a single mansion shouldn't inflate expectations for typical buyers. HR departments report median salaries because executive compensation shouldn't skew worker pay analysis.
Median works best with continuous data or ordinal rankings where position matters. It's perfect for reaction times, ages, scores, prices, or survey responses on numerical scales. If your data clusters around a center with occasional outliers, median gives you that center without the outlier interference.
Avoid median when you need to account for the total or when extreme values carry important meaning. If you're calculating total budget impact, use the average — every salary matters for the total payroll cost. When outliers represent important exceptions rather than measurement errors, the average might tell a more complete story than the outlier-resistant median.
Common Mistakes
Why results sometimes look wrong
The biggest mistake is confusing median with mode (most frequent value) or assuming median always equals the middle number you see. Median requires sorting first — the middle value in your original unsorted list means nothing. If your data is 100, 5, 200, the median isn't 5 just because it sits in the middle position.
Another common error is incorrectly handling even-sized datasets. Many people pick either of the two middle values instead of averaging them. In the dataset 2, 4, 6, 8, some choose 4 or 6 as the median, but the correct answer is 5. This averaging step ensures the median truly represents the center point.
People also misuse median with categorical data or ordinal scales without meaningful midpoints. You can't find the median of colors (red, blue, green) or satisfaction ratings unless the categories have a natural order and equal spacing. Median works with numbers and ranked data where 'between' makes mathematical sense.
The Math
Worked examples and deeper derivation
The median calculation follows a simple two-step process: sort the data, then find the middle. For odd-sized datasets with n values, the median is the value at position (n+1)/2. For even-sized datasets, it's the average of the values at positions n/2 and (n/2)+1. This positioning ensures exactly half the data falls on each side.
Mathematically, median minimizes the sum of absolute deviations — the total distance from each data point to the center. While mean minimizes squared deviations, median minimizes absolute deviations, making it less sensitive to extreme values. A single outlier can shift the mean dramatically but moves the median by at most one position in the sorted list.
The median's mathematical properties make it the 50th percentile of any dataset. This connection to percentiles explains why median income appears in economic reports — it represents the income level that splits the population in half. Unlike arithmetic mean, median has no closed-form formula for grouped data, requiring the actual data points to calculate precisely.
Expert Unlock
The thing most explanations skip
Statisticians prefer median for non-parametric analysis because it makes no assumptions about data distribution. Unlike mean-based statistics that assume normality, median-based methods work with any distribution shape. This robustness makes median central to non-parametric hypothesis testing and confidence interval construction.
What's the difference between median and average?
Need something this doesn't cover?
Suggest a tool — we'll build it →