How to Find Quartiles and the Interquartile Range (IQR)

Sort the data, split it at the median, and find the median of each half. Worked odd and even examples, outlier fences, and why methods disagree.

Quartiles split sorted data into four equal parts. To find them, sort the values, find the median (Q2), then find the median of the lower half (Q1) and the median of the upper half (Q3). The interquartile range (IQR) = Q3 − Q1 measures the spread of the middle 50%. For the data 12, 15, 17, 19, 20, 23, 24, 26, 29, 31, 58, the quartiles are Q1 = 17, Q2 = 23 and Q3 = 29, so the IQR is 12.

Step-by-step: odd number of values

Data (n = 11, already sorted): 12, 15, 17, 19, 20, 23, 24, 26, 29, 31, 58

  1. Median (Q2): the middle value is the 6th, 23.
  2. Lower half: the five values below the median: 12, 15, 17, 19, 20. Its median is Q1 = 17.
  3. Upper half: the five values above the median: 24, 26, 29, 31, 58. Its median is Q3 = 29.
  4. IQR: 29 − 17 = 12.

With an odd count, the overall median is left out of both halves under this method, which is the one most US textbooks and TI-83/84 calculators use.

Step-by-step: even number of values

Data (n = 10): 4, 7, 8, 10, 12, 13, 15, 18, 21, 25

  1. Median (Q2): average the 5th and 6th values: (12 + 13) ÷ 2 = 12.5.
  2. Lower half: 4, 7, 8, 10, 12 → Q1 = 8.
  3. Upper half: 13, 15, 18, 21, 25 → Q3 = 18.
  4. IQR: 18 − 8 = 10.

With an even count, the data splits cleanly into two halves and no value is excluded.

The five-number summary and box plots

Quartiles combine with the minimum and maximum into the five-number summary, the recipe for a box-and-whisker plot.

Statistic Odd example Even example
Minimum 12 4
Q1 17 8
Median (Q2) 23 12.5
Q3 29 18
Maximum 58 25
IQR 12 10

The box runs from Q1 to Q3 with a line at the median, and the whiskers extend toward the minimum and maximum. The five number summary calculator draws the box plot for you.

Finding outliers with the 1.5 × IQR rule

The IQR gives a standard way to flag unusual values, proposed by the statistician John Tukey:

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

Odd example: IQR = 12, so 1.5 × IQR = 18

Lower fence = 17 − 18 = −1   ·   Upper fence = 29 + 18 = 47

58 is above 47, so 58 is flagged as an outlier

Values beyond Q1 − 3 × IQR or Q3 + 3 × IQR (here, below −19 or above 65) are sometimes labeled extreme outliers. In a box plot, outliers are drawn as separate dots and the whiskers stop at the most extreme values inside the fences.

A flagged value is not automatically an error. It might be a typo, a measurement problem, or a genuine and important observation. Investigate before deleting anything. The outlier calculator applies both the IQR rule and the z-score rule described in how to calculate a z-score.

Why the IQR beats the range

The range (maximum − minimum) uses only the two most extreme values. In the odd example, the range is 58 − 12 = 46, inflated by a single outlier. The IQR of 12 describes the spread of the typical values and does not move at all if 58 changes to 580. That resistance is why the IQR pairs naturally with the median, while the standard deviation pairs with the mean. See mean vs median vs mode for when to use each.

IQR = Q3 − Q1

For roughly normal data, the IQR is about 1.35 standard deviations, so IQR ÷ 1.35 gives a quick, outlier-resistant estimate of the standard deviation.

Why different tools give different quartiles

There is no single universal definition of a quartile. Statistical software packages offer up to nine variants. Here are the main ones applied to the even example (4, 7, 8, 10, 12, 13, 15, 18, 21, 25):

Method Used by Q1 Q3 IQR
Median of halves Most US textbooks, TI-84 8 18 10
Inclusive interpolation, position 1 + p(n − 1) Excel QUARTILE.INC, Google Sheets, R default 8.5 17.25 8.75
Exclusive interpolation, position p(n + 1) Excel QUARTILE.EXC, Minitab 7.75 18.75 11

The interpolation methods find a fractional position and go part of the way between two neighbors. For QUARTILE.INC, Q1 sits at position 1 + 0.25 × 9 = 3.25, a quarter of the way from the 3rd value (8) to the 4th (10): 8 + 0.25 × 2 = 8.5.

For the odd example, the median-of-halves and QUARTILE.EXC methods both give Q1 = 17 and Q3 = 29, while QUARTILE.INC gives 18 and 27.5. None of these is wrong. Use the method your course, software or industry specifies, and say which one you used. The quartile calculator shows four methods side by side.

Quartiles, percentiles and deciles

Quartiles are special percentiles: Q1 is the 25th percentile, Q2 the 50th and Q3 the 75th. Deciles split data into tenths and percentiles into hundredths, using the same position-and-interpolation logic. A score “in the top quartile” is above Q3, the top 25%. For other cut points, use the percentile calculator.

Common mistakes

  • Not sorting first. Quartiles depend entirely on order.
  • Including the median in both halves when your course excludes it (or vice versa). Check which convention applies.
  • Reporting the IQR as a range of two numbers. “17 to 29” describes the middle half; the IQR is the single number 12.
  • Treating fence violations as errors without checking the data.

A stem-and-leaf plot makes sorting a small data set by hand much easier, and the range calculator gives the full spread for comparison. The descriptive statistics calculator reports quartiles together with the mean and standard deviation.

Frequently asked questions

How do you find Q1 and Q3?

Sort the data and find the median (Q2). Q1 is the median of the lower half of the data and Q3 is the median of the upper half. When the number of values is odd, leave the overall median out of both halves under the method most US textbooks and TI-84 calculators use.

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, it is not affected by extreme values, which makes it a robust measure of spread.

How do you use the IQR to find outliers?

Compute the fences Q1 − 1.5 × IQR and Q3 + 1.5 × IQR. Any value below the lower fence or above the upper fence is flagged as a potential outlier. Values beyond 3 × IQR from the quartiles are often called extreme outliers.

Why does Excel give different quartiles than my textbook?

There are several accepted ways to define quartiles. Most textbooks and TI calculators take the median of each half, while Excel's QUARTILE.INC and QUARTILE.EXC interpolate between data values at different positions. For small data sets the results can differ noticeably; for large ones they converge.

Is Q2 the same as the median?

Yes. The second quartile is the median, the value that splits the sorted data into two equal halves. Q1 is the 25th percentile and Q3 is the 75th percentile.