Histogram vs bar graph: Key differences, shown on one dataset
A histogram shows how one numeric variable is spread across ranges: how many orders were worth $0–250, how many $250–500, and so on. A bar graph compares a value across separate categories: orders by channel, revenue by region. If the thing on the x-axis is a number you had to cut into ranges, you want a histogram. If it is a list of names, you want a bar graph.
They look alike because both are made of bars, and that is where the trouble starts. Below, one year of orders from a synthetic demo store is drawn both ways, and then three choices that change what a histogram says without changing a single number in it.

Every chart in this article uses the same data: 5,913 completed orders placed in 2025 in the [Demo] E-commerce project, a synthetic store behind OWOX’s public demo. The figures were queried on 10 November 2026, and the SQL is printed below so you can run the same cut on your own orders.
Reading to get this done?
What is a histogram?
A histogram is a chart of the distribution of one continuous variable. You cut the range of values into intervals, called bins, count how many records fall into each, and draw one bar per bin. The bars touch, because the bins are adjacent: one ends exactly where the next begins.
The left chart above is a histogram. It answers a question no single average can: most orders are small, and a long tail of large orders pulls the total up. Half of the orders are under about $320, the average is $493, and the largest is $4,389.
What is a bar graph?
A bar graph, also called a bar chart or a column chart, compares a numeric value across distinct categories. The categories go on one axis and the value on the other. The value can be a count, a sum, an average or any other single number per category.
The right chart above is a bar graph. Its three categories have no order of their own, so the bars stand apart, and you could sort them by size or alphabetically without changing what they say.
You put order values on a chart and can't tell whether you need a histogram or a bar graph, or which bin width is honest.
Paste this into your AI assistant. It bins your own order values into a histogram, draws orders by channel as a bar graph, and shows how the bin width changes the picture.
The prompt
Read https://www.owox.com/ai-agent-setup.md and follow it to set up OWOX Data Marts for me, starting from /blog/articles/histogram-bar-graph-differences.md. The task: show me how my order values are spread: a histogram of my store's orders at two bin widths, and a bar graph of orders by channel to compare. Tag the links you give me with utm_campaign=ai-task and utm_term=data-foundation. Use what you know about my context and goals
When to use a histogram vs a bar graph
When to use a histogram vs a bar graph
The choice depends on what is on the x-axis, not on how the chart looks. Ask what the reader should take away.
Histogram: analysing frequency and distribution
Use a histogram when your data is numeric and you want to see how it is spread: whether values cluster, how long the tail is, whether there are two groups where you expected one, where the outliers are. Order values, session durations, delivery times, days to convert and test scores are typical.
A histogram is also the fastest way to check whether an average means anything. If the shape is lopsided, as order values almost always are, the average sits well away from the typical record.
Bar graph: comparing quantities across categories
Use a bar graph when you are comparing one number across named groups: sales by region, orders by channel, sign-ups by campaign. It suits reports and presentations because the reader only has to compare lengths.
One caution. A bar graph of averages per category hides the distribution inside each bar, which is exactly what a histogram shows. Both charts below are honest; they answer different questions.
Key differences between histograms and bar graphs
Key differences between histograms and bar graphs
| Histogram | Bar graph | |
|---|---|---|
| Question it answers | How are the values spread? | How do the categories compare? |
| X-axis | A numeric scale cut into bins | Named categories |
| Bar spacing | Bars touch | Gaps between bars |
| What a bar shows | How many records fall in the bin | One value per category: count, sum, average |
| Bar order | Fixed, low to high | Any: by size, name or place |
| Choices that change the picture | Bin width, bin edges, which records are included | Axis start, sort order, which statistic |
Purpose
A bar graph compares quantitative data across distinct categories, such as sales by region or satisfaction by product. A histogram visualises the distribution of continuous data, how often values fall within each interval.
Data type
Bar graphs take categorical data, separate groups with no numeric order. Histograms take continuous data, such as ages, amounts or durations, where values fall along a range and have to be grouped into intervals before they can be counted.
Bar spacing
In a bar graph the bars are spaced apart to show that each category is separate. In a histogram the bars are adjacent with no gap, because the bins cover one continuous range. A gap in a histogram means a bin that is empty, not a design choice.
Data representation
In a bar graph, each bar is one value for its category: a sum, an average or a count. In a histogram, each bar is the number of records inside a bin. The bars of a histogram are not values of the data; they are counts of it.
Representation of bars
The height of a bar graph’s bar is the value itself, such as total sales for one month. The height of a histogram’s bar depends on the bin: make the bins twice as wide and the bars roughly double, which is why a histogram always needs its bin width stated.
Arrangement of bars
Bar graphs allow any arrangement: by size, alphabetically or by geography, whichever makes the comparison easiest. A histogram’s bars must stay in numerical order, lowest bin to highest, because the order is the data.
Three choices that change what a histogram says
Three choices that change what a histogram says
A bar graph has one notorious trap, a y-axis that does not start at zero, covered with examples in bad data visualization examples. A histogram has three of its own, and none of them looks like an error.
The bin width
Here are the same 5,913 orders drawn with $50, $250 and $1,000 bins.

