The interquartile range is the distance between the first and third quartiles, so it covers the middle half of the data and ignores the tails completely. That makes it a robust measure of spread: adding an absurd outlier to a dataset changes the standard deviation dramatically but leaves the IQR untouched.
It is also the basis of the box plot. The box spans Q1 to Q3, the line inside marks the median, and the whiskers reach out to one and a half IQRs beyond each quartile. Anything past those Tukey fences is flagged as an outlier — a convention rather than a law, but one that has proved a good default across a very wide range of data.
The quartiles, IQR and fences table below carries 4 pre-computed rows, from 2, 4, 4, 5, 7, 8, 9, 12, 15, 21, 40 to 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, so a figure can be checked against this page without typing anything into it. Nothing has to be entered to see it work: the default for your numbers is 2, 4, 4, 5, 7, 8, 9, 12, 15, 21, 40, and the output recomputes the moment that changes. Alongside the number, 4 bands label it — very tight middle through very wide middle — because a bare figure rarely tells you whether it is unusual. Most visitors arrive here from, or leave for, Z Score Calculator and Variance Calculator.
The formula
Q₁- First quartile, the 25th percentile
Q₃- Third quartile, the 75th percentile
IQR- The interquartile range
Fences- Q₁ − 1.5 IQR and Q₃ + 1.5 IQR
How to use this calculator
- Paste your numbers, separated by commas or spaces.
- The gauge shows the interquartile range.
- Both quartiles, the median and the full range appear below.
- Anything outside the Tukey fences is conventionally treated as an outlier.
Worked examples
Eleven values including one extreme
With the sorted list 2, 4, 4, 5, 7, 8, 9, 12, 15, 21, 40 the quartiles land at 4.5, 8 and 15, giving an IQR of 10.5. The upper fence is 30.75, so 40 is flagged as an outlier.
Robustness against outliers
Replacing that 40 with 400 leaves Q1, the median and Q3 completely unchanged, so the IQR is still 10.5. The standard deviation of the same data would more than treble.
Checking the 10, 10, 10, 10, 10 row
The reference table lists 10, 10, 10, 10, 10, giving Q1: 10.00, Median: 10.00, Q3: 10.00, IQR: 0.00. Entering that above should reproduce the same figures — if it does not, the input is being read differently to the way the table assumes.
How to read your score
Frequently asked questions
How are quartiles calculated?
There are several conventions. This page uses linear interpolation between order statistics, which is the default in most numerical software and matches the standard percentile definition.
Why one and a half interquartile ranges?
It is Tukey convention, chosen so that roughly 0.7% of normally distributed data falls outside the fences. It is a useful default, not a statistical test.
When should I prefer the IQR to the standard deviation?
When the data is skewed or contains outliers you do not want to remove. Income, waiting times and file sizes are all better described by quartiles.
What does a large IQR relative to the range tell me?
That the spread is genuine rather than driven by a few extreme values. If the range is far larger than the IQR, the tails are doing most of the work.
What do the bands under the interquartile range mean?
They label the figure so it can be read without a reference point of your own: Very tight middle from 0 to 2; Modest spread from 2 to 8; Wide middle from 8 to 25; Very wide middle from 25 upwards. The band is a reading aid only — the number itself is exact, and a value sitting just over a boundary is not meaningfully different from one just under it.
What formula does the Interquartile Range Calculator use?
It computes IQR = Q_3 − Q_1, where Q₁ is first quartile, the 25th percentile; Q₃ is third quartile, the 75th percentile; IQR is the interquartile range; Fences is q₁ − 1.5 IQR and Q₃ + 1.5 IQR. The same expression is printed on the page above the inputs, so the result can be reproduced by hand or in a spreadsheet.
Quartiles for sample datasets
| Dataset | Q1 | Median | Q3 | IQR | Upper fence |
|---|---|---|---|---|---|
| 2, 4, 4, 5, 7, 8, 9, 12, 15, 21, 40 | 4.50 | 8.00 | 13.50 | 9.00 | 27.00 |
| 1, 2, 3, 4, 5, 6, 7, 8 | 2.75 | 4.50 | 6.25 | 3.50 | 11.50 |
| 10, 10, 10, 10, 10 | 10.00 | 10.00 | 10.00 | 0.00 | 10.00 |
| 3, 6, 9, 12, 15, 18, 21, 24, 27, 30 | 9.75 | 16.50 | 23.25 | 13.50 | 43.50 |
Quartiles here use linear interpolation, the standard percentile definition.