Box Plot IQR: How to Read Interquartile Range in Boxplots

By Dr. Zubair Khalid, DVM, MS, PhD ·

Box Plot IQR: How to Read Interquartile Range in Boxplots

The box plot interquartile range is the width of the box itself. It spans from the lower quartile (Q1) to the upper quartile (Q3), so it covers the middle 50% of your data. A wider box means the middle half of the values is more spread out, and a narrower box means they are packed tightly together.

Quick Answer

  • The IQR equals $Q3 - Q1$, the difference between the 75th and 25th percentiles [1].
  • On a box plot, the box is drawn from Q1 to Q3, so the box width is the IQR [2].
  • The IQR describes the spread of the middle 50% of the data, not the full range [2].
  • Whiskers extend from the box toward the most extreme points that fall inside the fences $Q1 - 1.5 \times IQR$ and $Q3 + 1.5 \times IQR$ [3].
  • Points beyond those fences are plotted individually as outliers [2].

What the Box Plot Interquartile Range Means

In plain terms, the box plot interquartile range is the horizontal or vertical distance across the box. If you cover the whiskers and the outlier dots with your hand, what remains is the IQR. It answers one question: how far apart are the middle half of the observations?

The precise statistical definition is the difference between the 75th and 25th percentiles of the data [1]. The 25th percentile is Q1, the value below which roughly a quarter of the data falls. The 75th percentile is Q3, the value below which roughly three quarters fall. Everything between them is the middle 50%.

This makes the IQR a measure of dispersion, similar in purpose to the standard deviation or variance, but much less sensitive to extreme values [1]. A single very large reading barely moves Q1 or Q3, so it barely moves the IQR. That property is why box plots are described as non-parametric: they show variation in a sample without assuming the data follow a particular distribution [4].

How It Works

The IQR is a subtraction. The interesting part is how the box plot uses it.

$$IQR = Q3 - Q1$$

  • $Q1$ is the lower quartile, the 25th percentile.
  • $Q3$ is the upper quartile, the 75th percentile.
  • $IQR$ is the width of the box.

Once you have the IQR, the plot builds the fences that decide where whiskers stop:

$$L1 = Q1 - 1.5 \times IQR$$

$$U1 = Q3 + 1.5 \times IQR$$

  • $L1$ is the lower fence. The lower whisker ends at the smallest data point greater than or equal to $L1$ [5].
  • $U1$ is the upper fence. The upper whisker ends at the largest data point less than or equal to $U1$ [5].
  • Any point below $L1$ or above $U1$ is drawn as an individual marker instead of being absorbed into a whisker [5].

The 1.5 multiplier is a convention, not a law of nature. It is the rule used by Tukey's box plot and by most statistical software, including the CDC's data visualization tool [3]. Some implementations add a second, more extreme fence at 3 times the IQR to separate mild outliers from far outliers [5].

Two other details matter for reading a plot correctly. First, the median line inside the box is Q2, not the mean. Second, the box plot does not show the mean unless the software adds a marker for it [6]. If the median line sits closer to Q1 than to Q3, the middle of the data is right skewed: values bunch just above Q1 and spread out toward Q3.

Worked Example

The dataset is 40 lab reaction times in milliseconds from a single participant group.

#ms#ms#ms#ms
1212111992119231270
2198122762226232225
3245132412323633239
4231142182422134209
5189152052520735256
6267162592625136232
7254172332722937219
8223182272821538244
9210192142924339213
10238202483020140228

Step 1. Sort and note the extremes. The sorted values run from a minimum of 189 to a maximum of 276, with n = 40.

Step 2. Find Q1. Using the linear interpolation method of Excel's QUARTILE.INC and the pandas default, the Q1 position is $1 + (40-1) \times 0.25 = 10.75$, which lies three quarters of the way from the 10th value (212) to the 11th value (213), so Q1 = 212.7500.

Step 3. Find the median. The Q2 position is $1 + (40-1) \times 0.50 = 20.50$, which gives Q2 = 228.5000.

Step 4. Find Q3. The Q3 position is $1 + (40-1) \times 0.75 = 30.25$, which lies a quarter of the way from the 30th value (244) to the 31st value (245), so Q3 = 244.2500.

Step 5. Compute the IQR. $244.2500 - 212.7500 = 31.5000$. The box is 31.5 ms wide.

Step 6. Compute the fences. The lower fence is $212.7500 - 1.5 \times 31.5000 = 165.5000$. The upper fence is $244.2500 + 1.5 \times 31.5000 = 291.5000$.

Step 7. Place the whiskers. The smallest value inside the lower fence is 189.0000, and the largest value inside the upper fence is 276.0000. No value falls outside either fence, so there are no outliers.

Here is the same calculation in Python.

import pandas as pd
s = pd.Series([212, 198, 245, 231, 189, 267, 254, 223, 210, 238,
               199, 276, 241, 218, 205, 259, 233, 227, 214, 248,
               192, 262, 236, 221, 207, 251, 229, 215, 243, 201,
               270, 225, 239, 209, 256, 232, 219, 244, 213, 228])
q1, q3 = s.quantile(0.25), s.quantile(0.75)
iqr = q3 - q1  # 31.5000
s.plot.box()

Output:

Q1=212.7500, Q2=228.5000, Q3=244.2500, IQR=31.5000, whiskers=[189.0000, 276.0000], outliers=[]

You can reproduce this shape with the Box Plot Maker if you want to see how the box and whiskers move as you change the data.

How to Interpret It

Read the box first. Its width is the IQR, so it tells you how variable the middle half of the data is. In the example above, the middle 50% of reaction times spans 31.5 ms. If a second group had a box twice as wide, that group's middle half would be twice as variable, even if the two medians were identical.

