The interquartile range measures the spread of the middle 50% of a data set โ the gap between the first quartile (Q1, the 25th percentile) and the third quartile (Q3, the 75th percentile) โ making it a more outlier-resistant measure of spread than the full range (max minus min), since it ignores the most extreme 25% at each end.
It's also the standard basis for a widely used outlier detection rule: any value more than 1.5 ร IQR below Q1 or above Q3 is commonly flagged as a potential outlier.
The calculation
Sort your data, find Q1 (the median of the lower half) and Q3 (the median of the upper half), then IQR = Q3 โ Q1. The common outlier fences are Q1 โ 1.5รIQR (lower fence) and Q3 + 1.5รIQR (upper fence) โ any value beyond these is often flagged for closer inspection, though it's a statistical guideline, not an automatic rule for discarding data.
Frequently asked questions
IQR is less sensitive to extreme outliers than standard deviation, since it's based on the middle 50% of the data rather than every value โ useful when your data set might contain genuine anomalies you don't want dominating your spread measure.
A common rule flags any value below Q1 โ 1.5รIQR or above Q3 + 1.5รIQR as a potential outlier โ this is the same method used to determine the 'whiskers' in a box-and-whisker plot.
Not necessarily โ a flagged outlier might be a genuine data entry error worth removing, or a real, meaningful extreme value worth keeping and investigating further. IQR helps you identify candidates for review, not an automatic instruction to delete data.