Quartiles and the interquartile range:
splitting data and spotting outliers
Quartiles describe where the middle half of your data lives, and the IQR gives a spread that a single extreme value cannot distort.
Calcylator Editorial Team
Updated · 5 min read
What the three quartiles actually split
Sort a data set from smallest to largest and cut it into four equal-sized parts. The three cut points are the quartiles. The middle cut is the median, Q2. Q1, the lower quartile, has a quarter of the values below it. Q3, the upper quartile, has a quarter above it.
The stretch from Q1 to Q3 holds the central half of the data. That distance is the interquartile range, IQR = Q3 − Q1. Because it ignores the lowest and highest quarters, one wild value hardly moves it, which makes it a sturdier measure of spread than the range or the standard deviation.
These numbers underpin the box-and-whisker plot: the box runs from Q1 to Q3, a line marks the median, and whiskers extend to the most extreme values that are not flagged as outliers.
Finding Q1 and Q3 step by step
- Sort the values in ascending order.
- Find the median. If n is odd, it is the middle value; if even, the average of the two middle values.
- Split the data into a lower half and an upper half. For odd n, the median is either left out of both halves or included, depending on the method.
- Q1 is the median of the lower half; Q3 is the median of the upper half.
- Subtract: IQR = Q3 − Q1.
- Q1:
- 25th percentile (lower quartile)
- Q3:
- 75th percentile (upper quartile)
With an even count the halves are clean. With an odd count textbooks differ about the middle value, which is why different tools can return slightly different quartiles for the same list.
A worked example with twelve values
Here are the ages in months at which twelve toddlers in a play group took their first steps, already sorted: 7, 9, 12, 13, 15, 16, 18, 21, 24, 26, 29, 58. With 12 values the lower half is the first six and the upper half is the last six.
Lower half
7, 9, 12, 13, 15, 16
Q1 (median of lower half)
(12 + 13) ÷ 2 = 12.5
Upper half
18, 21, 24, 26, 29, 58
Q3 (median of upper half)
(24 + 26) ÷ 2 = 25
Median
(16 + 18) ÷ 2 = 17
IQR
25 − 12.5 = 12.5
The middle half of the group spans 12.5 months.
Note how the 58 sits far out on its own. The median and quartiles barely notice it; the mean of this list, about 20.7, is pulled upward by it. That asymmetry is exactly what the next step is designed to formalise.
An odd count: what happens to the middle value
With nine values the median is a data point itself, which forces a choice. Take 3, 5, 6, 8, 9, 11, 12, 15 and 40.
| Rule for the middle value | Lower half | Q1 | Upper half | Q3 | IQR |
|---|---|---|---|---|---|
| Exclude the median | 3, 5, 6, 8 | 5.5 | 11, 12, 15, 40 | 13.5 | 8 |
| Include the median in both halves | 3, 5, 6, 8, 9 | 6 | 9, 11, 12, 15, 40 | 12 | 6 |
Q1 and Q3 (excluding the median)
5.5 and 13.5
IQR
13.5 − 5.5 = 8
Fences
5.5 − 12 = −6.5 and 13.5 + 12 = 25.5
Flagged value
40 (above 25.5)
With the other rule, the upper fence is 12 + 9 = 21; 40 is flagged either way.
Neither rule is wrong. What matters is to say which one you used, and to compare data sets only when they were treated the same way.
The 1.5 × IQR rule for flagging outliers
A widely used convention, attributed to the statistician John Tukey, builds two fences outside the box. A value below the lower fence or above the upper fence is marked as a potential outlier.
- 1.5:
- the conventional multiplier; 3 is sometimes used for 'extreme' outliers
IQR
12.5
1.5 × IQR
18.75
Lower fence
12.5 − 18.75 = −6.25
Upper fence
25 + 18.75 = 43.75
Flagged values
58 (above 43.75)
No value falls below −6.25, so only the upper side has an outlier.
'Potential' is the word to hold on to. The rule is a screening device, not a verdict. A flagged value might be a typing error, a measurement fault, or a perfectly genuine rare observation; it is worth checking the source before deleting it.
Why two tools can give different quartiles
There is no single agreed way to place quartiles when the cut falls between two data points. Common methods give slightly different answers, and all are legitimate if stated.
| Method | Q1 | Q3 | IQR |
|---|---|---|---|
| Median of halves (above) | 12.5 | 25 | 12.5 |
| Inclusive interpolation (Excel QUARTILE.INC style) | 12.75 | 24.5 | 11.75 |
| Exclusive interpolation ((n + 1) positions) | 12.25 | 25.5 | 13.25 |
All three agree that 58 is an outlier, which is the usual outcome: methods differ in the second decimal, not in the story. Pick one method, note it, and stay with it when comparing data sets.
Reading a box plot with these numbers
A box plot draws the five-number summary: minimum, Q1, median, Q3 and maximum. The box spans Q1 to Q3, the line inside marks the median, and the whiskers reach the smallest and largest values that are inside the fences. Points beyond the fences are drawn separately as dots.
Two features are worth a glance. First, the position of the median inside the box: if it sits near one end, the data is skewed that way. Second, whisker lengths: a long upper whisker and a short lower one signal a tail of high values.
| Measure | Splits data at | Common use |
|---|---|---|
| Quartiles | 25%, 50%, 75% | Box plots, IQR, quick spread |
| Deciles | 10%, 20% … 90% | Income bands, exam grading |
| Percentiles | 1% … 99% | Growth charts, test scores, service-level targets |
Q1 is the 25th percentile and Q3 the 75th, so a score at the 75th percentile is at Q3: three-quarters of the group scored the same or lower.
When to prefer the IQR to the standard deviation
- The data is skewed, such as incomes, house prices or response times, where a few huge values inflate the standard deviation.
- There are outliers you cannot remove or have not yet investigated.
- You are summarising with a median; the IQR pairs naturally with it, as the standard deviation pairs with the mean.
- The distribution is ordinal or the exact values are uncertain, but the ranking is reliable.
For roughly symmetric, well-behaved data the standard deviation carries more information. When in doubt, report both and look at the gap: a standard deviation far larger than the IQR ÷ 1.35 hints at a heavy tail.
Common questions
What is the interquartile range?
The interquartile range, IQR, is Q3 minus Q1: the width of the middle half of a sorted data set. In the list 7, 9, 12, 13, 15, 16, 18, 21, 24, 26, 29, 58 it is 25 − 12.5 = 12.5.
How do I find Q1 and Q3?
Sort the data, find the median, then take the median of the lower half for Q1 and the median of the upper half for Q3. For an even number of values, the halves are simply the first and second half.
What is the 1.5 × IQR rule?
It marks a value as a possible outlier if it is below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR. With Q1 = 12.5, Q3 = 25 and IQR = 12.5 the fences are −6.25 and 43.75.
Why does my spreadsheet give a different Q1 from my textbook?
Spreadsheets and textbooks use different rules for cuts that fall between data points, such as inclusive and exclusive interpolation. The values usually differ slightly, not wildly. State which method you use and stay consistent.
Is an outlier always a mistake?
No. An outlier is only a value far from the rest. It can be a data-entry error, but it can also be a real, rare event. Check its source before removing it, since removal changes your conclusions.
Was this guide helpful?
Continue reading
View all blogsVariance and Standard Deviation: n vs n−1
Population variance divides by n, sample variance by n − 1. See both on the same six numbers: 2.92 versus 3.5, and SD 1.71 versus 1.87.
6 min read
Coefficient of Variation: Compare Spread Fairly
The coefficient of variation is SD ÷ mean. A 50 g SD on 5 kg bags (1%) is steadier than a 4 g SD on 200 g packs (2%), despite the larger SD.
6 min read
Odds to Probability: Convert 3:1, 2.5 and More
Odds of 3 to 1 against are a 25% chance, 3 to 2 in favour is 60%, and decimal 2.50 is 40%. Convert any odds format with one short rule.
5 min read