- At $50, there are two humps: a peak of 724 orders at $100–150, a drop to 320 at $200–250, and a second rise to 371 at $250–300. Something in the catalogue or the pricing creates a gap around $200.
- At $250, the gap is gone. The first bar holds 2,471 orders and the chart reads as one smooth slope.
- At $1,000, the chart says only that 87% of orders are under $1,000 (5,150 of 5,913).
None of the three is wrong. The bin width is an editorial decision, and the reader cannot see it unless you print it. Excel’s automatic histogram picks a width with Scott’s normal reference rule, a formula designed for bell-shaped data (Microsoft Support, “Create a histogram”). Order values are not bell-shaped, so try two or three widths before you choose.
The bin edges
The old version of this article listed order-value bins as 0–100, 101–200, 201–300. An order worth $100.50 fits neither. For continuous data, write bins as half-open intervals: $0 to under $250, $250 to under $500. In SQL, FLOOR(value / width) * width does exactly that, and the query below labels each bin with both edges.
Which records are counted
Orders in this store can be Completed, Cancelled or Returned, and the cancelled and returned ones carry $0 of net revenue. Leave the status filter off and 1,042 of them join the first bin.

The first bar grows from 2,471 to 3,513, 42% taller, and the chart now suggests that small orders are far more common than they are. Nothing is miscalculated; the chart counts a different population. Say in the chart’s title which records it counts.
Build the bins in SQL
Spreadsheet and BI tools bin for you, but the bins then live inside one chart. Binning in SQL makes the edges explicit, and the same query can feed any tool. This is the query behind the $250 histogram above, exactly as it ran in BigQuery on 10 November 2026:
-- One row per order: its value is the sum of its lines' net revenue
WITH order_values AS (
SELECT o.order_id, o.status, SUM(p.line_net_revenue) AS order_value
FROM `owox-demo.ecommerce.orders` AS o
JOIN `owox-demo.ecommerce.purchases` AS p USING (order_id)
WHERE o.order_date BETWEEN '2025-01-01' AND '2025-12-31'
GROUP BY o.order_id, o.status
)
SELECT
CAST(FLOOR(order_value / 250) * 250 AS INT64) AS bin_from, -- inclusive
CAST(FLOOR(order_value / 250) * 250 + 250 AS INT64) AS bin_to, -- exclusive
COUNT(*) AS orders
FROM order_values
WHERE status = 'Completed'
GROUP BY bin_from, bin_to
ORDER BY bin_fromIt returns 17 rows, from 2,471 orders at $0–250 down to one order at $4,250–4,500. Look at the last two rows: the $4,000–4,250 bin is missing, because no order fell into it and GROUP BY only returns groups that exist. A charting tool given these rows draws the last bar flush against the one before it, and the gap disappears. If empty bins matter, generate the bins first with GENERATE_ARRAY(0, 4250, 250) and left-join the counts to them.
To redraw the chart at another width, change the three 250s. To compare Returned orders, change the status filter.
Examples and practical applications of bar graphs
Examples and practical applications of bar graphs
Bar graphs are versatile tools for comparing data across categories. The three examples below are illustrative figures, not demo data.
Bar graph representation of customer participation in campaigns
A bar graph can show how many customers took part in each marketing campaign. Each bar represents one campaign’s participants, so the most and least engaging campaigns stand out at once.
| Campaign name | Number of participants |
|---|---|
| Campaign A | 120 |
| Campaign B | 200 |
| Campaign C | 150 |
| Campaign D | 180 |

