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.

See also
Key Formula
IQR=Q3−Q1
Where:
- Q1 = The first quartile — the median of the lower half of the data set (25th percentile)
- Q3 = The third quartile — the median of the upper half of the data set (75th percentile)
- 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
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=25+7=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=218+20=19
Step 4: Subtract Q1 from Q3 to find the IQR.
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=28+12=10
Step 2: The lower half is 3, 7, 8. With 3 values, Q1 is the middle value.
Q1=7
Step 3: The upper half is 12, 14, 20. Q3 is the middle value.
Q3=14
Step 4: Calculate the IQR.
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.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 | |
|---|---|---|
| Definition | Difference between Q3 and Q1 | Difference between maximum and minimum values |
| Formula | IQR = Q3 − Q1 | Range = Max − Min |
| Data covered | Middle 50% of the data | Entire 100% of the data |
| Sensitivity to outliers | Resistant — outliers do not affect it | Very sensitive — one extreme value changes it |
| When to use | When data may contain outliers or is skewed | For 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
- First Quartile — The lower boundary Q1 used to compute IQR
- Third Quartile — The upper boundary Q3 used to compute IQR
- Median of a Set of Numbers — The middle value that divides data into halves
- Five Number Summary — Includes Q1, Q3, and thus the IQR
- Outlier — Often identified using the 1.5 × IQR rule
- Difference — The IQR is defined as a difference of two quartiles
- Set — The IQR is computed from a data set
