Bar charts and histograms look nearly identical — vertical bars with a scale on each axis. But they represent fundamentally different types of data and answer completely different questions.
Key difference
| Bar chart | Histogram | |
|---|---|---|
| Data type | Categorical (names, labels) | Numeric (continuous measurements) |
| X axis | Discrete categories | Continuous numeric scale |
| Gaps between bars | Yes (by convention) | No — bars touch |
| Bar order | Arbitrary (usually sorted) | Fixed by numeric order |
| What it shows | Comparison of values across categories | Distribution of a single numeric variable |
| Example question | "Which product sold the most?" | "How are scores distributed?" |
The structural difference
The gap between bars is the visual signal:
- Bar chart — bars have gaps because the categories are discrete and unordered. "Apples" and "Oranges" are separate things; the space between them is conceptually empty.
- Histogram — bars touch because the numeric axis is continuous. The bins cover adjacent ranges; there's no gap between [70,80) and [80,90).
If you see gaps in a histogram, it usually means a bar chart was used by mistake. If you see no gaps in a bar chart, it may be styled incorrectly.
When to use a bar chart
- Comparing sales, revenue, counts, or scores across named categories
- Ranking items: "Top 10 countries by population"
- Showing change over time at discrete points: Q1, Q2, Q3, Q4
- Any "which category is highest/lowest?" question
When to use a histogram
- Understanding how a continuous variable is distributed across a range
- Checking for normality, skewness, or bimodal patterns in data
- Visualizing test scores, heights, response times, temperatures, or any measurement
- Any "what range do most values fall in?" question
The binning distinction
Bar charts require no binning — each bar is exactly one category. Histograms require you to choose bin width (how wide each bar is), which changes the visual shape:
- Too few bins (wide bins) → overly smooth, hides important shape details
- Too many bins (narrow bins) → jagged, noisy, hard to see the pattern
- Good bin count → reveals the distribution's shape: symmetric, skewed, bimodal, uniform
The right bin width depends on your dataset. A common starting rule: √n bins, where n is the number of values.
A common confusion: frequency bar charts
When you tally categorical data (e.g., "how many students scored A, B, C, D, or F?") and plot the counts as bars, you technically have a bar chart — the categories are grade labels. But it looks like a histogram because the categories are ordered. This is fine, but the bars should still have gaps because the grades are discrete.
FAQ
Can I use a bar chart for test scores?
If you're plotting each individual student's score as a bar (one bar per person), that's a bar chart. If you're grouping scores into ranges (60–70, 70–80, etc.) and counting how many students fall in each range, that's a histogram. For more than 20–30 students, a histogram is usually clearer.
Why do histogram bars touch but bar chart bars don't?
Because histograms represent continuous numeric ranges that are adjacent — the end of one bin is exactly the start of the next. There's no gap in the number line. Bar charts represent separate, discrete categories with no implied continuity between them.
Can I change the bin size in a histogram?
Yes, and you should experiment. The free online histogram maker lets you drag a slider to adjust bin count from 3 to 50 bins. Different bin widths reveal different aspects of your data's distribution.
How this guide is reviewed
This guide is maintained by the ChartsMakers Editorial Team and reviewed for statistical accuracy, product behavior, and clarity. When a guide relies on software behavior or statistical definitions, we check it against official documentation or established references. See our editorial policy.