TapCub is live — analytics, insights and live chat, free on one platform
Glossary

Box plot: how to read it with quartiles and outlier fences

A box plot draws the median, quartiles, whiskers and outliers of a data set. Compute one by hand on session durations, compare two pages, and see when a histogram tells you more.

Su He Reviewed by Ethan Brooks Also called box and whisker plot Last updated Dec 3, 2026 Glossary

Quick answer

A box plot is a chart that summarizes numeric data with a box from the first to the third quartile, a line at the median, whiskers reaching toward the extremes and separate dots for values beyond the outlier fences. It makes center, spread and skew comparable across groups.

Formula: IQR = Q3 − Q1; fences = Q1 − 1.5 × IQR and Q3 + 1.5 × IQR; whiskers end at the furthest data inside the fences

What is a box plot?

A box plot, also called a box-and-whisker plot, is a chart that summarizes a set of numbers with a box running from the first quartile to the third quartile, a line at the median, and two whiskers that reach toward the smallest and largest values. Points that fall far outside the box are usually drawn one by one, so unusual values stay visible instead of disappearing into an average.

The chart is associated with the statistician John Tukey and his work on exploratory data analysis. Its strength is compactness. One box takes a narrow strip of space, so you can line up ten pages, countries or weeks next to each other and see at a glance which group sits higher, which is more spread out and which has a long tail. A table of averages cannot do that, because an average says nothing about spread.

The price of that compactness is detail. A box plot is drawn from a handful of summary numbers, so it cannot tell you whether the values inside the box are spread evenly or bunched into two clusters. The later sections show both sides: how to read and build the chart, and when a histogram says more.

How to read a box plot: the five-number summary

Most box plots are built on the five-number summary: minimum, first quartile, median, third quartile and maximum. Each one maps to a part of the drawing.

Part of the chartNumber it showsHow to read it
Lower end of the boxQ1, the 25th percentileA quarter of the values are at or below it
Line inside the boxMedian, the 50th percentileHalf the values are below, half above
Upper end of the boxQ3, the 75th percentileThree quarters of the values are at or below it
Length of the boxInterquartile range, Q3 − Q1Spread of the middle half
WhiskersSmallest and largest values inside the fencesReach of the ordinary data
Separate pointsValues beyond the fencesCandidates for a closer look

Three reading habits cover most cases. First, compare the median lines to see which group is typically higher. Second, compare the box lengths to see which group is more consistent. Third, look at the position of the median inside the box and the relative length of the whiskers: a median near the bottom of the box with a long upper whisker points to a right skew, which is normal for durations, order values and load times.

Not every tool draws whiskers the same way. The NIST handbook describes a basic version whose lines run to the minimum and maximum, and a version with fences in which extreme points are plotted separately. Some software lets you set whiskers at chosen percentiles instead. Before you compare two charts from two tools, check the whisker rule printed in the legend or the documentation.

Worked example: quartiles and fences on session duration

Fifteen sessions on a documentation page lasted, in seconds and already sorted (sample data):

8, 14, 21, 27, 33, 38, 42, 47, 55, 63, 72, 88, 104, 150, 420

Step 1: quartiles. This example uses linear interpolation, the default of NumPy's percentile function. With 15 values, the position of a quantile p is 1 + 14 × p.

  • Q1: position 1 + 14 × 0.25 = 4.5, halfway between the 4th value (27) and the 5th (33), so Q1 = 30.
  • Median: position 8, so median = 47.
  • Q3: position 11.5, halfway between the 11th value (72) and the 12th (88), so Q3 = 80.

Step 2: interquartile range. IQR = 80 − 30 = 50 seconds.

Step 3: fences. The usual rule places fences 1.5 box lengths beyond the box:

  • Lower fence = 30 − 1.5 × 50 = −45
  • Upper fence = 80 + 1.5 × 50 = 155

Step 4: whiskers and flagged points. Whiskers stop at the most extreme observed values that are still inside the fences. The lower whisker ends at 8 and the upper whisker at 150, not at 155, because 155 is only a boundary and no session lasted that long. The 420-second session is beyond the upper fence and is drawn as a separate point.

The mean of the fifteen sessions is 1,182 ÷ 15 = 78.8 seconds, almost as high as Q3. About three out of four sessions were shorter than the "average" session. The box plot makes this obvious, while a single average hides it.

Outlier fences: 1.5 × IQR and 3 × IQR

NIST names two levels of fences. The inner fences sit at Q1 − 1.5 × IQR and Q3 + 1.5 × IQR; a point beyond one of them is called a mild outlier. The outer fences sit at Q1 − 3 × IQR and Q3 + 3 × IQR; a point beyond those is an extreme outlier. In the example, the upper outer fence is 80 + 3 × 50 = 230, so the 420-second session counts as extreme.

"Flagged" does not mean "wrong". It means the value is far from the middle half relative to how wide that half is. A 420-second session might be a tab left open, or it might be the one reader who worked through the whole page. Check the raw record before deleting anything. The options after that (keep, fix, cap or exclude with a note) are covered in outliers in data.

The fences also depend on the data you give them. Drop the 420-second session and recompute: Q1 = 28.5, median = 44.5, Q3 = 69.75, IQR = 41.25, and the upper fence falls to about 131.6. Now the 150-second session is flagged, although it was an ordinary whisker end a moment ago. Removing outliers and redrawing can produce new ones, so do not repeat the cut until the chart looks tidy.

Quartile definitions differ between tools. Hyndman and Fan compared the sample quantile definitions used by statistical packages. If you take Q1 and Q3 at positions 16 × 0.25 and 16 × 0.75 instead (the exclusive method), this data gives Q1 = 27, Q3 = 88, IQR = 61 and an upper fence of 179.5. The 420-second session is still flagged here, but with a value around 170 the two methods would disagree. State the method when you publish fences.

