The interquartile range (IQR) is the spread of the middle 50% of the data: Q3 minus Q1. Unlike the range, it is not affected by outliers, which is why box plots and outlier rules are built on it.
IQR = Q3 − Q1
Which quartile method?
Textbooks and the TI-84 take the median of each half, leaving the median itself out when n is odd. Excel’s QUARTILE.INC and R use linear interpolation, and SPSS and QUARTILE.EXC use the exclusive method. With small samples these can give different answers, so pick the one your course or software uses. The quartile calculator shows all three side by side.