Histogram vs Bar Graph: How to Tell Them Apart

Published: . Last updated:

The main difference between a histogram and a bar graph is the kind of data. A bar graph compares categorical data, separate groups like sports, colors or states, so its bars have gaps and can go in any order. A histogram shows how numerical data is spread out (its distribution), so its bars touch and each covers an equal-width range called a bin.

  • Labels are words or names: bar graph.
  • Labels are number ranges like 70-79: histogram.

Have category counts to chart? Draw your bar graph here for free.

Histogram vs bar graph comparison table

Histogram vs bar graph at a glance
FeatureBar graphHistogram
Type of dataCategories (names, groups, answers)Numbers measured or counted, grouped into ranges
Horizontal axis labelsCategory namesNumber ranges (bins) on a number line
Gaps between barsYesNo, bars touch
Bar orderAny order you choose (often sorted by size)Fixed, lowest to highest
Bar widthWidth means nothing; all bars matchEach bar covers an equal-width range
Vertical axisCount, percent, or any value (sales, averages)Frequency or relative frequency
Main questionHow do the groups compare?How are the values spread out?
Can bars be horizontal?Yes, oftenRarely; almost always vertical
ExampleFavorite sport, sales by regionTest scores, heights, commute times

One row deserves a note. A bar graph's bar can show any value, not just a count: average rainfall by month, revenue by product, and so on. A histogram's bar always shows how many data values (or what share of them) fell in that range.

On this page

The difference between a histogram and a bar graph

Both charts use rectangles, and both usually have a count or a percent on the vertical axis. That is why they get mixed up. The real difference is what sits on the horizontal axis.

OpenStax's Introductory Statistics describes bar graphs as bars "separated from each other" that can run vertically or horizontally, and it describes a histogram as "contiguous (adjoining) boxes" with the horizontal axis labeled with what the data represents. It adds that a histogram "can give you the shape of the data, the center, and the spread of the data."

Put simply:

  • A bar graph answers "how do these groups compare?"
  • A histogram answers "how are these numbers distributed?" Where do most values fall, is the data lopsided, are there outliers?

If you want a refresher on the bar graph side first, see what a bar graph is and its parts.

Same class, two questions: one of each

Picture a class of 30 students who fill out a quick survey. Two questions come back, and each one needs a different chart.

Question 1: "What is your favorite sport?"

The answers are words: soccer, basketball, football, swimming, other. Each student picks one category, and you count how many picked each. That is categorical data, so it goes on a bar graph. Here are the counts (example data):

Favorite sport, class of 30 (example data)
SportStudents
Soccer9
Basketball7
Football6
Swimming4
Other4

Notice you could list the sports in any order. Sorting from most to least popular is a common choice because it makes the comparison easier to read, but alphabetical would be just as correct. The gaps between bars remind the reader that each bar is its own separate group.

Have a list of raw answers instead of counts? The relative frequency bar graph maker tallies them for you and adds percents.

Favorite sport, class of 30 (example data)Bar graph of favorite sport for 30 students (example data): Soccer 9, Basketball 7, Football 6, Swimming 4, Other 4, with gaps between bars.SportNumber of students0246810SoccerBasketballFootballSwimmingOther97644
Favorite sport, class of 30 (example data)

Question 2: "What did you score on the unit test?"

Now the answers are numbers from 50 to 99. You could make a bar for every single score, but with 30 students you would get a long row of mostly 1s and 0s that tells you nothing. Instead you group the scores into equal ranges, called bins or classes, and count how many scores land in each one. That is a histogram (example data):

Unit test scores, class of 30, grouped in 10-point bins (example data)
Score range (bin)Students
50-592
60-695
70-7910
80-899
90-994

Three things are different from the sports chart:

  • The order is fixed. 50-59 has to come before 60-69. Sorting the bins from tallest to shortest would scramble the number line and hide the shape.
  • The bars touch. The ranges run into each other with no gap on the number line, so the bars do too.
  • The shape is the point. You can see at a glance that most scores sit in the 70s and 80s and that fewer students scored very low or very high.
Unit test scores, class of 30 (example data)Histogram of 30 test scores in 10-point bins (example data): 50-59 has 2, 60-69 has 5, 70-79 has 10, 80-89 has 9, 90-99 has 4, with touching bars.Score rangeNumber of students (frequency)024681050-5960-6970-7980-8990-99251094
Unit test scores, class of 30 (example data)

"Which one do I have?" checklist

