Histogram vs Bar Chart: What's the Difference?
July 13, 2026
A histogram and a bar chart look almost identical at a glance. Both are made of vertical bars. But they answer completely different questions, and mixing them up leads to charts that quietly mislead people.
The short version: a histogram shows how one set of numbers is spread out, and its bars touch. A bar chart compares separate categories, and its bars have gaps. That single visual cue, touching versus gapped, is the fastest way to tell which one you are looking at.
This guide walks through the real differences, when to use each, and the mistakes that happen when the wrong one gets picked. If you have numbers to plot right now, you can drop them into the histogram maker and see the distribution in a few seconds.
The core difference: what is on the x-axis
Everything comes down to what sits along the bottom of the chart.
On a histogram, the x-axis is a number line. It is one continuous numeric variable, like age, income, test score, or temperature, cut into ranges called bins. Each bar covers a range of values, and its height shows how many data points fall in that range.
On a bar chart, the x-axis is a set of categories. Things like countries, product names, months, or survey answers. Each bar is one category, and its height shows a value for that category, such as a count, a total, or an average.
So the question each one answers is different:
- A histogram asks, "how are these numbers distributed?"
- A bar chart asks, "how do these categories compare?"
Once you know which question you are asking, the choice makes itself.
Why histogram bars touch and bar chart bars do not
The gap between bars is not a style choice. It carries meaning.
Histogram bars touch because the underlying scale is continuous. There is no gap between "30 to 39" and "40 to 49" on a number line. The ranges run right into each other, so the bars do too. A gap would suggest a break in the data that does not exist.
Bar chart bars are separated because the categories are genuinely separate. Apples and oranges are not two ends of a continuous scale. The gap between them is honest. It tells the reader these are distinct groups, not slices of one range.
This is why the touching-versus-gapped rule works so reliably. The spacing reflects whether the thing on the x-axis is continuous or categorical.
Order matters in one, not the other
Here is a difference people miss. In a histogram, the order of the bars is fixed. In a bar chart, it usually is not.
A histogram runs low to high along the number line. You cannot rearrange the bins without breaking the chart, because their position is their value. The shape of the whole thing, whether it leans left, leans right, or has two peaks, depends on that fixed order.
A bar chart has no required order. You can sort categories alphabetically, by size, or however tells the clearest story. Sorting a bar chart from tallest to shortest is often a good idea. Sorting a histogram that way would destroy it.
If the bars would still make sense rearranged, you are probably looking at a bar chart. If reordering them turns the chart into nonsense, it is a histogram.
A side-by-side comparison
| Feature | Histogram | Bar chart |
|---|---|---|
| X-axis | One numeric variable, split into bins | Separate categories |
| Bars | Touch each other | Have gaps between them |
| Bar order | Fixed, low to high | Flexible, often sorted by size |
| Bar width | Represents a range of values | Has no numeric meaning |
| Answers | How is this data distributed? | How do these categories compare? |
| Example | Distribution of customer ages | Sales by region |
When to use each
Reach for a histogram when you have a column of numbers and you want to understand its shape. Good questions for a histogram:
- Are most values clustered together or spread out?
- Is the data symmetric, or does it lean to one side?
- Are there two peaks, which usually means two groups got mixed together?
- Are there outliers sitting far from the rest?
Reach for a bar chart when you want to compare distinct things. Good questions for a bar chart:
- Which product sold the most this quarter?
- How do five regions stack up against each other?
- Did this month beat last month?
A quick test: if your data is one long list of measurements, you want a histogram. If your data is a short list of labeled totals, you want a bar chart.
The mistake that trips people up
The most common error is treating a numeric variable as if it were categories, and drawing a bar chart with gaps when the data is really continuous.
Say you have exam scores for 500 students. If you plot every unique score as its own gapped bar, you get a cluttered, spiky mess that hides the pattern. Bin those scores into ranges and draw a proper histogram, and the shape jumps out. You can see at a glance whether the class clustered high, spread evenly, or split into two groups.
The reverse mistake also happens. Someone forces categories onto a number line and lets the bars touch, implying a continuous scale that is not there. If your x-axis is product names, the bars should have gaps. Making them touch suggests apples flow smoothly into oranges, which is not true.
When you are unsure, ask one question: is the thing on the x-axis a number you could measure, or a label you assigned? Numbers get a histogram. Labels get a bar chart.
A related cousin: the Pareto chart
You may run into a chart that mixes both ideas, and it is worth naming so it does not confuse you. A Pareto chart is a bar chart with a running total line on top, sorted from tallest bar to shortest. It is still a bar chart at heart, because the x-axis is categories. The sorting and the line just help highlight which few categories account for most of the total.
It is a bar chart, not a histogram, even though the two get lumped together. The x-axis test settles it every time: Pareto charts show categories, so they are bar charts.
The bottom line
Histograms and bar charts share a look but not a job. A histogram takes one numeric variable, bins it, and shows you the distribution with touching bars in a fixed order. A bar chart takes separate categories and compares them with gapped bars you can sort however you like.
Remember the two tells. Touching bars and a number-line x-axis mean histogram. Gapped bars and category labels mean bar chart. Get that right and your charts will say what you actually meant them to say.
If you have a column of numbers and want to see its shape without wrestling with spreadsheet settings, paste it into the histogram maker. It bins the data, draws the distribution, and shows you the frequency table, all in the browser.