How to Make a Histogram (and Choose the Right Bins)

Learn how to make and read a histogram: group your numbers into bins, pick a sensible bin width and spot the shape of your data, with a free histogram maker.

Published

Free tool: Histogram Maker

A histogram shows how a set of numbers is distributed: which values are common, which are rare, and whether the data bunch up in the middle, lean to one side or split into groups. It does this by sorting the values into ranges, called bins, and drawing a bar for each one. This guide explains how bins work, how to choose them and how to read the result, using the free Histogram Maker.

When to use a histogram

Use a histogram when you have one set of numeric measurements and want to see its shape, for example:

  • test or exam scores
  • delivery or waiting times
  • heights, weights or ages
  • order values or daily sales
  • website loading times

If instead you're comparing separate categories, such as sales by region, you need a bar graph.

Worked example: 40 test scores

Here are the scores of 40 students on a test (this is also the sample data the Histogram Maker opens with):

52, 58, 61, 63, 65, 66, 68, 69, 70, 71, 72, 72, 73, 74, 75, 75, 76, 77, 78, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98

A list like this is hard to take in. Grouping the scores into bins 10 points wide gives a frequency table:

Score rangeStudentsShare
50–6025.0%
60–70615.0%
70–801332.5%
80–901025.0%
90–100922.5%

The histogram draws one bar per row. Now the picture is clear: most students scored between 70 and 90, and only two scored below 60. The mean is 79.08 and the median 78.5.

Each bin includes its lower edge but not its upper one, so a score of exactly 70 counts in 70–80, not 60–70. The last bin also includes its upper edge, so a perfect 100 would still be counted.

How to choose the bins

The bin width changes the picture more than anything else. With the same 40 scores:

Bin widthBinsStudents per bin
2032, 19, 19
1052, 6, 13, 10, 9
5101, 1, 2, 4, 6, 7, 5, 5, 5, 4
  • Too few bins hide the shape. With bins 20 points wide, almost everyone lands in two bars and the peak in the 70s disappears.
  • Too many bins make noise. With bins 5 points wide, each bar holds only a handful of students, and small random bumps look like patterns.
  • In between usually works best. Bins 10 points wide show the shape clearly.

Two rules of thumb help you start:

  • Sturges' rule: use about log₂(n) + 1 bins, where n is the number of values. For 40 values that's about 6.3, so roughly 6 to 7 bins.
  • Square-root rule: use about √n bins, which also gives about 6 bins for 40 values.

Rounded bin widths, such as 5, 10 or 25, make the chart easier to read than exact ones like 7.67. The Histogram Maker's automatic setting applies Sturges' rule and then rounds the width to a tidy number: for the test scores it suggests a width of 10, giving the 5 bins above. Always try a couple of widths before settling on one.

How to read the shape

  • Symmetric (bell-shaped): most values in the middle, tailing off evenly on both sides. Heights and many measurement errors look like this.
  • Skewed right: a long tail of high values, such as incomes, house prices or delivery times. The mean is pulled above the median.
  • Skewed left: a long tail of low values, such as scores on an easy test.
  • Two peaks (bimodal): often a sign that two groups are mixed together, such as weekday and weekend sales.
  • Gaps and isolated bars: possible outliers or data-entry mistakes worth checking.

How to make a histogram with Graph Maker

  1. Open the Histogram Maker.
  2. Enter your numbers in Data Values, separated by commas, spaces or new lines. You can paste a column straight from a spreadsheet.
  3. Choose the bins: Automatic (Sturges' rule), Set the number of bins or Set the bin width. With a set width, the bins start at a multiple of it, so a width of 10 gives edges at 50, 60, 70 and so on.
  4. Choose what the y-axis shows: Count (frequency) or Percent of values. Percent is handy when you compare data sets of different sizes.
  5. Add a title and axis titles, such as "Test Score Distribution", "Score" and "Number of students".
  6. Pick the colors for the bars, background, title and text.
  7. Check the tables below the chart. One gives the summary statistics, including the mean, median and standard deviation; the other lists each bin with its count and percentage.
  8. Download the histogram as a PNG, JPG or SVG.

Histogram vs box plot

Both show a distribution. A histogram shows the full shape, including multiple peaks; a box plot squeezes the data into five numbers, which makes it better for comparing several groups side by side. When you have one set of data and want to understand it, start with a histogram.

Frequently asked questions

How many bins should a histogram have?

Enough to show the shape without turning into noise: often 5 to 20, depending on how many values you have. Start with Sturges' rule (about log₂(n) + 1) and adjust until the chart is clear.

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

A histogram's bars stand for ranges of one numeric variable, so they touch and stay in numerical order. A bar graph's bars stand for separate categories, so they have gaps and can be sorted any way you like.

Should I show counts or percentages?

Counts are the simplest for a single data set. Percentages are better when you compare data sets of different sizes, such as two classes with different numbers of students.

Share this post :