Histogram vs boxplot: what each one shows
By Jude Wallis · Published
A histogram sorts a quantitative variable into bins and shows the shape of the distribution: peaks, gaps, clusters, and skew. A boxplot draws the five-number summary, so it shows the median, quartiles, and outliers and hides peaks and gaps. Use a histogram for shape and boxplots to compare groups.
AP Statistics: Unit 1 (topics 1.5 Graphical Representations for One Quantitative Variable, 1.8 Graphical Representations of Summary Statistics for One Quantitative Variable). Histograms belong to topic 1.5, Graphical Representations for One Quantitative Variable, and boxplots to topic 1.8, Graphical Representations of Summary Statistics for One Quantitative Variable, both in Unit 1 of the Fall 2026 AP Statistics course. This site uses the median-excluded (TI-84) quartile convention.
Histogram vs boxplot: the short answer
Both graphs display one quantitative variable, and they keep different things. A histogram cuts the number line into bins of equal width and draws a bar over each bin whose height is the count (or the proportion) of values that fall there. You see where the values pile up and where they thin out. A boxplot throws away everything except five numbers: the minimum, the first quartile ("Q one"), the median, the third quartile , and the maximum.
So the histogram answers questions about shape, and the boxplot answers questions about the median, the middle half of the data, and outliers. Neither one shows the individual values. The same 16 data values are drawn both ways in the first worked example below.
What a histogram shows
A histogram's bars touch, because the bins sit side by side on a number line with no space between them. Bar height is the frequency or the relative frequency of the bin. Reading across the bars gives the shape of the distribution: the number of peaks, the direction of any skew, and any gaps or clusters.
A histogram has two limits. First, the individual values are gone. A bar of height 7 over the bin from 20 to 30 says seven values are in that bin and nothing about where inside it they sit, so you can find the bin that holds the median but usually cannot read the median itself. Second, the picture depends on the bin width. Narrow bins make a ragged graph with many small spikes, and wide bins can merge two separate clusters into one bar. If a feature matters to your description, check that it survives a change of bin width. The histogram versus bar graph guide covers the difference from the categorical graph it resembles.
What a boxplot shows
A boxplot draws a box from to with a line inside it at the median, and a whisker reaching out from each end of the box. The length of the box is the interquartile range, . In a modified boxplot, any value more than below or above is plotted as a separate point, and each whisker stops at the most extreme value that is not an outlier. The steps are in how to make a boxplot.
The four pieces of a boxplot (lower whisker, lower part of the box, upper part of the box, upper whisker with any outliers) each cover about a quarter of the values. That is all the plot records about where the data sit. It cannot show how many peaks the distribution has, whether there is a gap, or how many observations were collected. In exchange it is compact, so several boxplots fit on one axis, and the medians and spreads of several groups can be compared at a glance.
The differences side by side
| Feature | Histogram | Boxplot |
|---|---|---|
| Built from | Counts of values in equal-width bins | The five-number summary |
| Shows peaks, gaps, and clusters | Yes | No |
| Shows skew | Yes, from the tails | Partly, from unequal whiskers and box halves |
| Median and quartiles | Only the bins that contain them | Exact values |
| Outliers | Appear as isolated bars; no rule is applied | Flagged by the rule in a modified boxplot |
| Depends on a drawing choice | Yes, the bin width | No, once the quartile rule is fixed |
| Comparing several groups | Awkward: one graph per group | Easy: side by side on one axis |
The histogram keeps the shape and gives up the exact summary values. The boxplot keeps the summary values and gives up the shape.
When to use which
Use a histogram when the question is about the shape of one distribution. Checking whether data are roughly symmetric, skewed, or have two peaks requires a histogram, a dotplot, or a stemplot, because those graphs show where the values concentrate. The dotplot, histogram, and stemplot comparison covers the choice among those three.
Use boxplots when the question is a comparison of groups, or when you want the median, the IQR, and the outliers in view. Three or four boxplots stacked on one axis are far easier to read than three or four histograms. For a full description of one distribution, draw both: the histogram tells you the shape, and the boxplot gives you the center, the spread, and the flagged outliers to quote in your description. With a small data set a dotplot is often better than either, since it shows every value.
The classic mix-up and how to avoid it
The most common misreading is treating a long section of a boxplot as if it held more data. Every section holds about a quarter of the values, so a long whisker or a long half of the box means those values are spread over a wider interval, which is lower density. In a histogram the reading runs the other way: a tall bar means many values. Students who carry the histogram habit over to a boxplot get the picture backward.
The second mistake is calling a distribution unimodal, or approximately normal, from a boxplot alone. Two data sets with very different shapes can share all five summary numbers and so draw identical boxplots, as the second worked example shows. If a question asks about the number of peaks, or about gaps and clusters, and you were given only a boxplot, the correct answer is that a boxplot cannot show them.
One data set drawn both ways
Sixteen students record the minutes they spent on a homework set: 12, 14, 15, 17, 18, 21, 22, 23, 24, 26, 27, 29, 33, 36, 41, 58. Build the histogram counts with bins of width 10 starting at 10, then find what a modified boxplot of the same data shows.
Count the values in each bin. From 10 up to 20: 12, 14, 15, 17, 18, so 5. From 20 up to 30: 21, 22, 23, 24, 26, 27, 29, so 7. From 30 up to 40: 33, 36, so 2. From 40 up to 50: 41, so 1. From 50 up to 60: 58, so 1.
Check the counts: .
Read the histogram: one peak in the bin from 20 to 30, with bars that trail off to the right as far as the 50s. The shape is unimodal and skewed right.
Find the median. With 16 values it is the average of the 8th and 9th: .
Find the quartiles. The lower half is 12, 14, 15, 17, 18, 21, 22, 23, so . The upper half is 24, 26, 27, 29, 33, 36, 41, 58, so .
Find the fences: and , so the fences are and .
Apply them. The value 58 is above 51.25, so it is plotted as an outlier, and the upper whisker ends at 41. No value is below , so the lower whisker ends at 12.
The histogram has bar heights 5, 7, 2, 1, 1 and shows a single peak in the 20s with a right skew. The boxplot has a box from 17.5 to 31, a median line at 23.5, whiskers ending at 12 and 41, and an outlier plotted at 58. The histogram gave the shape; the boxplot gave the median, the IQR of 13.5, and the flagged outlier.
Two shapes, one boxplot
Set C is 2, 4, 6, 9, 11, 14, 16, 18. Set D is 2, 4, 6, 7, 13, 14, 16, 18. Find the five-number summary of each, then count each set into bins of width 4 starting at 0.
Set C: the minimum is 2 and the maximum is 18. The median is . The lower half 2, 4, 6, 9 gives , and the upper half 11, 14, 16, 18 gives .
Set D: the minimum is 2 and the maximum is 18. The median is . The lower half 2, 4, 6, 7 gives , and the upper half 13, 14, 16, 18 gives .
Both five-number summaries are 2, 5, 10, 15, 18, and neither set has an outlier, because the fences are and . The two boxplots are identical.
Bin set C (0 to 4, 4 to 8, 8 to 12, 12 to 16, 16 to 20, each bin including its left end): the counts are 1, 2, 2, 1, 2.
Bin set D the same way: the counts are 1, 3, 0, 2, 2.
Compare. Set D has an empty bin from 8 to 12, with a cluster below it and a cluster above it. Set C has no empty bin.
Both sets have the five-number summary 2, 5, 10, 15, 18, so their boxplots match exactly. Their histograms differ: C has counts 1, 2, 2, 1, 2 and D has counts 1, 3, 0, 2, 2, with a gap in the middle. A boxplot cannot separate these two sets, and a histogram can.
Frequently asked questions
Can a boxplot show whether a distribution is bimodal?
No. A boxplot is drawn from five numbers, and none of them records where the peaks are. A distribution with two peaks and a distribution with one peak can have the same five-number summary and the same boxplot. Use a histogram, dotplot, or stemplot to judge the number of peaks.
Can I find the median from a histogram?
Usually only to the nearest bin. Add the bar heights from the left until you reach half the total count; the median lies in that bin. The exact value is lost, because a histogram does not record where the values sit inside a bin.
Which graph is better for comparing two groups?
Side-by-side boxplots are usually the clearest choice, because both medians, both IQRs, and any outliers line up on one axis. If the comparison is about shape, such as one group being skewed and the other symmetric, use histograms on the same scale or comparative dotplots instead.