Campaign B leads with 200 participants and Campaign A trails with 120. Sorted from longest to shortest, the ranking would read without any effort.
Bar graph representation of average sales per hour
A bar graph can show average sales for each hour a store is open. Each bar is one hour’s average, which makes peak and quiet hours obvious for staffing and promotions.
| Hour | Average sales ($) |
|---|---|
| 9 AM | 500 |
| 10 AM | 750 |
| 11 AM | 900 |
| 12 PM | 1,200 |
| 1 PM | 1,100 |

Hours have a natural order, so keep them in sequence here rather than sorting by size. This is still a bar graph and not a histogram: each bar is an average, not a count of records in a range.
Bar graph of monthly sales performance across regions
A grouped bar graph compares two periods across regions in one picture, one pair of bars per region.
| Region | Sales in January ($) | Sales in March ($) |
|---|---|---|
| North | 5,000 | 7,000 |
| South | 4,000 | 4,800 |
| East | 6,000 | 7,000 |
| West | 4,500 | 5,500 |

North grew the most, by $2,000. South grew by $800 and stays lowest.
A bar graph of averages, and what it hides
The demo store’s average order value by channel makes a tidy bar graph. Next to each average is the median, the value of the order in the middle.

| Channel | Orders | Mean order value | Median order value (approximate) |
|---|---|---|---|
| Direct | 2,192 | $520 | $343 |
| Paid Marketing | 1,943 | $432 | $276 |
| Organic/Referral | 1,778 | $529 | $331 |
In every channel the average sits $156 to $198 above the median, because the long tail on the histogram pulls it up. A bar graph of averages is accurate, but read alone it suggests a typical order of about $500 when the typical order is closer to $300. The medians come from BigQuery’s APPROX_QUANTILES, so treat them as approximate. When the bars are averages of skewed data, put the histogram next to them or plot medians.
Real-world uses and applications of histograms
Real-world uses and applications of histograms
Histograms are for seeing the shape of continuous data. The order-value histogram above is the first example; here are two more, with illustrative figures.
Histogram representation of customer order value distribution
This is the demo store’s histogram, in table form, for anyone who wants to redraw it:
| Order value | Completed orders, 2025 |
|---|---|
| $0 to under $250 | 2,471 |
| $250 to under $500 | 1,343 |
| $500 to under $750 | 860 |
| $750 to under $1,000 | 476 |
| $1,000 to under $1,500 | 451 |
| $1,500 to under $2,000 | 199 |
| $2,000 and over | 113 |
The last three rows merge bins to keep the table short. In a chart, unequal bins need bar areas, not heights, proportional to the counts, or the wide bins look too important. Most tools cannot do that, so keep the bins equal on a chart.
Histogram representation of user engagement time on ads
A histogram of how long users watch an ad, in five-second bins, shows where attention drops off.
| Time spent on ad (seconds) | Number of users |
|---|---|
| 0 to under 5 | 100 |
| 5 to under 10 | 75 |
| 10 to under 15 | 50 |
| 15 to under 20 | 25 |
| 20 to under 25 | 40 |
| 25 to under 30 | 30 |
| 30 to under 35 | 20 |
| 35 to under 40 | 15 |
The count falls steadily for 20 seconds and then rises again at 20–25. A second bump like that usually means a second group of viewers, for example people who watch to the end of a 25-second cut. An average watch time would hide it.
Histogram representation of website visitors’ age distribution
Visitors’ ages in five-year bins show which age groups visit a website most.
| Age | Number of visitors |
|---|---|
| 20 to under 25 | 200 |
| 25 to under 30 | 300 |
| 30 to under 35 | 150 |
| 35 to under 40 | 100 |
| 40 to under 45 | 400 |
| 45 to under 50 | 85 |
| 50 to under 55 | 65 |
| 55 to under 60 | 45 |
Two peaks, at 25–30 and 40–45, suggest two audiences. The previous version of this table used bins such as 20–25 and 25–30, which put a 25-year-old in two rows at once; the half-open form fixes that.
Common errors of histograms and bar graphs, and how to avoid them
Common errors of histograms and bar graphs, and how to avoid them
Most of these errors produce a chart that looks finished and misleads.
Confusing histograms and bar graphs
Error: drawing order value bins with gaps, or channels with touching bars, so the reader cannot tell which kind of chart it is.
Solution: a histogram for the distribution of one numeric variable, a bar graph for comparing categories. Let the spacing say which one it is.
Inconsistent or unstated bin sizes in histograms
Error: bins too narrow, too wide, or of mixed widths. Narrow bins create noise; wide ones hide real features, as the $250 bins hid the dip at $200.
Solution: try two or three widths, keep them equal, and print the width on the chart or in its title.
Not starting the y-axis at zero in bar graphs
Error: starting the axis above zero makes small differences look large. The bar’s length is the value, so a cut axis distorts it.
Solution: start bar graphs at zero. If the differences are too small to see from zero, a dot plot or a table may serve better.
Overcrowding bar graphs with too many categories
Error: 30 bars in one chart, most of them too short to read.
Solution: show the top categories sorted by size and group the rest as “Other”, saying how many it contains.
Counting the wrong records
Error: a histogram that includes cancelled, returned or test records, or a bar of averages computed over them.
Solution: filter first, then say in the title what is counted. In the demo store the difference is 1,042 orders in one bar.
Best practices for effective histograms and bar graphs
Best practices for effective histograms and bar graphs
A few habits make both chart types easier to read and harder to misread.
Label axes and intervals clearly
Clear labels, units and titles make charts readable at a glance. Label both axes with units, state the bin width on a histogram, and name the period and the records counted.
Use consistent colours for categories and ranges
Keep one colour per series and use a second colour only to point at something, as the zero-value bin is highlighted above. A rainbow of bars adds a legend and nothing else.
Choose the number of bins deliberately
Too many bins look noisy; too few hide structure. As a starting point, try a width that gives 10 to 30 bins over the range of your data, then compare it with half and double that width.
Emphasise the overall distribution
A histogram is for the shape: where the bulk is, how long the tail is, whether there is more than one peak. Do not label every bar with its count unless the reader needs the exact numbers; give them a table instead.
Tools for creating histograms and bar graphs
Tools for creating histograms and bar graphs
Every common tool draws both charts. What differs is how much control you get over the bins. For more chart types and when each fits, see types of charts and graphs.
Google Sheets
Sheets has a dedicated histogram chart. Google’s help page says to use one “to show the distribution of a data set across different buckets or ranges”, and the chart editor’s Customize tab lets you change the bucket size and the outlier percentile (Google Docs Editors Help, “Histogram charts”). Bar and column charts are separate chart types. The OWOX Data Marts extension for Sheets brings a Data Mart’s report into a sheet and, with Pivots & Charts, generates pivot tables and charts from it that redraw when the report refreshes.
Microsoft Excel
Excel 2016 and later have a histogram chart under Insert > Insert Statistic Chart > Histogram. In Format Axis you can set the bin width, the number of bins, and overflow and underflow bins; by default Excel calculates the bin width with Scott’s normal reference rule (Microsoft Support). It also offers the usual bar and column charts.
Data Studio
Google’s Data Studio (formerly Looker Studio) has a histogram chart. It bins a numeric dimension automatically or with custom bins, lets you adjust the number and size of the bins, and uses a single metric, record count by default. Per Google’s reference, histograms do not support drill-down, an “Others” bin or blended data (Data Studio help, “Histogram reference”).
Tableau
In Tableau, choosing the histogram in Show Me replaces the measure with a bin dimension and changes the aggregation to Count; to change the bin size, right-click the bin in the Data pane and choose Edit (Tableau Help, “Build a Histogram”).
Power BI
In Power BI Desktop, a histogram starts with bins. Right-click a numeric field, choose New group, set a bin size, and a new field with “(bins)” appended appears; put it on a column chart’s axis and count the records (Microsoft Learn, “Use grouping and binning in Power BI Desktop”). Bins work on columns, not on measures. Both chart types end up in the same shared dashboards.
Keep the bins in one place
The three choices above, bin width, bin edges and which records count, live inside the chart in every one of these tools. Two analysts who draw the “same” histogram in Sheets and in Data Studio can end up with different edges and different filters, and nobody notices until the numbers are compared.
OWOX Data Marts moves those choices into SQL. An analyst defines the order-value Data Mart once, in your warehouse, with the status filter and the bin logic written down, and every report built on it, in Google Sheets, Microsoft Excel or Data Studio, reads the same rows. The Net Sales Review dashboard works this way on the demo store’s data model: it reads the Orders and Purchases Data Marts directly and keeps cancelled and returned orders in view instead of mixing them into the totals.
You put order values on a chart and can't tell whether you need a histogram or a bar graph, or which bin width is honest.
Paste this into your AI assistant. It bins your own order values into a histogram, draws orders by channel as a bar graph, and shows how the bin width changes the picture.
The prompt
Read https://www.owox.com/ai-agent-setup.md and follow it to set up OWOX Data Marts for me, starting from /blog/articles/histogram-bar-graph-differences.md. The task: show me how my order values are spread: a histogram of my store's orders at two bin widths, and a bar graph of orders by channel to compare. Tag the links you give me with utm_campaign=ai-task and utm_term=data-foundation. Use what you know about my context and goals
Prefer to start on your own? Get started free
Frequently Asked Questions
Can a histogram display categorical data?
No, histograms are designed for continuous data. For categorical data, use a bar graph, as it helps compare discrete categories with clear gaps between the bars.
What are some real-world examples of histograms and bar graphs?
Histograms are used for analyzing age distributions, test scores, or income ranges. Bar graphs are used for comparing sales by region, customer satisfaction ratings, or product categories.
Are bar graphs and histograms interchangeable?
No, they are not interchangeable. Histograms are for continuous data, while bar graphs are used for categorical data. Using them incorrectly can mislead interpretation of the data.
Why do histograms have no gaps between bars?
Histograms have no gaps because they represent continuous data. The bars are adjacent to show how data falls within specific intervals, emphasizing data distribution.
Can a bar graph be used to show frequency distribution?
A bar graph can show frequency, but it’s better suited for categorical data. For continuous data and frequency distribution, histograms are more appropriate.
Do histograms and bar graphs use the same type of axis?
No. Histograms use continuous data along the x-axis, with no gaps between bars. Bar graphs use discrete categories along the x-axis, with gaps between bars.
When should I use a histogram instead of a bar graph?
Use a histogram for continuous data to show frequency distribution within ranges, whereas bar graphs are best for comparing discrete categories or groups.
