Quartile Calculator (IQR)

Find the first, second and third quartiles, the interquartile range and the 1.5 × IQR outlier fences, with four quartile methods compared.

Separate values with commas, spaces or new lines.
First quartile (Q1)
7
Second quartile (median)
12.5
Third quartile (Q3)
18
Lower fence (Q1 − 1.5 IQR)
−9.5
Upper fence (Q3 + 1.5 IQR)
34.5
Outliers
41
Quartile deviation
5.5semi-interquartile range
Count (n)
10
Interquartile range (IQR)11Q1 = 7, Q3 = 18
  • Quartiles by median of halves (median excluded).

Show the work

  1. Sort the data: 3, 5, 7, 8, 12, 13, 14, 18, 21, 41
  2. n = 10 is even, so the median is the mean of x5 and x6: (12 + 13) ÷ 2 = 12.5
  3. Lower half: 3, 5, 7, 8, 12 → its median is Q1 = 7
  4. Upper half: 13, 14, 18, 21, 41 → its median is Q3 = 18
  5. IQR = Q3 − Q1 = 18 − 7 = 11
  6. Fences: 7 − 1.5 × 11 = −9.5 and 18 + 1.5 × 11 = 34.5
  7. Values outside the fences are outliers: 41
01020304050 Outlier 41Q1 7Median 12.5Q3 18321
Whiskers reach the most extreme values inside the 1.5 × IQR fences; circles mark outliers. × marks the mean.
The same data with each quartile method
MethodQ1MedianQ3IQR
median of halves (median excluded) ✓712.51811
Tukey’s hinges (median included)712.51811
linear interpolation, QUARTILE.INC7.2512.5179.75
linear interpolation, QUARTILE.EXC6.512.518.7512.25

Quartiles cut sorted data into four groups of roughly equal size. Q1 marks the top of the lowest quarter, Q2 is the median, and Q3 marks the bottom of the highest quarter. The distance from Q1 to Q3, the interquartile range (IQR), is the standard robust measure of spread and the basis of the most widely used outlier rule. This calculator finds all three quartiles, the IQR and the outlier fences, and shows how four different quartile conventions treat your data.

How to use the quartile calculator

  1. Enter at least two numbers, separated by commas, spaces or new lines.
  2. Choose a quartile method. The default is the median-of-halves method used by TI-84 calculators and most US textbooks.
  3. Read the IQR and quartiles on the tape. Show the work lists the halves or the interpolation positions, the box plot marks any outliers, and the comparison table shows every method at once.

Quartile formulas

Median of halves (default). Sort the data and find the median. Q1 is the median of the values below it and Q3 the median of the values above it. When n is odd, the median is excluded from both halves; the Tukey’s-hinges option includes it instead.

Interpolation methods. Find a position h, then interpolate between the neighboring sorted values x₍⌊h⌋₎ and x₍⌊h⌋+1₎:

QUARTILE.INC:  h = 1 + p(n − 1)    QUARTILE.EXC:  h = p(n + 1)

with p = 0.25 for Q1 and 0.75 for Q3. Then the fences are

IQR = Q3 − Q1  ·  lower fence = Q1 − 1.5 × IQR  ·  upper fence = Q3 + 1.5 × IQR

Worked example

Ten values: 3, 7, 8, 5, 12, 14, 21, 13, 18, 41.

  1. Sort: 3, 5, 7, 8, 12, 13, 14, 18, 21, 41.
  2. Median: n = 10 is even, so Q2 = (12 + 13) ÷ 2 = 12.5.
  3. Q1: the lower half 3, 5, 7, 8, 12 has median 7.
  4. Q3: the upper half 13, 14, 18, 21, 41 has median 18.
  5. IQR = 18 − 7 = 11, so the fences are 7 − 16.5 = −9.5 and 18 + 16.5 = 34.5.
  6. Outliers: 41 is above 34.5, so it is flagged.

How much do the methods differ?

For the same ten values the four methods give:

Method Q1 Q3 IQR
Median of halves (TI-84) 7 18 11
Tukey’s hinges 7 18 11
QUARTILE.INC (Excel, R) 7.25 17 9.75
QUARTILE.EXC (Minitab) 6.5 18.75 12.25

The two median-of-halves methods agree whenever n is even; they differ only for odd n. The interpolation methods can land between data values, and QUARTILE.EXC never gives a narrower IQR than the others because its positions sit closest to the ends. (For odd n it matches the TI-84 method exactly, while QUARTILE.INC matches Tukey’s hinges.) With large data sets the differences shrink to almost nothing, but on homework with ten or fifteen values they can change the answer — so match the method your course or software uses.

Using quartiles well

  • Skewed data: report the median and IQR rather than the mean and standard deviation. Income, response times and home prices are classic examples.
  • Outliers: the 1.5 × IQR rule, introduced by statistician John Tukey, flags values worth a second look. Check them for data-entry errors before deleting anything; real extremes are often the most interesting data.
  • Comparisons: for roughly normal data the IQR is about 1.35 standard deviations, so a much larger ratio hints at heavy tails.

To draw the full box plot with the minimum and maximum use the five number summary calculator, and for any other cut point such as the 90th percentile use the percentile calculator.

Frequently asked questions

What is the interquartile range?

The IQR is Q3 minus Q1, the width of the middle 50% of the data. Because it ignores the lowest and highest quarters, a single extreme value cannot inflate it the way it inflates the range or the standard deviation.

How do I find outliers with the IQR?

Compute the fences Q1 − 1.5 × IQR and Q3 + 1.5 × IQR. Any value outside them is a potential outlier. Values beyond 3 × IQR from the quartiles are often called extreme outliers.

Which quartile method matches Excel?

Excel's QUARTILE.INC (and the older QUARTILE function, Google Sheets and R's default) use the interpolation method at position 1 + p(n − 1). Excel's QUARTILE.EXC uses position p(n + 1). Choose the matching option from the method menu.

Which method does a TI-84 use?

The TI-83 and TI-84 1-Var Stats command takes the median of each half and leaves the overall median out of both halves when n is odd. That is this calculator's default.

What is the quartile deviation?

It is half of the IQR, also called the semi-interquartile range. For roughly symmetric data it measures the typical distance from the median to the quartiles.

Last reviewed October 2026 by the CalcFluent editorial team. How we check our calculators.