Comparing two groups side by side

Box plots earn their place when there is more than one group. Suppose a new page layout, B, collects fifteen sessions (sample data): 25, 31, 36, 40, 44, 49, 53, 58, 62, 66, 71, 77, 84, 93, 112.

Statistic (seconds)Page APage B
Minimum825
Q13042
Median4758
Q38074
Maximum420112
IQR5032
Upper fence155122
Points beyond the fences420none
Mean78.860.1

The two boxes tell a clear story: B has a higher median (58 against 47), a higher Q1 (42 against 30) and a narrower box. Short visits became less short and sessions became more alike. The mean says the opposite, 60.1 against 78.8, and the whole reversal comes from one 420-second session in A.

That does not prove B is better. Fifteen sessions per page is a very small sample, the boxes overlap heavily, and a box plot is a description, not a significance test. Use it to decide what to examine, then collect enough data and choose a test that fits the metric. For why the two averages disagree, see mean vs median.

Box plot vs histogram vs interquartile range

The interquartile range is one number, the length of the box. A percentile is one position in the sorted list. A box plot draws several of these together. A histogram does something different: it cuts the value range into bins and shows how many observations fall into each.

QuestionBox plotHistogram
Compare many groups at onceStrong: one narrow box per groupWeak beyond two or three groups
See clusters or two peaksNot visibleVisible with sensible bins
Read median and quartilesDirectHas to be estimated
Spot single extreme valuesDrawn as pointsMay sit in a barely visible bar
Depends on a bin choiceNoYes

Here is a case where the box plot is blind. Two sets of 13 load durations in seconds (sample data):

  • Set E: 10, 17, 23, 30, 37, 43, 50, 57, 63, 70, 77, 83, 90
  • Set C: 10, 29, 29, 30, 31, 31, 50, 69, 69, 70, 71, 71, 90

Both have minimum 10, Q1 30, median 50, Q3 70 and maximum 90, so their box plots are identical. Counting them into bins separates them at once:

Bin (seconds)Set ESet C
0 to under 2021
20 to under 4035
40 to under 6031
60 to under 8035
80 to 10021

Set E is spread evenly. Set C has two groups, around 30 and around 70 seconds, with almost nothing in between, which often means two different kinds of visitor or two different code paths. Rule of thumb: use box plots to compare groups, and open a histogram for any group whose behavior you are about to explain.

Common mistakes when reading box plots

  • Treating box length as sample size. A long box means wide spread, not more data. Print n under each box.
  • Reading the line as the mean. The line is the median. If a tool also marks the mean, it uses a separate symbol.
  • Drawing boxes for tiny groups. With five values, the chart pretends to a precision the data cannot support. Plot the individual points instead.
  • Calling every dot an error. In skewed data, a number of points beyond the upper fence is expected.
  • Comparing charts with different whisker rules. Min-to-max whiskers and 1.5 × IQR whiskers look similar and mean different things.
  • Using a box plot for yes/no data. Converted or not has only two values; report the rate and its uncertainty.

Box plots and TapCub

TapCub does not draw box plots. What it can give you for the example above are the distribution view, a quartile summary for time gaps and the raw rows.

  1. Look at the shape. In All-platform analytics › Behavior › Distribution, choose session duration as the subject. You get total, mean and median cards, a histogram on fixed duration buckets, and the count and share in each bucket. A mean far above the median is the same signal as Page A.
  2. Get quartiles for a time gap. In All-platform analytics › Behavior › Interval, pick a start and an end event. The summary lists sample size, minimum, 25th, median, 75th, 90th, maximum and average, which is enough to sketch a box for "time from sign-up to first purchase" and compute the fences by hand. Pairs longer than the maximum gap are left out, so the maximum is bounded by your setting.
  3. Take the rows out when you need a real chart. List session durations in All-platform analytics › Behavior › SQL query (the v_sessions view) and download the result as CSV, or create a sessions job in All-platform analytics › Data › Data export on a plan that includes export. Draw the boxes in a spreadsheet or notebook.
  4. Check the zeros first. A session with no signal after its first event counts as 0 seconds. If more than a quarter of sessions are like that, Q1 is 0 and the box starts at the axis, so show the zero share next to the chart.

Sources

Was this explanation clear?

We use your answers to fix and expand this page.

Su He

Data Analyst

Explores traffic sources, conversion funnels, and retention, using clear metric definitions and concrete examples to explain what the numbers mean.

FAQ

Questions people ask

Short answers to the follow-up questions that come up most.

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

How do you read a box plot?

The line inside the box is the median, the box edges are the first and third quartiles, and the box covers the middle half of the data. Whiskers reach the furthest values inside the fences, and separate dots are values beyond them. Compare median lines for level and box lengths for spread.

What are the five numbers in a box plot?

Minimum, first quartile, median, third quartile and maximum. When the chart uses 1.5 × IQR fences, the whiskers may stop short of the minimum or maximum, and the true extremes appear as individual points. In the sample here the five numbers are 8, 30, 47, 80 and 420 seconds.

How are outliers found on a box plot?

Compute the interquartile range, then place fences 1.5 times that distance below Q1 and above Q3. Values outside are plotted individually. With Q1 = 30 and Q3 = 80, the upper fence is 155, so a 420-second session is flagged while a 150-second one is not.

When is a histogram better than a box plot?

When shape matters. A box plot cannot show two peaks or gaps, because very different data sets can share the same five numbers. Use box plots to compare many groups, then draw a histogram for the group you want to explain, and try more than one bin width.

See this number on your own site

Add one script tag for web and apps, and the first reports fill in within minutes.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics