Box Plots & Quartiles
Build a box plot from quartiles, flag outliers with the 1.5 × IQR rule and compare it with a histogram
Box plot on a shared axis(drag any dot to change that value)
Step 6 of 6: Outliers & whiskers
- 18
- 210
- 312
- 412
- 514
- 615
- 717
- 818
- 920
- 1024
- 1128
- 1255
Outliers (below −3 or above 37): 55
Whiskers reach the most extreme values inside the fences: 8 and 28
| Summary | Commute times (min) |
|---|---|
| n | 12 |
| Minimum | 8 |
| Q1 | 12 |
| Median (Q2) | 16 |
| Q3 | 22 |
| Maximum | 55 |
| IQR | 10 |
| Fences | −3 to 37 |
| Outliers | 55 |
From five numbers to a picture
A box plot (box-and-whisker plot) draws the five-number summary: minimum, first quartile Q1, median, third quartile Q3 and maximum. The box spans Q1 to Q3 with a line at the median, and the whiskers reach out to the most extreme values that are not outliers.
Method used here (median of halves): sort the data and find the median. Split the data into a lower half and an upper half. When n is odd, the median itself belongs to neither half. Q1 is the median of the lower half and Q3 is the median of the upper half. This is the method taught in most introductory courses and used by TI graphing calculators. Other methods exist: Tukey's hinges include the median in both halves when n is odd, and spreadsheet functions such as QUARTILE.INC interpolate between values, so software can give slightly different quartiles for the same small dataset.
Because quartiles only depend on the order of the values, the box is resistant to outliers in the same way the median is. That makes the IQR a better measure of spread than the range when the data contain a few extreme values.
The 1.5 × IQR rule is a convention, not a law. For data that really are normal, the fences sit about 2.7 standard deviations from the mean and flag only about 0.7% of values, so a flagged point is worth checking, not automatically deleting.
Quartiles split the data in four
The box is the middle half
Fences catch outliers
Built for comparison
Key formulas
Interquartile range
IQR = Q3 − Q1
Outlier fences (Tukey's rule)
LF = Q1 − 1.5 × IQR, UF = Q3 + 1.5 × IQR
- LF, UF
- lower and upper fence
- outlier
- any value with x < LF or x > UF
Whiskers
lower whisker = smallest value ≥ LF, upper whisker = largest value ≤ UF
Datasets in the visualizer
| Dataset | n | Min | Q1 | Median | Q3 | Max | IQR | Outliers |
|---|---|---|---|---|---|---|---|---|
| Exam scores | 15 | 52 | 64 | 72 | 81 | 95 | 17 | none |
| Commute times (min) | 12 | 8 | 12 | 16 | 22 | 55 | 10 | 55 |
| Outliers on both sides | 11 | 2 | 23 | 26 | 29 | 49 | 6 | 2, 49 |
| Plant heights: fertilizer | 11 | 18 | 21 | 24 | 26 | 29 | 5 | none |
| Plant heights: control | 11 | 12 | 15 | 17 | 21 | 31 | 6 | 31 |
Reading a box plot
- Center: compare the median lines. In the plant data the fertilizer median (24 cm) is above the whole control box (Q3 = 21 cm), which is a large difference.
- Spread: a wider box means a larger IQR. Long whiskers mean the outer quarters are spread out, not that they contain more values.
- Skew: if the median sits near the left of the box and the right whisker is long, the data are right-skewed, like the commute times.
- What it hides: a box plot cannot show gaps or two separate clusters. That is why the visualizer draws a dot plot or histogram of the same data underneath.
How to use this visualizer
- 1Pick a dataset, or type your own numbers into the data box and press Apply.
- 2Use Back and Next (or the numbered step chips) to build the box plot one stage at a time. The sorted list shows the halves and the values each quartile comes from.
- 3Drag any dot sideways to change that value. The quartiles, fences and outlier flags update as you drag.
- 4Drag a value just past a fence and watch it turn red and leave the whisker.
- 5Switch Below each box to Histogram to see the same data as bars.
- 6Choose Compare two to stack a second group on the same axis, then compare the medians, boxes and whiskers.
Common mix-up
Each of the four sections of a box plot (lower whisker, left part of the box, right part of the box, upper whisker) holds about a quarter of the data. A longer section does not contain more values; it means those values are more spread out.Practice problems
Problem 1: Odd number of values
Show solutionHide solution
n = 9 (odd), already sorted. Median = 5th value = 9
Lower half (median left out): 3, 5, 7, 8 → Q1 = (5 + 7) / 2 = 6
Upper half: 11, 13, 15, 40 → Q3 = (13 + 15) / 2 = 14
IQR = 14 − 6 = 8; 1.5 × IQR = 12
LF = 6 − 12 = −6; UF = 14 + 12 = 26
40 > 26, so 40 is an outlier. Whiskers run from 3 to 15.
Min 3, Q1 6, median 9, Q3 14, max 40; IQR 8; outlier: 40
Problem 2: Even number of values
Show solutionHide solution
n = 10 (even). Median = (5th + 6th) / 2 = (21 + 23) / 2 = 22
Lower half: 12, 15, 18, 20, 21 → Q1 = 18
Upper half: 23, 25, 26, 30, 45 → Q3 = 26
IQR = 26 − 18 = 8; 1.5 × IQR = 12
LF = 18 − 12 = 6; UF = 26 + 12 = 38
45 > 38 is an outlier; 12 ≥ 6 is not
Q1 18, median 22, Q3 26; fences 6 and 38; whiskers 12 to 30; only 45 is an outlier
Related visualizations
Discussion
Questions, ideas or a different approach? Join the conversation.