Histogram: How to Make One, Choose Bins and Read the Shape

Published:

Open the Histogram Tool (opens in a new tab)

What is a histogram?

A histogram divides measured data into several intervals and shows the number of data points in each interval as the height of a bar. It lets you see at a glance where the data are concentrated and how widely they are spread (the distribution).

The intervals into which the data are divided are called “bins,” and the number of data points in each bin is called the “frequency.” A table that collects the frequency of each bin is called a “frequency table.”

What a histogram tells you

  • Location of the center: where the data are concentrated
  • Size of the variation: how widely the data are spread
  • Shape of the distribution: whether it is symmetric or skewed, and how many peaks it has
  • Relation to the specification limits: whether the data stay within the upper and lower specification limits, and whether the center is off

The strength of a histogram is that it shows the “shape,” which cannot be seen from numbers such as the mean and standard deviation alone.

Steps to make one

  1. Collect the data: To see the shape, a guideline is to collect 50 to 100 or more data points
  2. Find the maximum and minimum: Find the range of the whole data (maximum − minimum)
  3. Decide the number of bins: A guideline is the square root of the number of data points n (√n), which is about 10 for 100 points. You can also use Sturges’ rule (1 + log2 n), which gives about 8 for 100 points
  4. Decide the bin width: Divide the range by the number of bins and round to an integer multiple of the measurement unit (the smallest increment of the measured values)
  5. Decide the bin boundaries: Set the first boundary to the minimum minus half the measurement unit. Because no data point falls exactly on a boundary, there is no doubt about which bin it belongs to
  6. Count the frequencies and draw the bars: Count the data points in each bin to make a frequency table, and draw it as a bar chart. Draw the bars without gaps between them

Worked example

The dimension of a part was measured on 100 pieces. The measurement unit is 0.01, the maximum is 10.47, and the minimum is 9.52.

  • Range = 10.47 − 9.52 = 0.95
  • Number of bins = √100 = 10
  • Bin width = 0.95 ÷ 10 = 0.095 → rounded to an integer multiple of the measurement unit 0.01, giving 0.10
  • First boundary = 9.52 − 0.01 ÷ 2 = 9.515

Dividing at intervals of 0.10 from 9.515 and counting the frequencies gives the following table.

BinBin centerFrequency
9.515 to 9.6159.5652
9.615 to 9.7159.6655
9.715 to 9.8159.7659
9.815 to 9.9159.86515
9.915 to 10.0159.96520
10.015 to 10.11510.06519
10.115 to 10.21510.16514
10.215 to 10.31510.2659
10.315 to 10.41510.3655
10.415 to 10.51510.4652
Total100
9.5 10.0 10.5 0 10 20 Dimension Frequency
Histogram of the worked example (100 data points, 10 bins)

A commonly seen shape: highest near the center and spreading almost symmetrically to both sides.

How to read the shape

From the shape of a histogram, you can infer the condition of the process and the data. The typical shapes often used in quality control are as follows.

Bell-shaped
Comb
Skewed
Truncated (cliff)
Plateau
Bimodal (twin-peaked)
Isolated peak
ShapeCharacteristicWhat it may indicate
Bell-shapedHighest near the center and close to symmetricOften seen when the process is stable
CombEvery other bin has a low frequencyThe bin width is not an integer multiple of the measurement unit, or the measurer has a habit in reading the values
SkewedA long tail extends on one side onlyThere is a limit on one side, as with values that cannot go below 0 (amount of impurities, runout, etc.)
Truncated (cliff)Cut off abruptly at one endData after the out-of-specification items were removed (100% screening)
PlateauFrequencies hardly change and spread out flatSeveral distributions with slightly different means are mixed
Bimodal (twin-peaked)Two peaksTwo distributions with different means are mixed (two machines, two kinds of material, etc.)
Isolated peakA small peak far awayOutlying data or data from another process are mixed in, or a measurement error

When a shape other than the bell shape appears, it is a cue to investigate the cause.

Comparing with specification limits

Laying lines for the upper and lower specification limits over a histogram shows the margin relative to the specification limits, any values beyond them, and any off-center position. The process capability index Cpk expresses the capability of the process relative to the specification limits as a number. An example of a histogram with specification lines and how to calculate Cpk are explained in What Is Cpk?

Looking at the data by stratification

When several distributions seem to be mixed, as in a bimodal or plateau shape, split the data by equipment, lot, operator, time of day, and so on (stratify it), and redraw a histogram for each part. If each of the split histograms becomes bell-shaped, you can tell which group’s mean or variation is different.

Points to note when using it

  • The shape is unstable with few data points: With few data points, the shape can change greatly by chance. When judging the shape, collect enough data
  • The choice of bins changes how it looks: With too few bins the shape is not visible, and with too many, the bumps stand out. It is also effective to increase or decrease the number a little from the guideline and check how it looks
  • It does not show changes over time: A histogram has no information on the order in which the data were taken. Check on a control chart whether the process changed partway through

Making one in Excel

In Excel 2016 or later, select the data and choose Insert › Insert Statistic Chart › Histogram. You can change the bin width and the number of bins in Format Axis for the horizontal axis.

If you want to set the bin boundaries yourself and make a frequency table, use the COUNTIFS function. This is an example where the data are in A2 to A101, the lower bin boundaries are in column D, and the upper boundaries are in column E.

What to calculateExample formula
Maximum=MAX(A2:A101)
Minimum=MIN(A2:A101)
Frequency (enter in F2 and copy down)=COUNTIFS($A$2:$A$101,">"&D2,$A$2:$A$101,"<="&E2)

If you shift the boundaries by half the measurement unit, no data point falls on a boundary, so counting with “>” or “<=” gives the same result either way.

Making one with the tool on this site

With the Histogram Tool, just paste in your data and it draws a histogram and also calculates a frequency table and basic statistics (mean, standard deviation, median, etc.). The number of bins is determined automatically by Sturges’ rule, and you can also change the number or width. You can also overlay a normal distribution curve and compare data for up to 5 groups. No registration is required, and it is free to use.

Open the Histogram Tool (opens in a new tab)

All guides