How to Find the Interquartile Range

A step-by-step guide to the IQR, with a worked example

Quick answer: The interquartile range is IQR = Q3 − Q1. Sort your data, find the first quartile (Q1, the 25th percentile) and the third quartile (Q3, the 75th percentile), then subtract Q1 from Q3. The result is the spread of the middle 50% of the data.

Open the IQR Calculator →

What the interquartile range tells you

The interquartile range measures spread using only the central half of a data set, so it ignores the smallest and largest quarter of the values. That makes it far more resistant to outliers than the full range or the standard deviation, and it is the basis for the standard rule used to flag outliers on a box plot.

Worked example

Data: 3, 7, 8, 5, 12, 14, 21, 13, 18

1. Sort it: 3, 5, 7, 8, 12, 13, 14, 18, 21 (n = 9).

2. The median is the 5th value: 12.

3. Lower half (values below the median): 3, 5, 7, 8 → Q1 = (5 + 7) ÷ 2 = 6.

4. Upper half (values above the median): 13, 14, 18, 21 → Q3 = (14 + 18) ÷ 2 = 16.

5. IQR = Q3 − Q1 = 16 − 6 = 10.

A note on quartile methods

When the data set has an odd number of values, textbooks disagree on whether to include the median in each half. The example above uses the Tukey method, which excludes it. The Moore & McCabe method includes the median in both halves, and Excel’s QUARTILE.INC uses linear interpolation instead. These can give slightly different quartiles, so use the method your course expects — the IQR calculator lets you switch between all three.

Using the IQR to find outliers

Once you have the IQR, the standard outlier check is the 1.5 × IQR rule: any value below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR is a potential outlier. In the example, those fences are 6 − 15 = −9 and 16 + 15 = 31, so none of the values qualify.

Step by step

  1. Sort the data. Arrange all the values in ascending order.
  2. Find the median. The median (Q2) splits the data into a lower and an upper half.
  3. Find Q1. Take the median of the lower half — this is the first quartile.
  4. Find Q3. Take the median of the upper half — this is the third quartile.
  5. Subtract. IQR = Q3 − Q1.

Frequently asked questions

What is the interquartile range in simple terms?

It is the range of the middle 50% of your data — the distance between the 25th percentile (Q1) and the 75th percentile (Q3).

Why is the IQR better than the range for spread?

The full range depends on the two most extreme values, so a single outlier can distort it. The IQR ignores the outer quarters, making it more robust.

Can the IQR be zero?

Yes. If at least half the values are identical so that Q1 equals Q3, the IQR is zero.

Calculators

More guides