Education
Median Calculator
Last updated: May 31, 2026
Written by Blake Boege
In statistics and probability theory, a median is the value separating the higher half from the lower half of a data sample, population, or probability distribution. For a finite list of numbers, the median is the middle value when the numbers are sorted in ascending order. If the dataset has an odd number of elements, the median is the single middle value. If the dataset contains an even number of elements, it is calculated as the arithmetic average of the two middle values. Unlike the mean, the median is robust against extreme outliers, making it a preferred measure of central tendency for skewed data distributions, such as household incomes.
Enter a list of numbers separated by commas, spaces, or newlines. The calculator sorts the list in numerical order and computes the median (the exact middle value or average of the two middle values) with step-by-step steps.
Quick Answer
Find the middle value of any dataset. Enter your numbers to sort the list and calculate the median, with step-by-step math shown for both odd and even lists.
Separate values with commas, spaces, or new lines. Decimals and negative numbers are supported.
Step by step
- Sort the dataset: 4, 7, 7, 9, 12
- Count of values (N): 5
- Since N (5) is odd, the median is the single middle value at position (N + 1) / 2 = position 3
- Value at position 3 is 7
Median
7
Middle value (7)
Examples
4, 7, 7, 9, 12 (Odd count)
Sorted: 4, 7, 7, 9, 12 · Median = 7
2, 4, 6, 8 (Even count)
Sorted: 2, 4, 6, 8 · Median = (4+6)/2 = 5
-5, 0, 10, 15
Sorted: -5, 0, 10, 15 · Median = (0+10)/2 = 5
How it works
The median calculator sorts the input values in ascending order and finds the exact center of the dataset. The calculation path depends on whether the count of numbers (N) is odd or even.
If N is Odd
The median is the value at the exact center:
median = sorted[(N + 1) / 2]
If N is Even
The median is the average of the two middle values:
median = (sorted[N / 2] + sorted[(N / 2) + 1]) / 2
What is the median?
The median is a measure of central tendency in statistics. Unlike the mean, which sums all values and divides by the count, the median represents the middle point of a dataset. It splits your data in half, which is useful when analyzing populations or metrics that contain extreme outlier values.
How to find the median step-by-step
To calculate the median of a dataset manually:
- Sort your numbers in order from lowest to highest.
- Count the total number of values in the list (N).
- If N is odd, look for the value in the exact middle. The formula to find its position is (N + 1) / 2.
- If N is even, locate the two middle numbers. The formulas for their positions are N / 2 and (N / 2) + 1. Add these two values together and divide by 2.
Mean vs Median vs Mode
All three metrics describe the center of a data distribution, but they behave differently depending on the shape of the data:
- Mean: The arithmetic average. It is calculated by summing all numbers and dividing by the count. It is sensitive to outliers.
- Median: The middle value. It is robust to outliers and is the best representation of skewed data.
- Mode: The value that appears most often. A dataset can have one mode, multiple modes, or no mode at all.
To compute all three at once, you can use our Mean Median Mode Calculator. For analyzing the spread or variability of your data, you can check the Standard Deviation Calculator or the Variance Calculator.
Worked Examples of Median Calculations
Here are two scenarios showing how the calculation adapts:
- Odd Count Example: For the dataset
[12, 4, 7, 9, 7]:
1. Sort the list:[4, 7, 7, 9, 12].
2. N = 5 (odd).
3. Position of median is (5 + 1) / 2 = 3.
4. The third value is 7. - Even Count Example: For the dataset
[8, 2, 6, 4]:
1. Sort the list:[2, 4, 6, 8].
2. N = 4 (even).
3. Middle positions are 4 / 2 = 2 and (4 / 2) + 1 = 3 (values 4 and 6).
4. Average the middle values: (4 + 6) / 2 = 5.
Common Mistakes when Finding the Median
- Forgetting to sort the list first: You cannot find the median of unsorted data. The numbers must be ordered in ascending or descending sequence.
- Taking the middle index of an even dataset: If N is even, there is no single middle value. You must locate the two middle elements and calculate their arithmetic average.
- Miscounting the list size: Ensure that you count every input number (including duplicate numbers) when determining N.
Related Calculators
More tools from Education
Frequently asked questions
The median is the middle value in a sorted list of numbers. It splits a dataset exactly in half, so that 50% of the values are smaller than or equal to the median, and 50% are greater than or equal to it.
First, sort the numbers from smallest to largest. If the list has an odd number of values, the median is the single number in the exact middle. If the list has an even number of values, the median is the average of the two middle numbers.
Sort the list and find the value at position (N + 1) / 2, where N is the count of values. For example, for [3, 9, 15], N is 3. The median is at position (3 + 1) / 2 = position 2, which is 9.
Sort the list and average the two middle numbers at positions N / 2 and (N / 2) + 1. For example, for [2, 4, 6, 8], N is 4. The two middle values are at positions 2 and 3 (values 4 and 6). The median is (4 + 6) ÷ 2 = 5.
The mean is the arithmetic average (sum of all numbers divided by the count). The median is the middle value of the sorted list. The mean is highly sensitive to outliers, whereas the median is robust and unaffected by extreme values.
Not always. For datasets with an odd number of values, the median is always one of the original numbers. For datasets with an even number of values, the median is the average of the two middle numbers, which might result in a decimal value not present in the original list (e.g., the median of [1, 2, 3, 4] is 2.5).
Household incomes and real estate prices are often highly skewed, with a small number of extremely high values (millionaires or luxury mansions) that drag the arithmetic mean upward. The median provides a more accurate representation of the 'typical' household income or home price because it is unaffected by these high outliers.
Negative numbers are handled the same way as positive numbers. They are sorted from smallest (most negative) to largest. The sorting process automatically accounts for negative values, placing them at the beginning of the list, and the middle position is found normally.
Related calculators
Education
Time to Decimal Calculator
Convert hours and minutes (HH:MM) to decimal hours and back for timesheets, payroll, or math problems.
Education
Deadline Calculator
Calculate a target deadline date by adding calendar days or business days to a starting date.
Education
Audiobook Calculator
Calculate your actual listening time and time saved when playing back audiobooks or podcasts at faster speeds (1x to 3x).