How to Make a Box and Whisker Plot (Step by Step)
By Dr. Zubair Khalid, DVM, MS, PhD ·

Box and whisker plots summarize a dataset with five numbers: the minimum, the first quartile, the median, the third quartile, and the maximum. You draw a scaled number line, put a box around the middle 50% of the data, and extend whiskers toward the extremes. This guide walks through the full construction, the outlier rule, and how to read what you built.
Quick Answer
- Sort the data from smallest to largest before anything else.
- Find the five-number summary: minimum, Q1, median, Q3, maximum [1].
- Draw a scaled number line, then a box from Q1 to Q3 with a line at the median [2].
- Extend whiskers from the box to the smallest and largest values that are not outliers [3].
- Plot any value below $Q1 - 1.5 \times IQR$ or above $Q3 + 1.5 \times IQR$ as an individual point [3].
Before You Start
You need one column of numeric values and a way to sort them. That is the whole requirement. Box and whisker plots work for any quantitative variable: test scores, delivery times, salaries, reaction times.
Two things to settle before you draw.
First, decide whether you are making a single box or several. A single box plot describes one batch of data. Multiple box plots drawn on the same scale let you compare groups, and that comparison is where box and whisker plots earn their keep [3]. If you plan to compare groups, read Side-by-Side Boxplots: How to Read and Create Them first, because the layout decisions differ.
Second, decide whether you will show outliers. The basic five-number summary version extends whiskers to the minimum and maximum [2]. The outlier version stops the whiskers at the most extreme values that fall inside the fences and marks everything beyond them separately [3]. Most modern software defaults to the outlier version. Pick one and stay consistent across every plot in a report.
You do not need the mean or standard deviation. A box plot is built entirely from positions in the sorted data, so it does not care whether the distribution is symmetric.
Step by Step
1. Sort the values. Order every observation from smallest to largest. Every later step depends on position, so an unsorted list will produce wrong quartiles.
2. Count the observations. Call this $n$. You need it to locate the median and the quartiles.
3. Find the median. The median splits the sorted data in half.
- If $n$ is odd, the median is the middle value.
- If $n$ is even, the median is the average of the two middle values.
4. Find the quartiles. Q1 is the median of the lower half of the data. Q3 is the median of the upper half. When $n$ is odd, exclude the median itself from both halves before splitting. Different textbooks and software packages use slightly different quartile conventions, so the exact Q1 and Q3 can shift by one position. State which convention you used if the numbers matter.
5. Compute the interquartile range. The IQR is the spread of the middle half of the data:
$$IQR = Q3 - Q1$$
6. Build the outlier fences. These are the cutoffs for flagging extreme values:
$$Lower\ fence = Q1 - 1.5 \times IQR$$ $$Upper\ fence = Q3 + 1.5 \times IQR$$
Values outside the fences are outliers.
7. Draw the number line. Draw a horizontal or vertical axis with a scale that covers your full range, then label it. A box plot without a scaled number line is not useful [1].
8. Draw the box. The left edge (or bottom edge) sits at Q1. The right edge sits at Q3. Draw a line through the box at the median [2]. The box now covers the middle 50% of the data.
9. Draw the whiskers. Extend a line from Q1 to the smallest value that is not an outlier, and from Q3 to the largest value that is not an outlier [3]. If you are using the simple five-number summary version, extend to the minimum and maximum instead [2].
10. Plot the outliers. Mark each value beyond a fence with a distinct symbol, usually a small circle or dot [3].
11. Title and label. Give the plot a title and label the axis with the variable name and units [2].
Worked Example
Suppose a small class of nine students takes a quiz scored out of 10, and the scores are 2, 3, 5, 5, 6, 7, 8, 9, 10.
The data is already sorted and $n = 9$. The median is the fifth value, which is 6. The lower half is 2, 3, 5, 5, so Q1 is the average of 3 and 5, which is 4. The upper half is 7, 8, 9, 10, so Q3 is the average of 8 and 9, which is 8.5.
The IQR is $8.5 - 4 = 4.5$. The lower fence is $4 - 1.5 \times 4.5 = -2.75$, and the upper fence is $8.5 + 1.5 \times 4.5 = 15.25$. Every score sits inside those fences, so there are no outliers.
The five-number summary is 2, 4, 6, 8.5, 10. On the plot, the box runs from 4 to 8.5 with a line at 6, and the whiskers reach 2 on the left and 10 on the right. The left whisker is longer than the right one, which tells you the lower tail stretches further. The median sits slightly closer to Q1 than to Q3, though, so the two signals point in opposite directions and the plot shows no clear skew.
Other Ways to Do It
By hand, the steps above are all you need. For anything larger than a few dozen values, use software.
Spreadsheets handle the arithmetic and the drawing in one pass. The article How to Make a Box Plot in Excel (Step by Step) covers the chart type and the quartile functions.
Statistical software and programming libraries give you more control. In Python, matplotlib.pyplot.boxplot draws the box, whiskers, caps, and fliers, and exposes options such as showfliers to hide or show outlier points and showmeans to add the mean [4]. The default behavior is to draw fliers, so outliers appear unless you turn them off [4].
Graphing calculators can produce the five-number summary and the plot directly from a list of values [1].
If you want to skip the setup entirely, the Box Plot Maker takes a pasted column of numbers and returns the plot.
Troubleshooting
The box looks flat. Your data may be tightly clustered with a few extreme values, or your axis scale may be too wide. Check the IQR against the full range.
The median line sits on a box edge. This happens when Q1 or Q3 equals the median, which is common in small samples with repeated values. It is not an error.
Your quartiles differ from your software's. Different packages use different quartile methods. The gap is usually one position in the sorted list. Pick one method and use it everywhere.
Everything is an outlier. A heavily skewed distribution with a small IQR will push many points past the fences. That is the rule working as designed, not a bug.
The whiskers look wrong. Confirm you stopped them at the most extreme non-outlier value, not at the fence itself [3].
Common Mistakes
- Forgetting to sort the data. Quartiles are positional. An unsorted list gives meaningless results. Fix: sort first, every time.
- Including the median in both halves when $n$ is odd. That is a different convention from the one used here, and it shifts Q1 and Q3 toward the median (in the worked example Q1 would become 5 and Q3 would become 8). Fix: exclude the median value from both halves before finding the quartiles.
- Drawing whiskers to the fences. The fence is a cutoff, not a data value. Fix: extend the whisker to the most extreme actual value inside the fence [3].
- Leaving off the number line. A box with no scale communicates nothing about magnitude. Fix: always draw and label a scaled axis [1].
- Mixing outlier conventions across a report. One plot with outliers marked and another with them absorbed into the whisker makes comparison invalid. Fix: choose one convention and apply it to every plot.
- Reading the box as a frequency count. Each quarter of the plot holds roughly 25% of the observations, but the width shows spread, not how many values sit at any point [2]. Fix: describe the box in terms of spread and position.
Limitations
A box plot hides the shape of the distribution inside each quarter. Two datasets can produce identical boxes while looking completely different as histograms, one bimodal and one smooth. The box tells you where the quartiles are, not how the values pile up between them. If the shape matters, pair the box plot with a histogram or a dot plot. The comparison Bar Chart vs. Box Plot vs. Dot Plot walks through which view answers which question.
Box plots also discard the individual values. You cannot recover the original data from the plot, and you cannot see how many observations produced it. With very small samples, a single value can move a quartile a long way, so the plot can look more authoritative than the data deserves. The 1.5×IQR rule is a convention, not a statistical test. It flags unusual values for you to investigate. It does not tell you that a value is an error, and it does not tell you to delete it.
Frequently Asked Questions
How do you create a box and whisker plot from raw data?
Sort the values, find the median, then find the median of the lower half (Q1) and the upper half (Q3). Compute the IQR as Q3 minus Q1, set the fences at Q1 minus 1.5×IQR and Q3 plus 1.5×IQR, then draw a scaled number line with a box from Q1 to Q3, a line at the median, and whiskers to the most extreme non-outlier values [3].
What is the difference between a box plot and a box and whisker plot?
They are the same chart. The longer name describes the two components: the box, which spans the middle 50% of the data, and the whiskers, which extend toward the extremes [1]. You will also see "box-whisker plot" used interchangeably.
How do you know if a value is an outlier in a box plot?
Compute the IQR, then multiply it by 1.5. Any value below $Q1 - 1.5 \times IQR$ or above $Q3 + 1.5 \times IQR$ is drawn as an individual point instead of being covered by a whisker [3]. This is a labeling convention, so treat flagged values as worth a look, not as automatic errors.
Can you make a box and whisker plot with an even number of values?
Yes. When $n$ is even, the median is the average of the two middle values, and the lower and upper halves each contain exactly $n/2$ values with no leftover middle value to exclude. Find Q1 as the median of the lower half and Q3 as the median of the upper half.
What does a long whisker tell you?
A long whisker means the data stretches further on that side before reaching the most extreme non-outlier value. Combined with the position of the median inside the box, it tells you which direction the distribution leans. A median near Q1 with a long upper whisker indicates a right-skewed distribution, and the reverse indicates a left skew.
References
- 2.4 Box Plots - Statistics LibreTexts
- 8.6: Box Plots - Statistics LibreTexts/08%3A_Describing_Data/8.06%3A_Box_Plots)
- 1.3.3.7. Box Plot
- matplotlib.pyplot.boxplot, Matplotlib 3.11.2 documentation