IQR Calculator
The interquartile range (IQR) is the spread of the middle 50% of your data, Q3 minus Q1, and it powers the standard rule for spotting outliers. Paste a column of numbers and this calculator returns the quartiles, the IQR, the five-number summary, the 1.5 and 3 times IQR fences, and every value that falls beyond them, drawn on a labeled boxplot. It uses R's default type-7 quartiles, with a type-6 toggle and matching R code.
I want to flag outliers in my data with the 1.5 IQR rule
-
How these numbers are computed
✓ No data leaves your browser
✓ Verified against R's quantile(), IQR(), fivenum() and boxplot.stats()
✓ Free, no sign-up
The IQR and the 1.5 rule, in plain terms
The IQR measures spread using only the middle half of the data, so a handful of extreme values cannot inflate it the way they inflate the standard deviation. That robustness is exactly what makes it the basis for the most-used outlier rule.
Sort the data, find Q1 (25th percentile) and Q3 (75th percentile), and take Q3 minus Q1. That width holds the central 50% of the values. A large IQR means the middle of the data is spread out; a small one means it is tightly packed.
Draw a lower fence at Q1 minus 1.5 times the IQR and an upper fence at Q3 plus 1.5 times the IQR. Anything past a fence is unusual relative to the bulk of the data. This is the rule a boxplot uses to decide which points get drawn as dots.
Widen the multiplier to 3 times the IQR for Tukey's far-out fences. Points between the 1.5 and 3 fences are mild outliers; points beyond the 3 fence are extreme and usually deserve a data-entry or measurement check.
What each measure means
| Measure | What it tells you | In R |
|---|---|---|
| Q1, Q3 (quartiles) | The 25th and 75th percentiles, the edges of the box. | quantile(x, c(.25, .75)) |
| Median (Q2) | The 50th percentile, the middle value, robust to outliers. | median(x) |
| IQR | Q3 minus Q1, the width of the middle 50% of the data. | IQR(x) |
| Five-number summary | Minimum, Q1, median, Q3, maximum, everything a boxplot draws. | quantile(x) |
| 1.5 IQR fences | Q1 minus 1.5 IQR and Q3 plus 1.5 IQR, the outlier cut-offs. | Q1 - 1.5*IQR(x) |
| Outliers | Values beyond a fence, split into mild and extreme. | boxplot.stats(x)$out |
The calculator reports all of these for your data. The five-number summary and IQR use the type-7 quartiles that quantile() and IQR() return; the flagged outliers match boxplot.stats(x)$out.
Frequently asked questions
How do I calculate the interquartile range (IQR)?
The IQR is the third quartile minus the first quartile: IQR = Q3 - Q1. Paste your numbers and the calculator sorts them, finds Q1 (the 25th percentile) and Q3 (the 75th percentile) with R's default type-7 rule, and subtracts. The IQR is the width of the middle 50% of the data and is not swayed by extreme values the way the range or standard deviation are.
How does the 1.5 times IQR rule flag outliers?
Build two fences: a lower fence at Q1 - 1.5*IQR and an upper fence at Q3 + 1.5*IQR. Any value below the lower fence or above the upper fence is flagged as an outlier. Widen the multiplier to 3 times the IQR to get Tukey's far-out fences: points beyond those are extreme outliers, while points between the 1.5 and 3 fences are mild.
What is the five-number summary?
It is the minimum, Q1, the median, Q3 and the maximum. That is exactly what a boxplot draws: the box spans Q1 to Q3 with a line at the median, and the whiskers reach toward the min and max, stopping at the last point still inside the fences. Points past the fences are drawn separately as outlier dots.
Which quartile method does this use, type 7 or type 6?
By default it uses R's type-7 quantiles, the same rule as quantile(x) and IQR(x) with no type argument, which also matches Excel's PERCENTILE.INC and QUARTILE.INC. The toggle switches to type-6 (Minitab and older SPSS), which pushes the quartiles a little further into the tails and so reports a slightly larger IQR on small samples.
Does this match R's boxplot and boxplot.stats?
Yes for the flagged outliers. R's boxplot() and fivenum() build the box from Tukey's hinges, a quartile rule that differs slightly from type-7, but across every test dataset the list of flagged points matches boxplot.stats(x)$out exactly, because no value falls in the small gap between the two fence definitions. The IQR and quartile numbers use the type-7 rule that IQR() and quantile() report.
What is the difference between a mild and an extreme outlier?
A mild outlier lies beyond the 1.5 IQR fence but inside the 3 IQR fence; an extreme outlier lies beyond the 3 IQR fence. The split is Tukey's: mild outliers are worth a look, extreme ones almost always deserve a data-entry or measurement check. The calculator labels every flagged point mild or extreme.