How this instrument works
A histogram splits a data set's range into equal-width classes and draws one bar per class, with the bar's height showing how many values fall inside it — a quick visual read on where a data set is concentrated, how spread out it is, and whether it leans toward one side. Unlike a bar chart of categorical data, a histogram's bars sit side by side with no gaps, because the classes represent continuous, adjoining ranges of a single numeric variable rather than separate unrelated categories.
The classes are equal-width by default, calculated directly from the data: width = (maximum − minimum) / number of classes. Each bar spans one class, starting at the data's minimum, with the final bar's class including the maximum value itself so nothing in the data set is left uncounted. This calculator returns exactly the two numbers a histogram needs per bar — its edges and its height (count) — leaving the actual drawing to you or your charting tool.
This is the same equal-width binning as this site's frequency-distribution and frequency-polygon instruments; all three group the data identically and differ only in how the result is presented. Frequency-distribution reports it as a plain interval table, frequency-polygon reports each class's midpoint for a connected-line chart, and histogram reports it framed as bar edges and heights — the form you need if you're sketching or coding an actual bar-chart histogram.
- Enter your raw numbers into Data set (bars) — any order, separated by commas, spaces or new lines.
- Set Number of classes to how many bars you want the range split into.
- Read Class width to see how wide each bar turns out to be, calculated automatically from your data's range.
- Read Frequency table (class: count) for every bar's edges paired with its height — draw one bar per row, side by side with no gaps.
- Need the same grouping as a plain table or as connected midpoints instead? This site's frequency-distribution and frequency-polygon instruments use this identical binning.
Worked example — eight quiz scores, 7 bars
Eight students score 2, 4, 4, 4, 5, 5, 7, and 9 on a quiz. Enter those eight values into Data set (bars) and set Number of classes to 7. Class width comes out to (9−2)/7 = 1 exactly, giving seven bars each exactly one unit wide, starting at the minimum score of 2.
Frequency table (class: count) reads '2.00 to 3.00: 1 | 3.00 to 4.00: 0 | 4.00 to 5.00: 3 | 5.00 to 6.00: 2 | 6.00 to 7.00: 0 | 7.00 to 8.00: 1 | 8.00 to 9.00: 1'. Sketched as bars, the tallest bar sits over 4-to-5 at a height of 3 (catching the three students who scored exactly 4), with two empty bars at 3-to-4 and 6-to-7 showing the gaps in this particular score distribution. The seven counts sum to 1+0+3+2+0+1+1 = 8, matching all eight students.
Questions
How is a histogram different from a bar chart?
A bar chart displays separate, independent categories — colors, product names, survey answers — with gaps between bars because there's no numeric relationship between neighboring categories. A histogram instead displays one continuous numeric variable split into adjoining ranges, so its bars sit flush against each other with no gaps, reflecting that each bar's range picks up exactly where the previous one left off. Mixing the two up is a common source of confusion when people first learn to read histograms.
How is this different from this site's frequency-distribution or frequency-polygon calculators?
All three group your data into the exact same equal-width classes using the same underlying calculation. Histogram frames the result as bars — each class's edges plus its height, ready to sketch as a bar chart. Frequency-distribution reports the identical counts as a plain interval table. Frequency-polygon reports each class's midpoint instead of its edges, for a connected-line chart. The binning math is shared across all three; only the presentation changes to match what you're building.
How do I choose the number of classes (bars) for a histogram?
There's no single correct answer, but 5 to 20 classes is a commonly used working range, depending on how much data you have — too few bars flattens real structure in the data into one or two blocks, while too many bars spreads a modest data set so thin that many bars end up empty or holding just one value. Trying two or three different class counts and comparing the resulting shapes is a reasonable way to settle on one that reveals the pattern you're looking for.
Why do all the bars have to be the same width?
Equal-width bars are the standard histogram convention because they make bar height a direct, honest stand-in for frequency — a taller bar always means more values, full stop. Unequal-width bars require adjusting each bar's height by its width to keep the chart's area proportional to frequency, which is a more advanced technique reserved for specific cases (like data with a long tail); this calculator always splits the range into equal-width classes.
What does an empty bar (a count of zero) mean?
It simply means no entered value fell inside that particular class's range — a real and meaningful result, not an error. In the worked example above, the bars from 3 to 4 and from 6 to 7 are both empty, which correctly reflects that none of the eight quiz scores happened to land in either of those one-point ranges.