Interquartile Range (IQR) Calculator
Find the interquartile range of a data set — the spread of the middle 50% — with Q1, Q3, the median and the 1.5×IQR outlier fences.
How it works
IQR = Q3 − Q1 · Fences = Q1 − 1.5 × IQR and Q3 + 1.5 × IQR (quartiles by linear interpolation)
The interquartile range measures spread using the middle half of the data: the third quartile Q3 minus the first quartile Q1. Because it ignores the smallest and largest quarter of the values, it is far more resistant to outliers than the full range or the standard deviation. This calculator locates the quartiles by linear interpolation (the inclusive method used by most spreadsheets), and applies Tukey’s 1.5 × IQR rule to set the fences beyond which points are flagged.
Worked example
For 1, 2, 3, 4, 5, 6, 7, 8, 9 the median is 5, Q1 interpolates to 3 and Q3 to 7, so the IQR is 7 − 3 = 4. The fences sit at 3 − 6 = −3 and 7 + 6 = 13, and since every value falls inside them, this set has no outliers.
Sources: Interquartile range — Wikipedia
Frequently asked questions
Why use the IQR instead of the range?
The plain range depends entirely on the two most extreme values, so one outlier can distort it completely. The IQR looks only at the middle 50% of the data, giving a robust picture of spread that a single unusual point cannot blow up.
Why do quartiles differ between tools?
There are several accepted quartile definitions. This calculator uses linear interpolation on rank p·(n − 1), matching Excel’s PERCENTILE.INC and NumPy’s default, so a set like 1…9 gives Q1 = 3 and Q3 = 7; a tool using Tukey’s exclusive method can differ slightly.
What do the fences at 1.5 × IQR mean?
They mark the whiskers of a box plot. Values beyond Q1 − 1.5·IQR or Q3 + 1.5·IQR are flagged as potential outliers worth investigating — not automatically errors, just points that sit unusually far from the middle of the data.
Related calculators
For education — check assumptions (sample size, distribution) before using statistics in real decisions.