Skip to content
Chart Buffet All you can plot

Distribution

Histogram maker

Bars that count how many values fall into each range, to show the shape of a distribution: where values cluster, how they spread, and whether they lean to one side.

1Your data

Your data never leaves this browser

Tip: copy cells straight from a spreadsheet and press Ctrl+V (⌘V on a Mac). · CSV, TSV, JSON, Excel or ODS

3Style it

Warming up the kitchen…
Data
Titles and text
Title alignment
Look
Look
Colours
Series colours
Marks and labels
Axes and numbers
Size
Download
Format
Resolution

2× is sharp on high-density screens and in print.

Keep a chart as a file to reopen or share later.

What it is

A histogram divides the range of a single numeric measure into equal intervals, called bins, and draws a bar for each whose height is the number of values in that bin. The result is the shape of the data: symmetric or skewed, one peak or two, tight or spread out.

Unlike a bar chart, the x axis is a continuous scale and the bars touch, because the bins cover the range without gaps.

✓ Use it when

  • You have one column of many numbers — exam scores, delivery times, heights — and want to see their distribution.
  • You want to spot skew, outliers, gaps or several groups mixed together.

✗ Avoid it when

  • You have fewer than about twenty values — a dot plot or the sorted numbers are more honest.
  • You want to compare several distributions side by side — box plots do that better.

Tips for a better chart

The maths

With bin width h starting at x0, a value x falls into bin ⌊(x − x0)/h⌋. Chart Buffet uses Sturges’ rule for the number of bins, k = ⌈log2 n⌉ + 1 (Sturges 1926), then rounds the width to a “nice” number.

Other rules adapt to the data’s spread: Scott’s rule h = 3.49 · s · n−1/3 uses the standard deviation (Scott 1979), and the Freedman–Diaconis rule h = 2 · IQR · n−1/3 uses the interquartile range, which is robust to outliers (Freedman & Diaconis 1981).

A little history

Grouping measurements into intervals and drawing their frequencies is old, but the name is Karl Pearson’s. He introduced “histogram” in his statistics lectures of the early 1890s and first used it in print in an 1895 paper on skewed distributions (Pearson 1895).

Herbert Sturges proposed his simple rule for the number of classes in 1926 (Sturges 1926). Later work treated the histogram as an estimate of a probability density and derived bin widths that minimise its error (Scott 1979; Freedman & Diaconis 1981).

Questions

How many bins should a histogram have?

There is no single right answer. Start with the automatic choice, then try a few more or fewer bins with the “Bins” slider and keep the one that shows the shape most clearly.

Histogram or bar chart?

A histogram is for one continuous measure split into ranges; a bar chart compares separate categories.

References

  1. Pearson, K. (1895). Contributions to the mathematical theory of evolution. II. Skew variation in homogeneous material. Philosophical Transactions of the Royal Society A 186, 343–414.
  2. Sturges, H. A. (1926). The choice of a class interval. Journal of the American Statistical Association 21(153), 65–66.
  3. Freedman, D. & Diaconis, P. (1981). On the histogram as a density estimator: L₂ theory. Zeitschrift für Wahrscheinlichkeitstheorie und verwandte Gebiete 57(4), 453–476.
  4. Scott, D. W. (1979). On optimal and data-based histograms. Biometrika 66(3), 605–610.