Mathwords logoMathwords

Interquartile Range — Definition, Formula & Examples

Interquartile Range
IQR

The difference between the first quartile and third quartile of a set of data. This is one way to describe the spread of a set of data.

 

Example showing five-number summary for data {2,5,6,9,12}: min=2, Q1=3.5, median=6, Q3=10.5, max=12; IQR=10.5−3.5=7

 

 

See also

Five-number summary, median, outlier

Key Formula

IQR=Q3Q1\text{IQR} = Q_3 - Q_1
Where:
  • Q1Q_1 = The first quartile — the median of the lower half of the data set (25th percentile)
  • Q3Q_3 = The third quartile — the median of the upper half of the data set (75th percentile)
  • IQR\text{IQR} = The interquartile range — the span of the middle 50% of the data

Worked Example

Problem: Find the interquartile range of the data set: 2, 5, 7, 10, 12, 15, 18, 20, 25.
Step 1: Order the data from least to greatest (already done) and find the median. There are 9 values, so the median is the 5th value.
Median=12\text{Median} = 12
Step 2: Identify the lower half of the data (all values below the median): 2, 5, 7, 10. Find Q1 as the median of this lower half. With 4 values, take the average of the 2nd and 3rd values.
Q1=5+72=6Q_1 = \frac{5 + 7}{2} = 6
Step 3: Identify the upper half of the data (all values above the median): 15, 18, 20, 25. Find Q3 as the median of this upper half.
Q3=18+202=19Q_3 = \frac{18 + 20}{2} = 19
Step 4: Subtract Q1 from Q3 to find the IQR.
IQR=196=13\text{IQR} = 19 - 6 = 13
Answer: The interquartile range is 13.

Another Example

This example uses an even number of data points (so Q1 and Q3 fall exactly on data values rather than averages) and extends the problem to show how the IQR is used to detect outliers via the 1.5 × IQR rule.

Problem: Find the IQR of the data set: 3, 7, 8, 12, 14, 20. Then determine whether the value 42 would be an outlier.
Step 1: The data is already sorted. With 6 values, the median is the average of the 3rd and 4th values.
Median=8+122=10\text{Median} = \frac{8 + 12}{2} = 10
Step 2: The lower half is 3, 7, 8. With 3 values, Q1 is the middle value.
Q1=7Q_1 = 7
Step 3: The upper half is 12, 14, 20. Q3 is the middle value.
Q3=14Q_3 = 14
Step 4: Calculate the IQR.
IQR=147=7\text{IQR} = 14 - 7 = 7
Step 5: A common outlier test flags any value above Q3 + 1.5 × IQR. Calculate this upper fence and compare it to 42.
Q3+1.5×IQR=14+1.5×7=14+10.5=24.5Q_3 + 1.5 \times \text{IQR} = 14 + 1.5 \times 7 = 14 + 10.5 = 24.5
Answer: The IQR is 7. Since 42 > 24.5, the value 42 would be classified as an outlier.

Frequently Asked Questions

What is the difference between range and interquartile range?
The range is the difference between the maximum and minimum values in a data set, so it covers 100% of the data. The interquartile range covers only the middle 50%, from Q1 to Q3. Because the IQR ignores the highest and lowest quarters of the data, it is much less sensitive to outliers and extreme values than the range.
How do you use the IQR to find outliers?
The most common method is the 1.5 × IQR rule. First, compute the IQR. Then calculate the lower fence as Q1 − 1.5 × IQR and the upper fence as Q3 + 1.5 × IQR. Any data value below the lower fence or above the upper fence is considered an outlier.
Does the IQR include the median?
Not exactly. The IQR spans from Q1 to Q3, and the median (Q2) falls within this interval. However, the IQR is a single number representing the width of that interval — it does not tell you the median's value. The median and IQR are often reported together to summarize a data set.

Interquartile Range (IQR) vs. Range

Interquartile Range (IQR)Range
DefinitionDifference between Q3 and Q1Difference between maximum and minimum values
FormulaIQR = Q3 − Q1Range = Max − Min
Data coveredMiddle 50% of the dataEntire 100% of the data
Sensitivity to outliersResistant — outliers do not affect itVery sensitive — one extreme value changes it
When to useWhen data may contain outliers or is skewedFor a quick overall measure of spread

Why It Matters

The IQR appears throughout introductory statistics courses, particularly when constructing box-and-whisker plots (box plots), where the box itself spans from Q1 to Q3. It is also the foundation of the 1.5 × IQR outlier test, one of the first formal methods students learn for identifying unusual data points. Understanding the IQR prepares you for more advanced measures of spread like standard deviation by building intuition about how data clusters around its center.

Common Mistakes

Mistake: Subtracting Q1 − Q3 instead of Q3 − Q1, or confusing Q1 with the minimum and Q3 with the maximum.
Correction: Always subtract in the order Q3 − Q1. Remember that Q1 is the median of the lower half (not the smallest value) and Q3 is the median of the upper half (not the largest value). The IQR should always be a non-negative number.
Mistake: Including the overall median in both halves when splitting the data to find Q1 and Q3.
Correction: When the data set has an odd number of values, the median is one of the actual data points. Exclude this middle value when forming the lower and upper halves to find Q1 and Q3. For example, in {1, 3, 5, 7, 9}, the median is 5; the lower half is {1, 3} and the upper half is {7, 9}.

Related Terms