Then compare the box to the whiskers. When the whiskers are short relative to the box, most of the spread lives in the middle of the data. When the whiskers are long, the tails carry a lot of the variation. In the reaction-time example, the lower whisker runs 23.75 ms below Q1 and the upper whisker runs 31.75 ms above Q3, so the upper tail is slightly longer.

Then look at where the median sits inside the box. A median near the center suggests a fairly symmetric middle. A median pushed toward Q1 suggests the middle of the distribution is right skewed, and a median pushed toward Q3 suggests it is left skewed. The spacing of the four sections of the plot, from whisker to Q1, Q1 to median, median to Q3, and Q3 to whisker, is what reveals dispersion and skewness [4].

Finally, check for dots beyond the whiskers. Those are values that sit more than 1.5 IQRs from the box [2]. They are worth investigating, but they are not automatically errors. For more on that decision, see Box Plot Outliers: How to Identify and Interpret Them.

When to Use It (and when not to)

Use a box plot when you have a continuous variable and you want a compact summary of center, spread, and outliers at the same time [6]. It is especially effective when you place several boxes side by side to compare groups, because your eye can compare box widths directly. For that workflow, see Side-by-Side Boxplots: How to Read and Create Them.

Use it when the data may be skewed or contain extreme values, since the IQR and median resist distortion in a way the mean and standard deviation do not [1].

Do not use a box plot for categorical or nominal data. A bar chart is the right choice there [6]. Be cautious with very small samples, because quartiles estimated from a handful of points are unstable and the box can look more informative than it is [6]. A box plot also hides the shape of the distribution within each section. Two datasets can produce identical boxes while having very different internal structure, so pair the plot with a histogram or a strip of individual points when the shape matters.

Box Plot IQR vs Standard Deviation

Both measure spread, but they answer different questions and react differently to extremes.

FeatureIQRStandard deviation
What it measuresSpread of the middle 50%Spread of all values around the mean
Sensitive to outliersNo, quartiles barely move [1]Yes, squared deviations amplify them
Shown on a box plotYes, as the box width [2]No, unless added separately
Assumes a distributionNo [4]Yes, for many inferential uses
Typical useSkewed data, outlier screeningRoughly symmetric data, variance-based methods

If your data are roughly symmetric and you need a variance-based statistic, the standard deviation is the natural choice. If your data are skewed or you want a summary that a few extreme readings cannot distort, the IQR is safer. To practice computing it by hand, see Range and Interquartile Range: How to Find IQR.

Common Mistakes

  • Reading the box as the full range. The box covers only the middle 50%. The whiskers and any outlier dots carry the rest of the spread. Fix: read the box, the whiskers, and the dots as three separate pieces of information.
  • Assuming the line inside the box is the mean. It is the median, Q2 [3]. Fix: check the software's legend before you describe the center, and add a mean marker only if you actually need it.
  • Treating every outlier dot as bad data. A point beyond the fence is unusual, not automatically wrong [2]. Fix: investigate the record before you remove anything, and document your reason if you do.
  • Comparing box widths across plots with different scales. A box that looks wider may simply be on an axis with larger units. Fix: put the groups on one shared axis before comparing.
  • Mixing quartile methods across tools. Different software uses slightly different interpolation rules, so Q1 and Q3 can differ a little. Fix: use one tool consistently within a project and state which method you used.
  • Using a box plot for a tiny sample. With a few observations, the quartiles are fragile and the box overstates precision [6]. Fix: show the individual points alongside the box.

Limitations

The box plot compresses a lot into five numbers, and that compression loses information. You cannot see whether the data are bimodal, whether there is a gap inside the box, or how the points are distributed within each quarter. Two very different datasets can share the same five-number summary, so a box plot alone is a weak basis for judging shape.

The 1.5 IQR rule is also a convention rather than a test. It flags points that are far from the box under one specific definition, and the number of flagged points depends on the multiplier and on the quartile method your software uses. On small samples the fences can behave oddly, sometimes hiding real extremes or flagging ordinary values. Treat the IQR as a descriptive summary, not as proof that a value is erroneous.

Frequently Asked Questions

What is the interquartile range in a box plot?

It is the width of the box, running from Q1 to Q3. Numerically it equals $Q3 - Q1$, the difference between the 75th and 25th percentiles [1]. It represents the spread of the middle 50% of the observations [2].

How do you find the IQR from a box plot?

Subtract the value at the bottom edge of the box from the value at the top edge. If the plot is horizontal, subtract the left edge from the right edge. You need the axis labels or the underlying numbers, since the box alone does not tell you the quartile values.

What does a large IQR mean?

A large IQR means the middle half of your data is widely spread out. It does not tell you anything about the tails, which the whiskers cover. Compare it against the whisker lengths and against other groups to judge whether the spread is large in context.

Why are whiskers 1.5 times the IQR?

The 1.5 multiplier is the standard convention for Tukey-style box plots, and it defines the fences at $Q1 - 1.5 \times IQR$ and $Q3 + 1.5 \times IQR$ [3]. Points outside those fences are drawn individually as outliers [2]. The value is a practical rule of thumb, not a probability statement.

Can the IQR be zero?

Yes. If at least half of your values are identical, Q1 and Q3 can land on the same number and the IQR becomes zero. The box then collapses to a line. This usually signals a discrete or heavily tied variable, and a box plot may not be the best way to show it.

References

  1. iqr, SciPy v1.18.0 Manual
  2. Quartiles and Box Plots - Data Science Discovery
  3. Box-and-Whiskers Plot | COVE | CDC
  4. Box plot - Wikipedia
  5. 1.3.3.7. Box Plot
  6. Box Plot

Related Articles