Statistics guide

How to Make a Box Plot: Quartiles, Whiskers and Outliers

Build a box plot by hand from a sorted dataset, find the five-number summary, and see how whiskers change when outliers are shown.

Labeled box plot showing minimum, first quartile, median, third quartile, maximum and an outlier dot

To make a box plot, sort the data, find its median and quartiles, then draw a box from Q1Q_1 to Q3Q_3 with a line at the median. Add whiskers according to the convention your class uses. A simple box plot extends whiskers to the minimum and maximum; a modified box plot ends whiskers at the most extreme non-outlier values and plots outliers separately.

That last choice changes the picture. Always check whether a worksheet, textbook, or software expects simple or modified whiskers. OpenStax describes the five-number summary used to build the box and read its spread.

The five-number summary

Use this sorted dataset of nine observations:

2, 4, 5, 6, 7, 8, 10, 11, 30.2,\ 4,\ 5,\ 6,\ 7,\ 8,\ 10,\ 11,\ 30.

The middle value, median, is 7. Using the common median-of-halves, exclude-the-middle method, the lower half is 2,4,5,62,4,5,6, so Q1=(4+5)/2=4.5Q_1=(4+5)/2=4.5. The upper half is 8,10,11,308,10,11,30, so Q3=(10+11)/2=10.5Q_3=(10+11)/2=10.5.

Statistic Value How it appears
Minimum 2 Left whisker in a simple box plot
First quartile Q1Q_1 4.5 Left edge of box
Median Q2Q_2 7 Line inside box
Third quartile Q3Q_3 10.5 Right edge of box
Maximum 30 Right whisker in a simple box plot

Different quartile conventions can give different Q1Q_1 and Q3Q_3 values for the same small dataset. State your convention and follow your course's method. Math Is Fun's box-plot example also flags this variation.

Example 1: draw a simple box plot

Mark 2, 4.5, 7, 10.5, and 30 on one number line. Draw a box from 4.5 to 10.5 and a line through it at 7. Extend the left whisker from 4.5 to 2 and the right whisker from 10.5 to 30. The box covers the middle half of the observations by quartile position; it does not mean half the values lie between 4.5 and 7 alone.

Example 2: draw a modified box plot with outliers

For the same dataset, the interquartile range is

IQR=Q3−Q1=10.5−4.5=6.IQR=Q_3-Q_1=10.5-4.5=6.

The usual 1.5×IQR1.5\times IQR fences are 4.5−9=−4.54.5-9=-4.5 and 10.5+9=19.510.5+9=19.5. Since 30 is above 19.5, it is an outlier by this rule. The largest observation inside the fences is 11, so the modified plot's right whisker ends at 11, and 30 appears as a separate dot. The left whisker still ends at 2. A fence is a cutoff for classifying observations, not a whisker endpoint.

Example 3: an even-sized dataset

Problem: Make the five-number summary for 3,5,6,8,9,12,14,173,5,6,8,9,12,14,17 using the same median-of-halves method.

The median is (8+9)/2=8.5(8+9)/2=8.5. The lower half 3,5,6,83,5,6,8 has median Q1=(5+6)/2=5.5Q_1=(5+6)/2=5.5. The upper half 9,12,14,179,12,14,17 has median Q3=(12+14)/2=13Q_3=(12+14)/2=13. Answer: (3,5.5,8.5,13,17)(3,5.5,8.5,13,17). Check that the values are ordered from minimum to maximum.

How to read the result

  • The box length is the IQR, a measure of the middle 50% spread. For the first dataset it is 6.
  • The median line marks the middle value. It need not be centered in the box.
  • A longer whisker or an outlier may suggest a longer tail, but a box plot does not show the full shape or every observation.
  • Compare box plots only when their axes use the same scale and the same whisker convention.

Our standard deviation guide explains a different measure of spread, and the mean, median and mode calculator can help check the center of a dataset. The mean is not one of the five required box-plot numbers.

Practice answers

A. Find the five-number summary for 1,2,3,4,5,6,71,2,3,4,5,6,7 with the median excluded from each half. Answer: (1,2,4,6,7)(1,2,4,6,7).

B. If Q1=12Q_1=12 and Q3=20Q_3=20, find the IQR and the upper outlier fence. Answer: IQR=8IQR=8; upper fence =20+1.5(8)=32=20+1.5(8)=32.

C. If 45 is above the upper fence and 31 is the next highest observation, where does the modified upper whisker end? Answer: At 31, assuming it lies within the fences; plot 45 separately.

For a graph supplied as an image, use the Statistics Problem Solver to check the five labeled positions. Confirm the quartile and whisker convention yourself before comparing its result with a class answer key.