How to make a histogram
Five steps from a list of raw numbers to a correct histogram. Try the bin-width slider to see why step 2 matters most.
Step by step
- Find the range. Subtract the smallest value from the largest. Commute times from 12 to 58 minutes have a range of 46.
- Choose the number of bins. Sturges’ rule: ⌈log₂(n) + 1⌉. For 30 values that’s ⌈4.91 + 1⌉ = 6 bins.
- Work out the bin width and round up to a friendly number: 46 ÷ 6 ≈ 7.7, so use 10. Start the first bin at a round number at or below the minimum, here 10.
- Count how many values fall in each bin (10–20, 20–30…). A value on an edge goes in the upper bin.
- Draw touching bars, with bins on the x-axis and counts (frequency) on the y-axis. Label both axes and add a title.
Or skip the counting: paste the numbers into the histogram maker. It follows exactly these steps and shows the frequency table.
Same data, different bin width
30 commute times in minutes. Drag the bin width and watch the shape change — the data never does.
Width 2 shows mostly noise; 25 squashes everything into two bars. Around 5–10 shows the real story: most people commute 20–35 minutes, with a long tail to the right.
Questions
How do I choose the bin width?
Start with a rule: Sturges’ rule gives ⌈log₂(n) + 1⌉ bins; the square-root rule gives about √n bins. Divide the range by the number of bins and round to a friendly width. Then try a narrower and a wider width to see if the shape holds.
Does a value on a bin edge go in the lower or upper bin?
Convention: each bin includes its lower edge and excludes its upper edge, so 20 goes in 20–30, not 10–20. The last bin also includes the maximum.
How do I make a histogram in Excel?
Excel 2016 and later has Insert → Chart → Histogram. You can also paste your column into ChartCraft’s histogram maker to get the chart plus a frequency table without any setup.