Quick answerA median calculator finds the center of an ordered data set. With an odd number of observations it returns the single middle value; with an even number it averages the two middle values and displays companion statistics for context.
How the middle value is selected
The numbers must first be sorted from smallest to largest. Their original order does not affect the median. With five observations, the third sorted value has two values below and two above it. With six observations, no single value occupies the center, so the third and fourth are added and divided by two.
Repeated numbers are not removed. If three households report the same income, those are three observations and each keeps a position in the ordered set. Negative values and decimals are also valid as long as every entry represents the same variable and unit.
Median versus arithmetic mean
The median depends on rank and is resistant to the size of extreme observations. In a list of home prices, replacing one very expensive property with an even more expensive one may leave the median unchanged, while the mean rises. This makes the median useful for skewed distributions such as income, property prices, and waiting times.
Resistance is not the same as completeness. The median ignores how far values lie from the center, and two very different distributions can share the same median. Review the count, minimum, maximum, mean, and the purpose of the analysis rather than choosing a statistic only because it looks favorable.
How to use this median calculator
- Paste the complete data set into the field.
- Check the item count, especially when values repeat.
- Use the median when the middle of the ordered data is more informative than a mean pulled by extreme values.
Formula and method
Every parsed number is one observation and contributes once. Missing values, units, labels, and grouped-frequency tables are not inferred.
Odd and even median examples
For the values 12, 4, 9, 20, and 7, sorting produces 4, 7, 9, 12, 20. There are five observations, so the third value is the median: 9. Notice that the result is determined after sorting, not by taking the third number as originally typed.
Add 30 and the ordered set becomes 4, 7, 9, 12, 20, 30. The two center values are 9 and 12, and their average is 10.5. A median for an even count therefore may be a value that was not present in the data.
Find the median with repeats, negatives and decimals
Paste values separated by spaces, commas or line breaks. Use a period for the decimal point and omit thousands separators: enter 1500 rather than 1,500, because the comma separates two entries.
| Input values | Sorted values | Median |
|---|---|---|
| 8, 2, 5 | 2, 5, 8 | 5 |
| 10, 2, 6, 4 | 2, 4, 6, 10 | 5 |
| 2, 2, 9 | 2, 2, 9 | 2 |
| -5, -1, 2, 8 | -5, -1, 2, 8 | 0.5 |
For the even-count negative example, the middle values are −1 and 2. Their average is (−1 + 2) ÷ 2 = 0.5. The answer need not occur in the original list. Duplicates remain separate observations.
For 10, 12 and 100, median is 12 while mean is about 40.6667. Neither statistic alone describes the whole distribution. Use the average and weighted mean calculator to explore arithmetic and weighted means. This median tool does not calculate a weighted median or infer grouped-frequency data.
Common mistakes to avoid
- Selecting the middle entry before sorting the data.
- Removing duplicates that represent genuine observations.
- Forgetting that an even count requires two middle values.
- Combining measurements that use different units or describe different variables.
Accuracy and practical limits
The result is exact for the parsed numeric entries and uses full precision until display. The tool does not interpret blank codes, grouped frequency tables, censored observations, survey weights, or missing-data rules. For formal statistical work, document how the sample was selected and cleaned before relying on any summary statistic.
Method basis: Standard mathematical definitions and the assumptions stated above. See our editorial and testing standards.
Frequently asked questions
Do repeated values count?
Yes. Each occurrence is a separate observation and keeps its place in the sorted list.
What happens with an even number of values?
The calculator averages the two middle values after sorting.
When is median preferable to mean?
Median is often more representative when a small number of extreme values would strongly pull the arithmetic mean.