The interquartile range measures how spread out the central half of a data set is. It is the distance between the first and third quartiles, so it ignores the lowest and highest quarters of the data entirely. That makes it a robust measure of spread: one extreme salary or a mistyped reading changes the range and the standard deviation a lot, but barely moves the IQR.
The IQR is used to compare the variability of groups, to draw box plots, to scale data robustly and, through the 1.5 × IQR rule, to define outliers. For roughly normal data the IQR is about 1.35 standard deviations, so IQR ÷ 1.35 is a quick robust estimate of σ.
This calculator defaults to the (n + 1) position method, which interpolates Q1 at rank (n + 1)/4 and Q3 at rank 3(n + 1)/4. If your class finds quartiles as medians of halves, or uses Excel’s QUARTILE.INC, switch the method and the IQR updates.
How to use the Interquartile Range Calculator
- Data set
- Quartile method
Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.
How it works
Sort the data, locate Q1 and Q3 with the chosen method (interpolating between neighbouring values when the position is fractional) and subtract: IQR = Q3 − Q1.
Worked example
Data: 3, 7, 8, 12, 13, 14, 18, 21, 25, 30 (n = 10). With the (n + 1) method Q1 sits at position 11/4 = 2.75: 7 + 0.75 × (8 − 7) = 7.75. Q3 sits at position 33/4 = 8.25: 21 + 0.25 × (25 − 21) = 22. IQR = 22 − 7.75 = 14.25. The textbook halves method gives Q1 = 8, Q3 = 21 and IQR = 13; Excel’s QUARTILE.INC gives 9 and 20.25, so IQR = 11.25.
IQR versus other measures of spread
| Measure | Uses | Sensitive to outliers? |
|---|---|---|
| Range | min and max | Very |
| Standard deviation | every value, squared | Yes |
| Mean absolute deviation | every value | Somewhat |
| IQR | Q1 and Q3 | No |
| Median absolute deviation | the median of deviations | No |
Quartile methods compared
Statistics packages do not agree on one definition of a quartile. For the 10 values 68, 72, 75, 79, 81, 84, 86, 90, 93, 97 the four methods offered here give:
| Method | Used by | Q1 | Q3 | IQR |
|---|---|---|---|---|
| Median of halves (median excluded) | TI-84, most school textbooks | 75 | 90 | 15 |
| Linear interpolation, position 1 + (n − 1)p | Excel QUARTILE.INC, R type 7, Google Sheets | 76 | 89 | 13 |
| (n + 1)p positions | Excel QUARTILE.EXC, Minitab | 74.25 | 90.75 | 16.5 |
| Median of halves (median included) | Tukey’s hinges | 75 | 90 | 15 |
With an even number of values the two “halves” methods coincide; they differ only when n is odd. The differences shrink as the data set grows, so with a few hundred values the choice rarely matters.
Formula
IQR = Q3 − Q1 · Q1 at position (n + 1)/4, Q3 at 3(n + 1)/4 (interpolated) · quartile deviation = IQR ÷ 2
Worked example
Inputs: Data set: 3, 7, 8, 12, 13, 14, 18, 21, 25, 30; Quartile method: (n + 1) positions (Excel QUARTILE.EXC, Minitab).
Results: Interquartile range (IQR = Q3 − Q1) = 14.25; First quartile (Q1) = 7.75; Third quartile (Q3) = 22; Median (Q2) = 13.5; Quartile deviation (IQR ÷ 2) = 7.125; Lower fence (Q1 − k × IQR) = -13.625.
Key terms
- Interquartile range (IQR)
- Q3 − Q1.
- Quartile deviation
- Half the IQR.
- Robust statistic
- A measure that changes little when a few values are extreme.
- 1.5 × IQR rule
- Values more than 1.5 IQR beyond the quartiles are flagged as outliers.
Frequently asked questions
What is the interquartile range?
Q3 − Q1, the width of the range that holds the middle half of the data.
How do I calculate the IQR?
Sort the data, find Q1 and Q3 and subtract. For 3, 7, 8, 12, 13, 14, 18, 21, 25, 30 with the (n + 1) method, Q1 = 7.75 and Q3 = 22, so IQR = 14.25.
Why is the IQR better than the range?
The range depends only on the two most extreme values; the IQR ignores the outer quarters and is not distorted by outliers.
What does a large IQR mean?
The middle half of the data are widely spread. Compare it with the median: an IQR of 14.25 around a median of 13.5 indicates a lot of variability.
How is the IQR related to the standard deviation?
For normal data IQR ≈ 1.349σ, so σ ≈ IQR ÷ 1.349.
How do I find the IQR in Excel?
=QUARTILE.EXC(range,3) − QUARTILE.EXC(range,1) matches the default method here; QUARTILE.INC gives 11.25 for the example.
Can the IQR be zero?
Yes, if at least half of the values are identical in the middle of the data.
Sources
Guides on this topic
- Standard Deviation Explained: How to Calculate It and What It Means: Standard deviation is the typical distance from the mean. Learn to calculate it by hand, when to divide by n − 1, and how to read it with the 68–95–99.7 rule.