What Is the Interquartile Range (IQR)? Complete Guide
Introduction
Imagine grading 200 exam papers. The scores range from 12 to 100, but most students scored between 65 and 82. The overall range (88 points) exaggerates how spread out the scores really are because a few extreme values stretch the endpoints. The interquartile range zeroes in on the middle 50% of scores, giving a much more honest picture of typical variability.
The interquartile range (IQR) is one of the most important measures of spread in descriptive statistics. It measures the range of the middle half of a dataset, making it resistant to outliers and skewed data.
What Is the IQR?
The interquartile range is the difference between the third quartile (Q3) and the first quartile (Q1):
IQR = Q3 − Q1
Q1 marks the 25th percentile, meaning 25% of data falls below it. Q3 marks the 75th percentile. The IQR captures everything in between — the middle 50% of all values.
Why the IQR Matters
Unlike the full range (maximum minus minimum), the IQR is robust. A single extreme value can double the range but barely moves Q1 or Q3. This property makes the IQR especially valuable for:
- Skewed data: Salary distributions, housing prices, and medical costs often have long right tails. The IQR describes the spread of typical values without distortion.
- Outlier detection: The 1.5 × IQR rule is the standard method for flagging unusual observations in box plots and exploratory analysis.
- Comparing groups: When comparing test scores across schools or patient recovery times across hospitals, the IQR provides a fair, outlier-resistant comparison.
How to Calculate the IQR Step by Step
Consider this dataset of daily commute times (in minutes): 15, 20, 22, 25, 28, 30, 32, 35, 45.
- Sort the data (already sorted above).
- Find the median (Q2): With 9 values, the median is the 5th value = 28.
- Find Q1: The median of the lower half (15, 20, 22, 25) = (20 + 22) ÷ 2 = 21.
- Find Q3: The median of the upper half (30, 32, 35, 45) = (32 + 35) ÷ 2 = 33.5.
- Calculate IQR: 33.5 − 21 = 12.5 minutes.
The middle 50% of commute times spans 12.5 minutes. The full range is 30 minutes (45 − 15), but the IQR reveals that most commuters experience much less variation.
Check Q1, Q3, and their difference with the free interquartile range calculator.
Quick Check
The 1.5 IQR Rule for Outlier Detection
The most common use of the IQR beyond measuring spread is detecting outliers. The 1.5 × IQR rule (also called the 1.5 IQR rule or Tukey's fence method) defines boundaries called "fences":
- Lower fence: Q1 − 1.5 × IQR
- Upper fence: Q3 + 1.5 × IQR
Any value below the lower fence or above the upper fence is considered a potential outlier. Using the commute example above:
- Lower fence: 21 − 1.5(12.5) = 21 − 18.75 = 2.25
- Upper fence: 33.5 + 1.5(12.5) = 33.5 + 18.75 = 52.25
All values fall within these fences, so there are no outliers in this dataset. If someone had a 90-minute commute, it would fall above 52.25 and be flagged.
IQR vs. Range vs. Standard Deviation
Three common measures of spread serve different purposes:
| Measure | Formula | Resistant to Outliers? | Best For |
|---|---|---|---|
| Range | Max − Min | No | Quick, rough spread |
| IQR | Q3 − Q1 | Yes | Skewed data, outlier detection |
| Standard Deviation | √(Σ(x−x̄)²/n) | No | Symmetric data, inferential stats |
For a deeper comparison, see Five Number Summary vs. Mean & Standard Deviation.
The IQR in Box Plots
In a box plot, the IQR is the height (or width) of the box itself. The box stretches from Q1 to Q3, with a line at the median. The whiskers extend to the most extreme non-outlier values, and any points beyond the fences appear as individual dots.
A tall box indicates high variability in the middle 50% of data. A short, compact box means the central values are tightly clustered. Comparing box widths across groups instantly reveals which group has more consistent values.
Software Note
QUARTILE.INC (interpolation method), while the TI-84 uses the exclusive method. These can produce slightly different Q1 and Q3 values for small datasets, which means the IQR may differ too. See Quartile Methods Compared for details.Real-World Applications
Healthcare
Hospital administrators track the IQR of patient wait times to understand typical variability. An IQR of 8 minutes means the middle 50% of patients waited within an 8-minute window, even if one patient waited 3 hours.
Education
A teacher comparing two classes might find both have a median score of 75, but Class A has an IQR of 10 and Class B has an IQR of 25. Class B has much more variability in student performance.
Quality Control
Manufacturing processes use the IQR to monitor consistency. A low IQR on product weight measurements indicates tight quality control; a rising IQR signals that the process may be drifting.
Common Mistakes
- Forgetting to sort first: Quartiles require sorted data. Unsorted data produces meaningless results.
- Confusing IQR with range: The IQR is Q3 − Q1, not Max − Min.
- Using the wrong quartile method: Different software may produce slightly different quartile values. Always note which method was used.
- Interpreting IQR as "most data": The IQR contains exactly 50% of the data, not "most" of it.
Calculate the IQR Instantly
The Five Number Summary Calculator computes Q1, Q3, and the IQR automatically for any dataset. Enter values separated by commas, spaces, or line breaks to see results instantly.
Verify Your Calculations
Use the free five number summary calculator to check your work.
Open CalculatorWritten by Oge Nwaozuzu
Statistics educator and data analyst. Creator of 5numbersummarycalculator.app.