The 1.5 × IQR rule
| Quantity | Formula |
|---|---|
| Interquartile range | IQR = Q3 − Q1 |
| Lower fence | Q1 − 1.5 × IQR |
| Upper fence | Q3 + 1.5 × IQR |
| Outlier | Any value outside the fences |
Worked example
Data: 2, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 58 (13 values).
- Median = 27 (the 7th value).
- Lower half: 2, 21, 23, 24, 25, 26, so Q1 = (23 + 24) ÷ 2 = 23.5. Upper half: 28, 29, 30, 31, 33, 58, so Q3 = (30 + 31) ÷ 2 = 30.5.
- IQR = 30.5 − 23.5 = 7, and 1.5 × IQR = 10.5.
- Fences: 23.5 − 10.5 = 13 and 30.5 + 10.5 = 41.
- 2 is below 13 and 58 is above 41, so both are outliers. Both are also beyond 3 × IQR (2.5 and 51.5), so they are extreme.
Load “With outliers” above to follow along.
Why 1.5?
The rule comes from John Tukey’s box plot. For normally distributed data, the fences fall about 2.7 standard deviations from the mean, so only about 0.7% of values would be flagged by chance. It is a convention, not a law; some fields use 2 × or 3 × IQR instead.
Prefer to measure unusualness in standard deviations? Use the z-score calculator (values with |z| above 3 are often treated as outliers). To draw the result, open the box plot maker.
Another example: one suspicious value
Reaction times (in hundredths of a second): 12, 14, 15, 15, 16, 17, 18, 19, 21, 48. Q1 = 15 and Q3 = 19, so IQR = 4 and the fences are 15 − 6 = 9 and 19 + 6 = 25. The value 48 is far above 25, so it is an outlier, perhaps a moment of distraction or a typo for 18. Check the original record before deciding what to do with it.
Common mistakes to avoid
- Deleting outliers automatically. First check whether a value is an error. Genuine outliers are often the most interesting data.
- Using fences from a different quartile method. Q1 and Q3 change slightly between methods, and so can the outlier list for borderline values.
- Using the IQR rule on tiny samples. With very few values, the quartiles are unstable.
Do it in other software
| Software | How |
|---|---|
| Excel | =QUARTILE.INC(r,3) − QUARTILE.INC(r,1) for the IQR; fences from Q1 − 1.5*IQR and Q3 + 1.5*IQR. |
| Python | q1, q3 = np.percentile(x, [25, 75]); iqr = q3 − q1; x[(x < q1 − 1.5*iqr) | (x > q3 + 1.5*iqr)] |
| TI-84 | 1-Var Stats gives Q1 and Q3; the modified box plot draws outliers automatically. |
Related tools: Box Plot Maker, Five-Number Summary Calculator, Z-Score Calculator, Histogram Maker and Descriptive Statistics Calculator.