Median and Mode Calculator

StatisticsLast updated: August 17, 2026

The median is the value that sits exactly in the middle once the data has been ordered from smallest to largest: half of the values fall below it and half above it. Because it is not pulled by extreme observations, it is a more trustworthy measure of the center than the mean for skewed variables such as income, prices, and scores. The mode is the value that occurs most often in the data set; if nothing repeats, there is no mode.

This calculator returns the median, the mode (when there is one), the arithmetic mean, and the quartiles (Q1 and Q3) in a single pass, along with the interquartile range and a frequency table for every value. It is built for students checking homework, researchers exploring data, and anyone putting a report together.

Both decimal points and decimal commas are accepted (e.g. 3.14 or 3,14). At least 2 values are required.

Formula

Median (n odd)  = the value in the exact middle of the ordered data
Median (n even) = the mean of the two middle values
Mode = the value (or values) that occur most often
IQR = Q3 − Q1  (interquartile range)

The most common mistake is taking the middle value without ordering the data first. The median is always read off the sorted data; the order in which the values were entered makes no difference.

How to Calculate

  1. Paste your data values into the box — separate them with commas, spaces, or line breaks.
  2. The calculator sorts the data from smallest to largest for you; there is no need to order it yourself.
  3. Read the median, the mode (if there is one), the mean, and the quartiles in the results section.
  4. Use the frequency table to see how many times each value occurs.

Worked Examples

An odd number of values (n = 7)

Sorted, the data reads 3, 3, 5, 7, 8, 9, 12, so the fourth value, 7.00, is the median. The value 3.00 appears twice, making it the mode. The mean is 6.71, with Q1 = 4.00, Q3 = 8.50, and IQR = 4.50.

Median: 7.00 · Mode (most frequent value): 3.00 · Mean (x̄): 6.71

An even number of values, with no mode

With n = 4 the median is the mean of the two middle values, 20 and 30, which gives 25.00. No value repeats, so there is no mode. The mean is also 25.00, with Q1 = 17.50, Q3 = 32.50, and IQR = 15.00.

Median: 25.00 · Mode (most frequent value): No mode · Mean (x̄): 25.00

Salary data with an outlier

For a five-person team earning 4,000, 4,500, 5,000, 5,500, and 25,000, the median is 5,000 while the mean is 8,800.00. The single high salary drags the mean upward, whereas the median still reflects the typical salary.

Median: 5,000 · Mode (most frequent value): No mode · Mean (x̄): 8,800.00

Frequently Asked Questions

What is the difference between the median and the mean?
The mean is the sum of all values divided by how many there are, and it is strongly affected by extreme observations. The median is the middle value of the ordered data, and outliers do not shift it. For skewed distributions such as income and prices, the median is the more representative measure of the center.
How do you find the median with an even number of values?
Sort the data from smallest to largest and take the arithmetic mean of the two middle values. For the data 10, 20, 30, 40 the median is (20 + 30) / 2 = 25. That is why the median can be a number that does not appear in the data set at all.
Can a data set have no mode?
Yes. If no value occurs more than once there is no mode, and the calculator reports "No mode". Conversely, when several values share the highest frequency the data is multimodal (bimodal, trimodal, and so on) and every mode is listed.
What do Q1, Q3, and the IQR mean?
Q1 (the first quartile) is the value below which 25% of the data falls, and Q3 (the third quartile) the value below which 75% falls. IQR = Q3 − Q1 measures the width of the middle 50% of the data. The IQR is also used to flag outliers: values below Q1 − 1.5xIQR or above Q3 + 1.5xIQR are usually treated as outliers.
Which method does this calculator use for the quartiles?
It uses the linearly interpolated R-7 method, which returns the same result as Excel's PERCENTILE.INC function. Some textbook hand methods define the quartiles slightly differently, so you may see small discrepancies; both approaches are valid.
When should the median be preferred?
Whenever the data contains outliers or the distribution is skewed — income, house prices, waiting times, and the like. In symmetric distributions with no outliers the mean and the median already come out very close to each other, and the gap between the two is a practical signal of skewness.