Bin (Histogram Bin) in a Graph

TERM

A value range in a histogram that data points are grouped into.

A bin is one of the equal-width value ranges a histogram uses to group numeric data — for example scores 70–79 or heights 160–165 cm. Each data point is counted into the bin its value falls in, and the height of that bin's bar shows how many values landed there, revealing the shape of the distribution.

Bins are what turn a long list of raw numbers into a picture. A list of 500 delivery times tells you little at a glance; sorted into ten-minute bins, it instantly shows whether most deliveries cluster around 30 minutes, whether there is a long tail of late ones, and whether there are two separate peaks. Bins are also called classes, class intervals or buckets.

How bins work: a worked example

Take these 20 exam scores:

52, 58, 61, 64, 67, 68, 71, 72, 73, 75, 76, 77, 78, 81, 82, 84, 86, 88, 91, 95

Choose bins 10 points wide, starting at 50. Each bin includes its lower edge and excludes its upper edge, so a score of exactly 60 would go in 60–69, not 50–59. Counting the scores into each bin gives:

BinScores in the binCount (frequency)
50–5952, 582
60–6961, 64, 67, 684
70–7971, 72, 73, 75, 76, 77, 787
80–8981, 82, 84, 86, 885
90–9991, 952

The counts add up to 20, one for every score. Drawn as a histogram, the tallest bar sits over 70–79 and the bars fall away on both sides — a roughly symmetric, single-peaked distribution.

036 24752 5060708090100 Exam score (bin width = 10)
Each bar is one bin. Bars touch because the bins are adjacent ranges of a continuous scale.

What type of data can be binned? (Interval, ratio, ordinal)

Histograms and bins are for quantitative data — numbers measured on an interval or ratio scale, where the distance between values is meaningful. Exam scores, temperatures, ages, prices and durations all qualify, especially continuous data. Large-range discrete counts (such as daily website visits) can also be binned.

Measurement levelExampleUse bins / histogram?
RatioWeight, income, time takenYes
IntervalTemperature in °C, calendar yearYes
OrdinalSatisfaction rating 1–5, small / medium / largeNo — use a bar chart of each level
NominalCountry, colour, blood typeNo — use a bar chart or pie chart

Ordinal and nominal data are already grouped into a few named levels, so there is nothing to bin: each level gets its own bar, with gaps between bars, in an ordinary bar chart. See data types explained for the full nominal–ordinal–interval–ratio breakdown and categorical data for the non-numeric side.

How many bins should you use?

There is no single correct number, but these common rules of thumb give a sensible starting point for n data points:

For the 20 exam scores above, the square-root rule suggests about 5 bins and Sturges' rule about 6 — consistent with the 5 bins of width 10 used. In practice, start with a rule, then pick a nearby width that gives round, readable edges (5, 10, 25, 100) and try a couple of alternatives.

Why bin width changes the picture

Bins that are too wide merge everything into a few bars and hide real features such as two separate peaks. Bins that are too narrow leave many bars with zero or one value, so the chart looks jagged and random noise looks like structure. Shifting the starting point of the bins, even without changing their width, can also change the shape. If a pattern appears with one bin width and vanishes with another, treat it with caution.

Common mistakes

Using bins of unequal width without adjusting the bar heights to show density (wide bins then look artificially large); leaving it unclear which bin a boundary value belongs to; drawing gaps between histogram bars, which makes it look like a bar chart of categories; and trying to bin ordinal or nominal data.

How to read binned data

  1. Read the x-axis to learn the bin width and where the bins start.
  2. Find the tallest bar: that bin contains the most common range of values.
  3. Look at the overall shape: symmetric, skewed to one side, or with more than one peak.
  4. Look for isolated bars far from the rest, which may be outliers.
  5. Remember that you can no longer see individual values inside a bin — only how many fell into it.

For more on building and interpreting histograms, see the histogram guide.

Frequently asked questions

In graphs, what is a bin?

A bin is a range of values, such as 70 to 79, that a histogram uses to group data. Each value is counted into the bin it falls in, and the height of the bar above the bin shows how many values it contains.

What data type does a histogram use: interval, ratio or ordinal?

A histogram uses quantitative data measured on an interval or ratio scale, such as temperature, time, weight or test scores. Ordinal and nominal data are already in named groups and should be shown with a bar chart instead.

How many bins should a histogram have?

A common starting point is the square-root rule, about the square root of the number of values, or Sturges' rule, log2 of n rounded up plus 1. For 100 values these give 10 and 8 bins. Then adjust to a round, readable bin width.

Which bin does a value on the boundary go in?

By the usual convention, each bin includes its lower edge and excludes its upper edge, so a value of exactly 60 goes in the 60 to 69 bin. Whatever rule a chart uses, it should be applied consistently.

Do histogram bins have to be the same width?

Equal widths are standard and easiest to read. Unequal widths are possible, but then the bar heights must show density, the count divided by the bin width, or wide bins will look misleadingly large.