If you've ever wondered how to find the "middle" of a set of numbers, you're asking about the median. The median is one of the most useful measures in statistics because it gives you a center point that is less affected by outliers than the average (mean). This guide gives you a fast calculator and then shows exactly how to calculate the median by hand.
Median Calculator
Enter numbers separated by commas, spaces, or semicolons.
What is the median?
The median is the middle value in an ordered list of numbers. To find it, you first sort the numbers from smallest to largest. Then:
- If there is an odd number of values, the median is the single middle number.
- If there is an even number of values, the median is the average of the two middle numbers.
That is all you need to remember.
Step-by-step: how to calculate the median
Step 1: Sort the data
Always sort first. The median depends on position, not size alone. If the data is unsorted, you'll likely pick the wrong middle value.
Step 2: Count how many values you have
Let that count be n. Whether n is odd or even determines your next step.
Step 3A: If n is odd
The median is the value at position:
(n + 1) / 2
Example: For 7 values, median position is (7 + 1) / 2 = 4th value.
Step 3B: If n is even
The median is the average of the values at positions:
n/2 and (n/2 + 1)
Example: For 8 values, take the 4th and 5th values and average them.
Worked examples
Example 1 (odd count)
Data: 9, 2, 7, 4, 5
Sorted: 2, 4, 5, 7, 9
There are 5 values, so the middle is the 3rd value. Median = 5.
Example 2 (even count)
Data: 12, 3, 8, 10, 15, 6
Sorted: 3, 6, 8, 10, 12, 15
There are 6 values, so middle positions are 3rd and 4th: 8 and 10.
Median = (8 + 10) / 2 = 9.
Example 3 (with negative values and decimals)
Data: -2.5, 7.1, 0, 4.8, -1.2
Sorted: -2.5, -1.2, 0, 4.8, 7.1
Middle value is 0. Median = 0.
Why median is often better than mean
The median is resistant to extreme values. Suppose incomes are:
35,000; 38,000; 40,000; 41,000; 2,000,000
The mean is pulled very high by the $2,000,000 outlier. The median stays at 40,000, which better reflects the "typical" income in that group. This is why median is widely used for home prices, salaries, wait times, and many real-world distributions.
Common mistakes to avoid
- Not sorting the data first. This is the most common error.
- Using the mean formula by accident. Median is based on order, not total sum.
- For even counts, picking one middle value. You must average both middle values.
- Ignoring repeated values. Duplicates count as separate entries.
Median vs mean vs mode
- Median: middle of sorted data
- Mean: arithmetic average (sum divided by count)
- Mode: most frequent value
If your data has skew or outliers, median is usually the most stable center measure.
Quick practice problems
Problem 1
Data: 4, 9, 1, 6, 3
Answer: Sorted = 1, 3, 4, 6, 9. Median = 4.
Problem 2
Data: 22, 18, 27, 30, 25, 20
Answer: Sorted = 18, 20, 22, 25, 27, 30. Median = (22 + 25)/2 = 23.5.
Final takeaway
To calculate the median: sort your numbers, find the center position, and if needed average the two middle values. That simple process works for small lists, large datasets, decimals, negatives, and repeated values.
Use the calculator above whenever you want a fast answer, and use the manual steps when you need to show your work in class, business reports, or data analysis.