Key takeaways
- The IQR covers the middle 50% and ignores the extreme quarters.
- Two quartile conventions are common. Tukey’s median-of-halves and the inclusive interpolation method can differ on small samples.
- The 1.5×IQR fence is a convention, not a law. It flags values for review, not automatic deletion.
- IQR is robust to outliers; the standard deviation is not.
- Box-plot whiskers end at the most extreme value inside the fences, not at the fences themselves.
- Always state which quartile method produced the numbers.
Quartiles and the five-number summary
Quartiles split an ordered dataset into four parts, each containing roughly a quarter of the observations. Q1 is the first quartile or 25th percentile, Q2 is the median or 50th percentile, and Q3 is the third quartile or 75th percentile. Together with the minimum and maximum, they form the five-number summary used in box plots.
The median is the middle value, or the average of the two middle values when n is even. Q1 is the median of the lower half of the data, and Q3 is the median of the upper half, with the overall median excluded when n is odd under Tukey’s convention. The IQR is the distance between Q3 and Q1.
Two common quartile methods
Tukey’s method splits the data at the median and takes the median of each half. For 3, 5, 7, 8, 10, 12, 15, 18, 20, the median is 10. The lower half is 3, 5, 7, 8, so Q1 = (5 + 7) ÷ 2 = 6. The upper half is 12, 15, 18, 20, so Q3 = (15 + 18) ÷ 2 = 16.5. The IQR is 10.5.
The inclusive interpolation method uses position i = (P/100)(n − 1) + 1 for each percentile. For n = 9, Q1 is at position 1 + 0.25 × 8 = 3, giving 7, and Q3 is at position 1 + 0.75 × 8 = 7, giving 15. The IQR is 8. Same data, different quartiles, and a 2.5-unit difference in the IQR.
Neither is wrong. Software exposes both, and different defaults cause frequent disagreement. Choose one, state it, and use it consistently.
Interpreting the IQR
The IQR is the width of the interval that contains the middle half of the observations. An IQR of 10.5 means the middle 50% of values span 10.5 units. It has the same units as the data, so it can be compared with the median or with a meaningful threshold.
Because it ignores the lowest and highest quarters, the IQR is resistant to extreme values. A single data-entry error of 450 instead of 45 will barely move Q1 and Q3, while it can inflate the standard deviation enormously. That robustness is why the IQR is preferred for skewed data such as income, house prices, and waiting times.
The trade-off is lost information: two datasets with the same IQR can have very different extremes. Pair it with a plot rather than relying on one number.
Outlier fences: 1.5 × IQR
A common rule flags observations below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR. With Tukey quartiles, the lower fence is 6 − 15.75 = −9.75 and the upper fence is 16.5 + 15.75 = 32.25. Nothing in the original data is flagged.
Replace 20 with 45 and the quartiles stay Q1 = 6 and Q3 = 16.5, so the upper fence is still 32.25. The value 45 lies beyond it and is flagged. The same value would also be flagged under the inclusive method, whose upper fence is 15 + 12 = 27.
The multiplier 1.5 is a convention chosen to flag roughly 0.7% of a normal sample. Some fields use 3 × IQR for “extreme” outliers and 1.5 × IQR for “mild” ones. A flagged value is a prompt to investigate, not proof of an error; genuine heavy tails produce genuine outliers.
IQR versus standard deviation and range
The range is the maximum minus the minimum. It is simple but depends on only two observations and is extremely sensitive to outliers. The standard deviation uses every value and is the natural spread measure for roughly normal data, but a single extreme observation can dominate it. The IQR sits between them: it uses the order of the data, ignores the tails, and stays stable under contamination.
For a normal distribution, the IQR is about 1.35 standard deviations, so σ ≈ IQR ÷ 1.35. That conversion is handy for a quick check but should not be used to replace a standard deviation when the data are skewed. Report both when the audience needs to compare spread across methods.
Box plots and whiskers
A box plot draws a box from Q1 to Q3 with a line at the median. Whiskers extend to the smallest and largest observations that lie inside the fences, and points beyond the whiskers are plotted individually. The whiskers are not the fences themselves; they stop at the most extreme data value that is still inside.
For the data with 45, the upper whisker ends at 18 because 45 is beyond the 32.25 fence. A reader who assumes the whisker is the maximum will misread the plot. Box plots also hide multimodality: a bimodal distribution can produce a single wide box that looks like a symmetric spread.
Quartiles from grouped data
When data are grouped into classes, quartiles are estimated by interpolation within the class that contains the target position:
Q = L + ((p × N − CF) ÷ f) × w
Here L is the lower boundary of the class, N is the total frequency, CF is the cumulative frequency before the class, f is the class frequency, and w is the class width. For classes 0–10 (5), 10–20 (8), 20–30 (12), 30–40 (5), N = 30. Q1 is at position 7.5, inside 10–20: Q1 = 10 + ((7.5 − 5) ÷ 8) × 10 = 13.125. Q3 is at position 22.5, inside 20–30: Q3 = 20 + ((22.5 − 13) ÷ 12) × 10 ≈ 27.92.
The estimate assumes the observations are spread evenly within each class. With wide or irregular classes, that assumption can shift the quartile by a meaningful amount, so grouped-data quartiles are approximations, not exact values.
Comparing distributions with quartiles
Two groups can be compared by their medians and IQRs: a higher median means the typical value is larger, and a larger IQR means the middle half is more spread out. The ratio IQR ÷ median expresses spread relative to level and is useful when the groups have very different scales.
In reports, a median and IQR pair conveys the typical case and the spread of the middle half without being dragged by a few extreme values. Add the 5th and 95th percentiles when the tails matter.
Common mistakes
- Mixing quartile conventions. Tukey and inclusive methods can differ by a full observation on small samples.
- Treating a fence as a deletion rule. Outliers may be real and important; investigate before removing.
- Assuming the whisker equals the maximum. It ends at the most extreme value inside the fence.
- Confusing IQR with range. The IQR ignores the tails by design.
- Using IQR fences on a tiny sample. With fewer than about 10 values, quartiles are unstable.
- Reading a box plot as a density. The box does not show where values cluster inside the middle half.
Practical caveats
Quartiles are order statistics, so they are meaningful for ordinal data and robust to monotone transformations, but they are not additive across groups. Combining two groups requires pooling the raw data or using weighted quantile methods; averaging the two IQRs is not the IQR of the combined group.
With many ties, several observations may share a quartile value, and the interpolation may return a number that is not a possible observation. That is acceptable for continuous variables but awkward for counts or ratings. For very small samples, report all the values instead of a five-number summary that implies more precision than the data support.
Frequently asked questions
Is Q2 always the median?
Yes. Q2 is the 50th percentile, which is the median by definition, though interpolation methods can give slightly different values for even-sized samples.
Should I use the IQR or the standard deviation?
Use the IQR for skewed data or when outliers are present. Use the standard deviation for roughly symmetric data and when you need a measure that uses every observation.
What counts as an outlier with the IQR rule?
Any value below Q1 − 1.5×IQR or above Q3 + 1.5×IQR. Some fields use 3×IQR for extreme outliers. The rule is a convention, not a statistical test.
Why do calculators give different quartiles for the same data?
They use different definitions: median-of-halves, inclusive interpolation, or exclusive interpolation. The data are the same; the position formula differs.
Can the IQR be zero?
Yes. If at least half the observations share the same value, Q1 and Q3 can both equal that value, making the IQR zero. Fences then collapse to that value.
How do I find quartiles for an even number of values?
Split the sorted data into two equal halves and take the median of each half. With 8 values, each half has 4, and Q1 and Q3 are the averages of the middle two values in each half.
Further reading