CalcFolio

Median Calculator

Enter a list of numbers and this median calculator finds the middle value, along with the first and third quartiles, the interquartile range (IQR), the count, the minimum and the maximum. For lists of up to 60 values it also shows the data sorted from smallest to largest, so you can check the result by eye. The median is the go-to summary for skewed data such as home prices, incomes or wait times.

Updated

Separate values with commas, spaces or line breaks

How to use the median calculator

  1. Type or paste your numbers, separated by commas, spaces or line breaks, for example 42, 38, 51, 45, 47. The values don't need to be in order.
  2. Use a period for decimals and leave out thousands separators: 1250, not 1,250.
  3. Read the results. The median comes first, followed by Q1, Q3, the IQR, the number of values, the minimum and the maximum.
  4. Check the sorted list, which appears below the results when you enter 60 values or fewer.

You can enter up to 10,000 values. Text, units and symbols such as $ inside the list will trigger an error.

How the median and quartiles are calculated

The calculator first sorts the values from smallest to largest.

  • Median: with an odd number of values, it is the one in the middle position, (n + 1) ÷ 2. With an even number, it is the average of the two middle values.
  • Q1 and Q3 (Tukey's method): the list is split into a lower half and an upper half. When n is odd, the median itself is left out of both halves. Q1 is the median of the lower half and Q3 the median of the upper half.
  • IQR: Q3 − Q1, the range covered by the middle 50% of the data.

There is no single universal rule for quartiles. Statistical texts and software use several definitions, and on small data sets they can disagree. Excel's QUARTILE.INC, for instance, interpolates between positions and includes the median, so it often returns slightly different values than the halves method used here. The median itself is the same under every method.

Examples

1. Fifteen values with one high outlier

For 3, 13, 7, 5, 21, 23, 39, 23, 40, 23, 14, 12, 56, 23 and 29, the sorted list puts 23 in the eighth of 15 positions, so the median is 23. The lower half (3 through 21) gives Q1 = 12, the upper half (23 through 56) gives Q3 = 29, and the IQR is 17. The upper fence is 29 + 1.5 × 17 = 54.5, so the maximum of 56 qualifies as an outlier.

2. Home prices on one street

Eight recent sales, in thousands of dollars: 310, 335, 298, 342, 365, 1,250, 327 and 318. With an even count, the median is the average of 327 and 335: $331,000. The mean would be $443,125, pulled up by a single estate sale. Q1 is 314, Q3 is 353.5 and the IQR is 39.5, so anything above 412.75 stands out, and the $1.25 million sale clearly does.

3. Why quartile methods differ

Delivery times of 42, 38, 51, 45, 47, 39, 44, 120 and 41 minutes have a median of 44. Tukey's method, which drops the median from both halves, gives Q1 = 40 and Q3 = 49. Excel's QUARTILE.INC gives 41 and 47 for the same data.

Data setMedianQ1Q3IQR
Example 123122917
Example 2331314353.539.5
Example 34440499

Reading the results and spotting outliers

Half of your values lie at or below the median and half at or above it. Q1 and Q3 mark the 25th and 75th percentiles, so the IQR tells you how spread out the typical values are without being affected by the extremes.

A common screening rule, used in box plots, flags any value below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR as a potential outlier. Treat it as a prompt to check the data, not as proof of an error: a flagged value may be a typo, a measurement problem or a genuine but rare observation.

Frequently asked questions

How do I find the median of an even number of values?

Sort the values and average the two in the middle. For 7, 9, 12, 15, 18 and 21, the middle pair is 12 and 15, so the median is 13.5.

When should I use the median instead of the mean?

Use the median when the data is skewed or has outliers, as with incomes, house prices or response times. The mean is better when every value should count toward a total, for example a monthly budget.

Why are my quartiles different from Excel or my textbook?

Quartiles can be defined in several ways. This calculator uses Tukey's halves method, which excludes the median when n is odd. QUARTILE.INC and QUARTILE.EXC in Excel use interpolation, so small data sets often give slightly different Q1 and Q3. Check which method your class or report expects.

Is the median the same as the 50th percentile?

Yes. The median, the second quartile (Q2) and the 50th percentile all name the same point that divides sorted data into two equal halves.

Why don't I see the sorted list?

To keep the page readable, the sorted list is shown only for 60 values or fewer. All other results are still calculated for up to 10,000 values.

Sources

  1. Wolfram MathWorld — Statistical Median
  2. Wolfram MathWorld — Quartile
  3. Wolfram MathWorld — Interquartile Range
  4. Wolfram MathWorld — Outlier
  5. NIST/SEMATECH e-Handbook of Statistical Methods — Measures of Location

Results are calculated from the values you enter and are provided for general information. If a class, exam or report specifies a particular quartile method, use that method for official answers.