Looking at a chart in a textbook or a worksheet and not sure what to call it? Run through these in order:

  1. Read the labels under the bars. Words or names point to a bar graph. Number ranges point to a histogram.
  2. Look for gaps. Space between the bars usually means a bar graph. Bars pressed together usually mean a histogram. (Some software draws bar graphs with no gaps, so don't rely on this alone.)
  3. Try reordering the bars in your head. If shuffling them still makes sense, it's a bar graph. If shuffling breaks the number line, it's a histogram.
  4. Check the vertical axis. A histogram shows frequency, relative frequency or percent. If the bars show something like an average or a dollar amount per group, it's a bar graph.
  5. Ask what question the chart answers. Comparing groups means bar graph. Showing where values cluster means histogram.

If the answers point both ways, the next section covers the cases that trip people up.

Tricky cases

A bar graph of numbers, like "number of pets"

Suppose you ask 25 students how many pets they have and get answers of 0, 1, 2, 3 or 4. The labels are numbers, so is it a histogram? It can be drawn either way. With only a handful of whole-number values you can treat each value as its own category and draw separated bars. That reads as a bar graph and is common in elementary and middle school. Or you can draw it as a histogram where each bar is centered on its value. OpenStax does exactly this with a discrete example about books bought, explaining that a width of one "places the 1 in the middle of the interval from 0.5 to 1.5, the 2 in the middle of the interval from 1.5 to 2.5." Either way, keep the values in number order. If your teacher or textbook names one form, use that.

Bins must be equal width

In a standard histogram every bin covers the same range. If the test score bins were 50-59, 60-69, 70-79 and then 80-100, the last bar would cover more than twice as many possible scores (21 instead of 10) and look taller than it deserves. A common mistake is ending with a 90-100 bin that holds 11 possible scores while every other bin holds 10. Fix it by making every bin the same size and deciding up front which bin a boundary value belongs to.

How many bins?

Too few bins hide the shape; too many make it jagged. OpenStax notes that "many histograms consist of five to 15 bars or classes for clarity," and gives a rule of thumb that a histogram suits data sets of about 100 values or more. Classroom examples often use fewer values, like the 30 scores above, which is fine for practice but means the shape is rougher.

"Column chart" vs "bar chart"

In Excel and Google Sheets, a chart with vertical bars is called a column chart and "bar chart" means horizontal bars. Microsoft's help page describes column charts as useful for "illustrating comparisons among items," with categories on the horizontal axis and values on the vertical axis. In math class, both are just bar graphs. Neither name makes the chart a histogram: a column chart of test score bins with the gaps removed is a histogram in everything but name.

Histogram vs bar graph vs column graph

So the three-way comparison is really two-way. Column graph and bar graph are the same idea in different orientations. The histogram is the one that plays by different rules. For where these fit among other chart types, see types of graphs in math and our guide to types of bar graphs.

When to use a histogram vs a bar graph

Use a bar graph when:

  • Your data is a set of categories or groups.
  • You want to compare sizes: which group is biggest, which is smallest.
  • You're showing one value per group, such as a count, a total or an average.
  • You want to compare two or more series side by side, which calls for a double bar graph.

Use a histogram when:

  • You have many individual numbers (scores, heights, times, prices).
  • You want to see the shape: where values bunch up, whether they are lopsided, whether there are gaps or outliers.
  • You care about the distribution more than any single value.

And skip the histogram when you have very few data values, when your data is categorical, or when the reader needs exact individual values. A small data set can look like almost any shape depending on where you set the bins, so a dot plot or a plain table may be clearer.

Make the right chart

For the key takeaway on histogram vs bar graph: categories get a bar graph with gaps, and numbers grouped into equal ranges get a histogram with touching bars. If your data are numbers to group into ranges, the histogram maker sorts them into classes and draws a frequency or relative frequency histogram with the full table. If your data is a list of category answers, paste it into the relative frequency bar graph maker to get counts, percents and the chart in one step. If you already have your categories and values, the free Bar Graph Maker builds simple, grouped or stacked bar graphs in your browser and exports PNG, SVG or CSV.

Related guides

Frequently asked questions

Is a histogram also called a bar graph?

No. A histogram looks like a bar graph, but it is a separate chart type. A bar graph compares categories and has gaps between bars. A histogram shows how numerical data is distributed across equal-width ranges, and its bars touch. Some people loosely call a histogram a kind of bar chart, but in math and statistics classes the two are kept separate.

Why would someone make a histogram instead of a bar chart?

Because they have a lot of numbers and want to see the pattern in them. A histogram groups values into ranges so you can see where most values fall, whether the data leans to one side, and whether there are unusual values. A bar chart of individual values would be too long and too flat to show that shape.

When should you use a histogram graph?

Use a histogram when your data is numerical (test scores, heights, wait times) and you want to show its shape, center and spread. It works best with a larger data set. OpenStax gives a rule of thumb of about 100 values or more, with roughly five to 15 bins.

When should you not use a histogram?

Don't use a histogram for categorical data like favorite colors or product names, since there is no number line to put the bars on. Also avoid it when you only have a few data values, when you need to show exact individual values, or when your bins can't be kept equal width. A bar graph, dot plot or table is usually a better fit in those cases.

What is the difference between a histogram and a bar graph, with an example?

Favorite sport in a class (soccer 9, basketball 7, football 6, swimming 4, other 4, example data) is a bar graph: the labels are categories and the bars can be in any order. Test scores grouped as 50-59, 60-69, 70-79, 80-89 and 90-99 (2, 5, 10, 9 and 4 students, example data) is a histogram: the labels are equal number ranges in fixed order and the bars touch.

How this page is checked

Written by Cedrick Reese. The definitions, the five-to-15-bin guidance, the 100-value rule of thumb and the discrete-data example were checked against OpenStax Introductory Statistics 2e (sections 2.1 and 2.2), and the column chart naming against Microsoft Support's column chart help page. All survey and test score numbers are example data, and the page is rechecked when those references or spreadsheet chart menus change.

Sources used on this page: