Histogram vs bar graph comes down to one question: what’s on the x-axis? A bar graph compares separate categories, like penguin species. A histogram shows how one set of numbers spreads out, like the body mass of 342 penguins, by counting them into bins along a number line.

Every chart below uses the same real penguins and opens in our maker, so you can change the data and watch the difference.

What’s the difference between a histogram and a bar graph?

A bar graph shows one value for each category, so you can compare the groups at a glance. A histogram takes many measurements of one thing, sorts them into ordered intervals called bins, and shows how many values land in each bin, which statisticians call the distribution. The College Board’s AP Statistics course description draws the same line. Its bar chart shows the categories of a single categorical variable. Its histogram places numeric values “into ordered intervals, or bins, along the horizontal axis.”

That makes the x-axis the fastest histogram vs bar graph test. Category names along the bottom mean a bar graph. Numbers running in order, with each bar covering a range such as 3,500 to 3,750 grams, mean a histogram. The rest follows. You can reorder a bar graph’s bars without changing what it says. A histogram’s bins have to stay in numeric order, and each bar’s width is part of the data.

Histogram vs bar graph at a glance
QuestionBar graphHistogram
What's on the x-axis?Category names, such as species or productsA number line cut into bins, like 3,500 to 3,750 g
What does it answer?How do these groups compare?How are these values spread out?
What do you start with?One number per category: a count, total or averageA long list of raw values of one measurement
Can you reorder the bars?Yes, in any order [Unless the categories have a natural order, like ratings from 1 to 5. Keep those in order.]No, bins follow the number line
Gaps between bars?Usually, to separate the categoriesUsually none; an empty bin leaves an honest gap
What does bar width mean?NothingThe range the bin covers
What's on the y-axis?The value for each categoryCount, percent or frequency density per bin
Penguin exampleAverage body mass by speciesBody mass of all 342 penguins
Figure 1 · Live — How a bar graph and a histogram differ, row by rowSource: AP Statistics CED (College Board), OpenStax Introductory Statistics 2e, NIST e-Handbook; checked 8 Oct 2026
✎ Open in the maker

The two look alike enough to fool people who’ve just studied them. A 2012 study at a US university asked students to choose the right chart for a list of numbers, and 10.6% of 341 picked the histogram at the start of the course. Even after an introductory statistics course, only 16.1% of 274 students picked the histogram for a list of numbers. More than 60% chose a chart with one bar per number, shuffled into a bell shape, according to Kaplan and colleagues in the Journal of Statistics Education (2014). More worked examples live on our histogram examples and bar chart examples pages.

Histogram vs bar graph on real data: what does each one show?

The Palmer Penguins data lists 344 penguins from three islands in Antarctica’s Palmer Archipelago, measured from 2007 to 2009 by Kristen Gorman and the Palmer Station Long Term Ecological Research team. It’s free to use under a CC0 license, and body mass is recorded for 342 of the birds. We downloaded the published file and recomputed every number on this page from it.

Ask “which species is heaviest?” and you want a bar graph: one bar per species, one number per bar.

Average body mass by species (g)
LabelAverage mass (g)
Adelie3,701
Chinstrap3,733
Gentoo5,076
Figure 2 · Live — A bar graph: one average per speciesSource: Palmer Penguins (Gorman et al. 2014), 342 penguins with a recorded mass
✎ Open in the maker

Gentoos weigh about 1.3 to 1.4 kilograms more than the other two species on average, and Adelies and Chinstraps are almost tied. The chart hides how much penguins vary inside a species. You could also sort its bars by weight or by name, and it would mean the same thing.

Counting birds instead of weighing them still gives a bar graph. The data has 152 Adelies, 124 Gentoos and 68 Chinstraps. A chart of those counts has bars whose heights are frequencies, just like a histogram’s. The x-axis still holds species names, though, so it’s a bar graph of a categorical variable, which is how the AP course description defines one.

Ask “how heavy are these penguins?” and you want a histogram of all 342 masses.

Body mass of 342 penguins, in 250 g bins
LabelPenguins
2,5001
2,7508
3,00019
3,25043
3,50049
3,75045
4,00028
4,25031
4,50028
4,75023
5,00018
5,25016
5,50021
5,7508
6,0003
6,2501
Figure 3 · Live — A histogram: 342 body masses in 250-gram bins; each bar is labeled with the weight where its bin startsSource: Palmer Penguins (Gorman et al. 2014)
✎ Open in the maker

The tallest bar, 3,500 to 3,750 grams, holds 49 penguins. To its right the bars step down in a long, uneven tail past 6,000 grams, and that tail belongs to the Gentoos: every penguin from 5,000 grams up is a Gentoo. Even the lightest Gentoo, at 3,950 grams, outweighs 106 of the 151 weighed Adelies. That heavy tail pulls the average of all 342 birds to 4,202 grams, two bins right of the peak. Report the average alone and you’d put the typical penguin in a bin with 28 birds instead of the 49 at the peak. The histogram shows both.

Same penguins, two questions: compare the groups, or see the spread.

Is a histogram a bar graph?

A histogram isn’t a bar graph, though it’s drawn with bars and software often files it next to them. Microsoft’s Excel help calls a histogram “a column chart that shows frequency data,” and Excel lists it under Insert > Insert Statistic Chart > Histogram. The documentation for R, the statistics language, takes the other side: “Typical plots with vertical bars are not histograms.”

Both describe the same picture from different ends, which is why the histogram vs bar graph question keeps coming up. A histogram uses bars as a drawing tool; the numeric axis underneath makes it a histogram. Both charts are old. William Playfair printed a bar chart in his Commercial and Political Atlas in 1786. The word histogram reached print in 1895, in a paper by Karl Pearson. He had used it in his statistics lectures and described it as columns whose areas mark the frequency over the range of their base.

Do histogram bars have to touch?

Histogram bars usually touch, but only one of four standard references we checked requires it. The OpenStax Introductory Statistics textbook builds it into the definition: a histogram “consists of contiguous (adjoining) boxes.” The AP Statistics course description, the Common Core grade 6 standard that lists histograms, and NIST’s e-Handbook of Statistical Methods describe histograms without mentioning gaps. Gaps are still the first difference many histogram vs bar graph explainers mention. Software treats spacing as a drawing setting. R draws histogram cells as adjoining intervals but leaves a gap of 0.2 bar widths in its bar plots, and Google Sheets’ histogram chart has a “Show item dividers” option.

A terraced street with houses of different heights standing wall to wall and one empty plot, a metaphor for touching histogram bars and an empty bin

A real histogram can have gaps for two reasons. An empty bin leaves a gap because no values fell in that range, and the gap is information: in the 100-gram chart further down, the two bins from 6,100 to 6,300 grams are empty. Some tools also draw thin dividers between bins so the bars are easier to count. Neither turns the chart into a bar graph, because the axis is still a number line. A teacher who marks down a histogram with gaps is right in a class that follows a textbook like OpenStax, where touching bars are part of the definition. Draw them touching on the test.

Can a histogram show discrete data?

Yes. Discrete data are counted values, like books bought or children per family, and a count is still a number on a scale. OpenStax’s own worked example is a histogram of the number of books bought by 50 part-time college students. The AP course description agrees: a quantitative variable takes “numerical values for a measured or counted quantity.” With only a few whole numbers, center each bar on its value: a bin from 0.5 to 1.5 for one book, 1.5 to 2.5 for two, and so on.

Two kinds of numbers belong in other charts. Ratings such as 1 to 5 stars, or “strongly disagree” to “strongly agree,” are ordered categories, often called ordinal data. Their steps are labels in order, and the distance between “agree” and “strongly agree” isn’t a measured amount the way 100 grams is. Count how many answers each level got, draw a bar graph, and keep the levels in their natural order instead of sorting by height. Years and months usually tell a story over time, which a line graph shows better than either chart.

How many bins should a histogram have?

Changing the bin width can change a histogram’s shape, so try two or three widths before trusting it. Start with a rule, then look at the chart and adjust. The AP course description warns that changing the bin widths “can change the appearance of the histogram,” and the penguins show how much. With 1,000-gram bins, 156 of the 342 birds land in a single bar, and the tail of heavy Gentoos shrinks to two blocks.

The same pebbles sorted into a tray with a few wide compartments and a tray with many narrow ones, a metaphor for histogram bin width
The same 342 penguins in 1,000 g bins
LabelPenguins
2,0009
3,000156
4,000110
5,00063
6,0004
Figure 4 · Live — Bins too wide: 1,000-gram bins, each labeled with its starting weight; the peak and the tail blur into a few blocksSource: Palmer Penguins (Gorman et al. 2014)
✎ Open in the maker

With 100-gram bins the chart breaks into 37 jittery bars. Neighboring bars jump up and down by as many as nine penguins, and two empty bins appear at the heavy end.

The same 342 penguins in 100 g bins
LabelPenguins
2,7001
2,8002
2,9006
3,0007
3,1007
3,20011
3,30016
3,40021
3,50019
3,60016
3,70023
3,80015
3,90021
4,00012
4,10011
4,20011
4,30011
4,40014
4,5006
4,60013
4,70015
4,80010
4,9007
5,0009
5,1005
5,2007
5,3007
5,4006
5,50011
5,6005
5,7006
5,8005
5,9002
6,0003
6,1000
6,2000
6,3001
Figure 5 · Live — Bins too narrow: 100-gram bins, each labeled with its starting weight; the shape turns to noiseSource: Palmer Penguins (Gorman et al. 2014)
✎ Open in the maker

Three classic rules give you a starting point. Sturges’ rule (1926) picks about log2(n) + 1 bins, where n is the number of values and log2(n) is how many times you can halve n before reaching 1. For 342 penguins that’s 10 bins. Divide the range, 2,700 to 6,300 grams, by 10 and each bin is 360 grams wide. Sturges is R’s default and the rule our histogram maker starts from, and at 360 grams the same peak and tail appear. Click Open in the maker under any histogram here and it loads all 342 masses, then bins them itself, starting from these 10 bins. Scott’s rule (1979), which Excel uses for its automatic bins, sets the width from the standard deviation (how far values typically sit from the average). Here it gives about 400 grams. The Freedman-Diaconis rule (1981) uses the interquartile range instead, the spread of the middle half of the data, and gives about 343 grams. When the rules disagree, draw two of them and keep the one that shows the shape without noise. We used 250 grams in the histogram above so the axis reads in round numbers.

In Excel, right-click the horizontal axis, choose Format Axis and set Bin width or Number of bins. In Google Sheets, pick the Histogram chart and change the bucket size, Google’s name for bin width, under Customize > Histogram; our Google Sheets guide walks through the rest. Check which edge each bin includes, too. Five penguins weigh exactly 3,750 grams. With 250-gram bins, R’s default counts a value on an edge in the bin below, so they land in the 3,500 to 3,750 bin. Our charts above count it in the bin above, so the same five land in the 3,750 to 4,000 bin. Either rule works if you use it consistently and say which.

What if the bins aren’t the same width?

When histogram bins have different widths, each bar’s area, not its height, has to show the count. Karl Pearson defined the histogram that way in 1895. R’s documentation still draws unequal bins so that each rectangle’s area is the share of data points inside it, the same idea on a 0-to-1 scale. The height becomes frequency density: the count divided by the bin width, in any unit of width you like, as long as every bar uses the same one.

With the penguins, merge the four lightest 250-gram bins into one bin from 2,500 to 3,500 grams, and it holds 71 birds. Drawn by count, that bar would tower over the 49 penguins at 3,500 to 3,750 grams, though it covers four times the range. Divided by width, the wide bin has 7.1 penguins per 100 grams and the peak bin has 19.6, so the peak stays the peak.

When should you use a histogram vs bar graph?

Use a bar graph to compare groups and a histogram to see how one measurement spreads. Four questions settle almost every case:

  1. What goes on the x-axis? Names, groups or rating levels mean a bar graph. A measurement split into ranges means a histogram.
  2. What do you have? One number per group, like a total or an average, makes a bar graph. A long list of measurements makes a histogram; a long list of ratings is still counted per level and drawn as a bar graph.
  3. Do the distances between values mean something? If 4,000 grams is exactly 250 grams more than 3,750, you have a number line and a histogram. If the values are names or levels, it’s a bar graph.
  4. How many values? Up to a few dozen fit a dot plot, where every value stays visible. Hundreds read best as a histogram.

Five histogram vs bar graph mistakes to avoid:

  • Sorting a histogram’s bins by height, which scrambles the number line. If your tool can sort bars, leave sorting off for bins.
  • Drawing one bar per raw value when you want the spread. With 342 penguins that’s 342 bars and no shape, the kind of chart most students in the Kaplan study picked instead of the histogram. One bar per player to compare players by name is a fine bar graph; it just can’t show how the scores spread.
  • Reporting only an average. A bar graph of averages hides the spread a histogram shows.
  • Leaving the y-axis unlabeled. Say whether it shows a count, a percent or a density.
  • Starting a bar graph’s axis above zero. Correll and colleagues found in 2020 that bar charts whose y-axes don’t begin at zero make differences look bigger.

Have one number per group? Type your own rows below and the bar graph redraws. For a long list of raw numbers, paste it into the histogram maker, which picks the bins for you, or open the bar graph maker for the full editor.

Try it with your data

Your data
LabelValue
Adelie3,701
Chinstrap3,733
Gentoo5,076
Live — Your data
✎ Open in the maker

What if neither chart fits?

Pick a dot plot for small samples, a line graph for change over time and a box plot to compare spreads side by side. These are the look-alikes people mix up with the two charts above:

Charts that get confused with histograms and bar graphs
ChartWhat it isUse it when
Column chartA bar graph with vertical barsCategory names are short and there are only a few of them
Dot plotOne dot per value, stacked over a number lineYou have a few dozen values and want each one visible
Frequency polygonOne point per bin at its frequency, joined by straight linesYou want to overlay two distributions to compare them
Pareto chartCategory bars sorted from largest to smallest, plus a running-total line [Excel's help calls it a sorted histogram, but its bars are categories, such as causes of defects.]You want to show which few causes account for most of a total
Box plotA box around the middle half of the values, with the median markedYou're comparing the spread of several groups side by side
Line graphPoints over time joined by a lineThe x-axis is dates, months or years
Figure 6 · Live — Six look-alike charts and when each one fitsSource: OpenStax Introductory Statistics 2e, Common Core 6.SP.B.4, Microsoft Support; checked 8 Oct 2026
✎ Open in the maker

For the first two, our column chart maker and dot plot maker take the same pasted data as the makers above.