Histogram Maker

Make a histogram with automatic bin width, and see exactly which bin count was chosen and why.

Histogram
Chart

What this tool does

A histogram shows how a set of measurements is distributed by grouping values into bins and drawing the count in each. The bin width determines what you see, which is why this tool states the count and width it chose rather than hiding the decision.

Bins your data automatically using Sturges, Freedman-Diaconis or the square-root rule, and names which was used and what it assumes.

Shows the resulting bin count and width on the page, because bin width is the analysis rather than a display setting.

How to use it

  1. Paste your numbers.
  2. Try each binning method and watch the shape change.
  3. Switch to density if your bins are unequal or you are comparing sets of different sizes.
  4. Read the exact count and share for every bin in the table under the chart, rather than guessing them off the bars.
  5. Copy the bin table as CSV if the numbers are going into a report or a spreadsheet.
  6. Export as SVG or PNG.

Why use this chart maker

A histogram shows the shape of a data set, and the bin width decides what you see. Having the bin rule named lets you reason about the result.

Why we built it

We built the histogram maker with three automatic binning methods, including Freedman-Diaconis, and show which bin count was chosen and why. Summarise the data with the standard deviation calculator and the box plot maker.

Who this tool is for

  • Students and analysts looking at a distribution
  • Teachers explaining bins
  • Quality and operations staff

When to use it

  • Statistics coursework.
  • Checking the distribution of measurements.
  • Preparing a data analysis report.
  • Comparing bin rules.

Histogram or bar chart?

This is the distinction that trips everyone up, and it is not about styling.

A histogram shows the distribution of one continuous measurement. A bar chart compares separate categories. The visual difference - bars touching or not - follows from that and is not a design choice.

The difference
HistogramBar chart
DataContinuous measurementsDistinct categories
BarsTouch, because values are continuousSeparated, because categories are discrete
X axisA number lineCategory labels
Reordering barsWould destroy the meaningFine, often helpful
AnswersHow is this spread out?Which category is biggest?

The reordering test is the quickest check. If shuffling the bars would break the chart, it is a histogram.

Bin width is the whole analysis

The same data can look normal, bimodal or flat depending only on bin count. That makes bin width the single most consequential choice, and one that most tools bury.

Too few bins and real structure disappears into a smooth lump. Too many and random variation looks like structure. Neither is more correct - both are the same data.

The three automatic rules
MethodBins fromAssumes
Sturgeslog2(n) + 1Roughly normal data; under-bins skewed sets and large samples
Freedman-Diaconis2 x IQR / cbrt(n)Nothing about shape; robust to outliers
Square rootsqrt(n)Nothing; a rough rule of thumb

Sturges is the traditional default and is fine for small, roughly symmetric data sets. Freedman-Diaconis uses the interquartile range instead of the full spread, so a handful of extreme values does not stretch every bin - which makes it the better choice for skewed or messy data.

Try all three before drawing a conclusion. If the shape is the same under each, it is real. If it changes, the shape was an artefact of the binning.

Frequency and density

Frequency is simply the count in each bin, which is what you want most of the time.

Density is the count divided by the total and by the bin width, so the total area sums to one. Two things make it necessary: comparing distributions of different sample sizes, and any chart with unequal bin widths - where a wide bin naturally catches more values and the raw count misleads.

In exam contexts, frequency density is usually required precisely when bin widths are unequal, for exactly that reason.

What you give it, and what you get back

Input and output of Histogram Maker
ItemDetails
InputNumbers separated by spaces, commas or lines.
RuleSturges, Freedman-Diaconis or square root.
OutputA histogram with bin count and width stated.

Issues you may run into

Common problems with Histogram Maker
What you seeWhy it happensWhat to do
Shape changes with the ruleBin width affects appearance.Try another rule and compare.
Edge labels missingMore than 14 bins.Reduce bins or use a larger chart.
A row is skippedIt does not match the expected format.Check the message listing unreadable lines and fix them.

Assumptions and limitations

Frequently asked questions

What is the difference between a histogram and a bar chart?

A histogram shows the distribution of one continuous measurement, with bars touching because the values are continuous. A bar chart compares separate categories with gaps between bars. If shuffling the bars would break the chart, it is a histogram.

How do you choose bin width?

Use an automatic rule as a starting point, then check whether the shape survives a different rule. If it changes noticeably, the shape was an artefact of the binning rather than a feature of the data.

What is Sturges rule?

Bins = ceil(log2 n) + 1. It is the traditional default and works acceptably for small, roughly symmetric samples. It under-bins skewed data and large samples, because it assumes normality.

What is the Freedman-Diaconis rule?

Bin width = 2 x IQR / cube root of n. Because it uses the interquartile range rather than the full range, a few extreme values cannot stretch every bin - which makes it more reliable than Sturges for skewed or messy data.

What is frequency density?

The count divided by the total and by the bin width, so the total area equals one. It is needed when comparing sets of different sizes, and whenever bin widths are unequal - a wide bin catches more values and the raw count misleads.

What does a skewed histogram mean?

That the data is not symmetric. A long tail to the right is right-skewed, which pulls the mean above the median; a long tail left does the reverse. Comparing mean and median is a quick numerical check on what the shape suggests.