Interquartile Range (IQR) Calculator
The interquartile range (IQR) is the span covered by the middle 50% of the data: the difference between the third and the first quartile. Unlike the standard deviation it is untouched by extreme observations, which makes it the most dependable measure of spread for skewed distributions and data containing outliers.
This calculator sorts your data, finds Q1, the median (Q2), and Q3, computes the IQR, and derives the Tukey outlier fences (Q1 − k·IQR, Q3 + k·IQR). Quartiles can be produced either by linear interpolation (R-7), the default in Excel and R, or by Tukey hinges, the classic box-plot definition. The output includes the five-number summary, the quartile deviation, the quartile coefficient of dispersion, the trimean, the list of outliers, a box plot, and a histogram.
Interquartile Range Formulas
Interquartile range: IQR = Q3 − Q1 Q1 position (R-7): (n − 1)·0.25 + 1 (intermediate values interpolated linearly) Q3 position (R-7): (n − 1)·0.75 + 1 Tukey hinges: Q1 = median of the lower half, Q3 = median of the upper half Outlier fences: [ Q1 − k·IQR , Q3 + k·IQR ] (k = 1.5 or 3) Quartile deviation: QD = IQR / 2 Quartile coefficient: (Q3 − Q1) / (Q3 + Q1) Trimean: TM = (Q1 + 2·Q2 + Q3) / 4 Under normality: IQR ≈ 1.349 · σ
There is more than one definition of the quartiles; this tool reports both linear interpolation (R-7), the Excel and R default, and Tukey hinges, the classic box-plot definition, and shows the result of the method you did not select in the table.
How to Calculate
- Paste your data values into the box; at least 4 observations are required.
- Choose the quartile method: linear interpolation to match Excel and R, Tukey hinges for the classic box plot.
- Set the outlier coefficient: 1.5·IQR flags possible outliers, 3·IQR flags only extreme ones.
- Read the IQR: it tells you how wide a range the middle 50% of the data covers.
- Look at where the median sits inside the box on the plot; if it is off-center, the distribution is skewed.
- Go back to the data to check any flagged outliers, and state in your report which rule you used.
Worked Examples
Salary series with an outlier
For 12 observations, Q1 = 29.50, the median is 34, and Q3 = 40.50, so the IQR is 11. The fences are 29.50 − 1.5·11.00 = 13.00 and 40.50 + 1.5·11.00 = 57.00; the value 78.00 lies beyond the upper fence and is flagged as the single outlier. The wider upper quartile shows that the distribution is right-skewed.
Number of values (n): 12 · Minimum (min): 22.00 · First quartile (Q1, 25%): 29.50
The same data with Tukey hinges
Computed with Tukey hinges, the same series gives Q1 = 29 as the median of the lower half and Q3 = 41 as the median of the upper half, so the IQR becomes 12. The fences widen to 11 and 59, yet 78 is still an outlier. The one-unit difference in the IQR shows how the choice of method can change the result in small samples.
Number of values (n): 12 · Minimum (min): 22.00 · First quartile (Q1, 25%): 29.00
Extreme outlier fence (3·IQR)
For 10 observations, Q1 = 17.50, the median is 20.50, and Q3 = 23.75, giving an IQR of 6.25. With the 3·IQR rule the fences are -1.25 and 42.50, and the value 60.00 is flagged as an extreme outlier. On the same data the 1.5·IQR rule would narrow the fences to 8.13 – 33.13; the larger the coefficient, the more only genuinely extreme observations are caught.
Number of values (n): 10 · Minimum (min): 14.00 · First quartile (Q1, 25%): 17.50