Do Histogram Bars Touch? Rules and Exceptions

Yes, histogram bars touch. This is one of the defining visual features of a histogram and the easiest way to tell it apart from a standard bar chart. The touching bars signal that the data flows continuously from one range to the next, with no natural breaks between groups.

Why the Bars Touch

A histogram displays numeric data sorted into consecutive ranges called bins. Each bar’s height shows how many data points fall within that range. Because the ranges sit right next to each other on a number line, the bars representing them sit right next to each other too. A bin covering 10–20 ends exactly where the bin covering 20–30 begins, so there is no space between them.

This design reflects the nature of the data. When you measure something continuous like height, weight, or time, every value between your minimum and maximum is theoretically possible. The touching bars communicate that idea visually: the data is one unbroken spectrum sliced into sections, not a collection of separate buckets.

How This Differs From a Bar Chart

A bar chart has gaps between its bars on purpose. Each bar represents a distinct, separate category (like countries, product names, or survey responses), and the spacing reinforces that these categories have no inherent order or continuity. You could rearrange the bars in a bar chart without losing meaning.

You cannot do that with a histogram. The horizontal axis is a number line, so the bars must stay in numerical order. Swapping two bars would scramble the data and make the distribution unreadable. The touching bars and the fixed order work together to show the shape of your data: where values cluster, where they thin out, and whether the distribution skews left or right.

What About Gaps in a Histogram?

You will sometimes see a histogram with a visible gap, and that’s not an error. It means one of the bins contains zero observations. If nobody in your dataset scored between 40 and 50 on a test, the bar for that range simply has no height, leaving empty space between its neighbors. The gap is meaningful: it tells you that particular range of values didn’t occur in your data. It’s different from the decorative spacing in a bar chart, which carries no information at all.

Software can also introduce misleading gaps if your data is actually categorical rather than continuous. If you feed discrete categories into a histogram function, some tools will produce bars with spaces between them. That’s usually a sign you should be using a bar chart instead.

How Bin Boundaries Work

One practical question behind the touching-bars rule: what happens when a data point lands exactly on the boundary between two bins? If one bin covers 20–30 and the next covers 30–40, where does a value of exactly 30 go?

Every histogram uses an endpoint convention to handle this. The most common approach is to include the left boundary and exclude the right for all bins except the last one. So the 20–30 bin includes 20 but not 30, and the 30–40 bin includes 30. The last bin includes both endpoints so no data point gets left out. Most statistical software handles this automatically, but knowing the rule matters if you’re building a histogram by hand or troubleshooting unexpected counts.

Because every boundary belongs to exactly one bin, the ranges tile perfectly across the number line with no overlaps and no gaps. That seamless tiling is the mathematical reason the bars touch.

Discrete Data Is the Exception

Things get slightly more flexible when your numeric data only takes whole-number values, like the number of children in a household or the number of goals scored in a game. These discrete values don’t flow continuously, so you can reasonably plot them with either a histogram (bars touching) or a bar chart (bars separated), depending on what you want to emphasize.

If you’re interested in the overall shape of the distribution, a histogram with touching bars works well even for integers. If you want to highlight the exact count for each individual value, a bar chart with gaps can make each value easier to read independently. Neither choice is wrong for discrete numeric data, but for anything continuous, the bars should always touch.

Area, Not Just Height

The touching-bars design also connects to a less obvious feature of histograms: each bar’s area, not just its height, represents the proportion of data in that bin. When all bins have equal width, area and height tell you the same thing, so the distinction doesn’t matter much in practice. But histograms can use bins of unequal width, and when they do, the height of the bar adjusts so that the area still correctly reflects the frequency. Touching bars make these area comparisons possible because there’s no ambiguity about where one bin ends and the next begins.

This is why a zero-valued baseline is also essential for histograms. If the vertical axis doesn’t start at zero, or if gaps are artificially inserted, the visual areas become distorted and the distribution looks different than it actually is.