Median Calculator
Finds the median, the middle value of a data set, and shows how it was found: the numbers sorted from smallest to largest, the position of the middle value and, for an even count, the two middle values that are averaged. Paste a list of test scores, house prices, salaries or response times. The median is not pulled around by a few extreme values, so it is often a fairer ‘typical’ value than the mean, which is shown alongside for comparison.
- Every entry is one observation; repeated values are counted each time they appear.
Formula
Sort the n values. n odd: median = value at position (n + 1) ÷ 2; n even: median = mean of the values at positions n ÷ 2 and n ÷ 2 + 1
- The median splits the sorted data into two halves of equal size: half the values are at or below it and half at or above it.
- For an odd number of values it is the single middle value; for an even number it is the mean of the two middle values.
- Unlike the mean, the median is not affected by how extreme the largest or smallest values are, which is why it is used for incomes and house prices.
- The median is rounded to 4 decimal places; data values are shown as entered.
The numbers 7, 2, 9, 4, 12 and 5
Inputs
- Data set: 7, 2, 9, 4, 12, 5
Sorted: 2, 4, 5, 7, 9, 12. There are 6 values, so the median is the mean of the 3rd and 4th: (5 + 7) ÷ 2 = 6. The mean is 39 ÷ 6 = 6.5.
Sources & references
Frequently asked questions
How do I find the median?
Sort the numbers from smallest to largest and pick the one in the middle. For 3, 9, 1, 7, 5 the sorted list is 1, 3, 5, 7, 9 and the median is 5.
How do I find the median of an even number of values?
Take the two middle values and average them. For 1, 3, 5, 7 the middle values are 3 and 5, so the median is 4.
What is the difference between the median and the mean?
The mean adds everything and divides by the count; the median is the middle value. For salaries of 30, 32, 35, 38 and 250 (thousand), the mean is 77 but the median is 35, which better describes a typical salary.
Can the median be a number that is not in the data?
Yes, with an even count. The median of 2, 4, 6, 8 is 5, which is not one of the values.
What if some values repeat?
Keep every copy in the sorted list. The median of 1, 2, 2, 2, 9 is 2.
Related calculators
Mean Calculator Calculates the three classical (Pythagorean) means of a data set: the arithmetic mean (the everyday average), the geometric mean (for growth rates and ratios) and the harmonic mean (for rates such as speeds and prices per unit). Choose one or show all three side by side, with the sum, product or reciprocal sum each one is built from. Average Calculator Finds the average (arithmetic mean) of a list of numbers, together with the count, sum, median, geometric mean, smallest and largest value and the range. Paste or type the numbers separated by commas, spaces or semicolons, in any mix. Anything that is not a number is skipped and listed, so you can see exactly which values went into the result. Useful for test scores, prices, measurements or any other set of data. Standard Deviation Calculator Calculates the standard deviation of a list of numbers, the most common measure of how spread out data are around their mean. Paste or type your values separated by commas, spaces or new lines, and choose whether they are a sample from a larger group (dividing by n − 1) or the whole population (dividing by n). You also get the variance, mean, count, sum, sum of squared deviations, standard error of the mean, minimum, maximum and range. Z-Score Calculator Converts a raw value into a z-score, the number of standard deviations it lies above or below the mean: z = (X − μ) ÷ σ. Enter the value, the mean and the standard deviation, or work backwards from a z-score to the raw value. You also get the probabilities from the standard normal distribution: the left-tailed (percentile), right-tailed and two-tailed p-values and the probability of falling within ±z of the mean, which you can use for hypothesis tests or to compare scores from different scales.