What is a Histogram maker?
A histogram maker turns a list of numbers into a histogram: it splits the range of the data into equal-width bins, counts how many values fall in each bin and draws touching bars whose heights are the counts, proportions or percentages. This free tool picks the bins with one of five rules, including Sturges’, Scott’s and the Freedman–Diaconis rule, also works from a frequency table, and downloads the chart as PNG or SVG.
What the Histogram Maker does
Paste raw data and this tool chooses the bins, counts the values, draws the histogram and builds the matching frequency distribution table with class limits, midpoints, relative frequencies and cumulative counts. Let it pick bins automatically with one of five bin rules, fix the number of bins, or set an exact bin width and starting value. Already have counts? Switch to Frequency table and enter class limits and frequencies instead.
It works as a histogram generator, histogram calculator and histogram chart maker in one: the chart, the numbers behind it and a step-by-step solution appear together, with no sign-up. Overlay a normal curve, pick a bar colour, add a title and axis labels, then download the chart as PNG for a slide or SVG for a report.
Use a histogram for one numeric variable measured on many units: exam scores, waiting times, weights, daily sales. It answers questions a mean cannot, such as whether the data are symmetric, have a long tail, or split into two clusters. For categories such as product names or survey options, use a bar chart instead.
How to use the Histogram Maker
- Choose Raw data and paste or type the numbers into Data values, separated by commas, spaces or line breaks; a column copied from Excel, Google Sheets or a CSV file pastes straight in. To start from counts, choose Frequency table and enter each class’s lower limit, upper limit and frequency.
- Under Bins, keep Automatic and pick a Bin rule (Sturges’ rule is the default), or choose Number of bins or Bin width (with an optional First bin starts at value) to set the classes yourself.
- Pick what the bar heights show: Frequency, Relative frequency or Percent. Tick Show values on bars to print each height, tick Overlay a normal curve to compare the shape with a bell curve, and choose a Bar colour.
- Add a Chart title, X-axis label and Y-axis label, then use the PNG or SVG button under the chart to download it.
- Check the frequency table, the bin-rule comparison and the step-by-step solution to see the bin edges and counts used.
How to choose the number of bins
There is no single correct number of bins. Too few bins hide the shape; too many make the histogram jagged and full of empty gaps. Most textbooks and software use one of these five rules, and this histogram maker shows what each one suggests for your data in the Bins suggested by each rule table:
| Rule | Formula | Best for |
|---|---|---|
| Sturges’ rule | k = ⌈log₂ n⌉ + 1 | Roughly normal samples of up to about 200 values; the default in many textbooks |
| Square-root rule | k = ⌈√n⌉ | A quick, easy-to-remember choice for small and medium samples |
| Rice rule | k = ⌈2 · n^(1/3)⌉ | Larger samples, where Sturges gives too few bins |
| Scott’s rule | w = 3.49 · s · n^(−1/3) | Data close to a normal distribution |
| Freedman–Diaconis rule | w = 2 · IQR · n^(−1/3) | Skewed data or data with outliers, because the IQR ignores extreme values |
Histogram bin formulas
Every histogram needs a number of bins k, a common width w and a starting edge. Count rules (Sturges, square root, Rice) give k, so w = range ÷ k; width rules (Scott, Freedman–Diaconis) give w directly. Automatic mode then rounds w to a tidy value.
| Symbol | Meaning |
|---|---|
| n | number of data values |
| k | number of bins (classes) |
| w | bin width, the same for every bin |
| s | sample standard deviation |
| IQR | interquartile range, Q3 − Q1 |
| fᵢ | count of values in bin i |
| ⌈ ⌉, ⌊ ⌋ | round up, round down |
In automatic mode the raw width is replaced by the closest of 1, 2, 2.5 or 5 times a power of ten, and the first bin starts at the largest multiple of that width not above the minimum. The final number of bins can therefore differ from the rule’s k by one or two.
With whole-number data, automatic mode uses whole-number widths only, and if the maximum lands exactly on a bin edge it gets a bin of its own, so every bin covers the same number of possible values.
Bins are half-open, [a, b): a value equal to a boundary belongs to the bin on its right. The last bin is closed so the maximum is always counted. Excel’s histogram chart and some textbooks use (a, b] instead, which can move boundary values one bin to the left.
Worked example
Worked example: 30 exam scores
Problem. A teacher records 30 final exam scores ranging from 47 to 98 (the default data above). Build a frequency histogram with automatic bins.
- 01Range: 98 − 47 = 51.
- 02Sturges’ rule: k = ⌈log₂ 30⌉ + 1 = ⌈4.9069⌉ + 1 = 6 bins.
- 03Raw width 51 / 6 = 8.5, rounded to the tidy width 10. The first bin starts at ⌊47 / 10⌋ × 10 = 40, and ⌈(98 − 40) / 10⌉ = 6 bins reach the maximum.
- 04Counts: [40, 50) 1, [50, 60) 2, [60, 70) 7, [70, 80) 10, [80, 90) 7, [90, 100] 3, which sum to 30.
- 05Relative frequencies: 0.0333, 0.0667, 0.2333, 0.3333, 0.2333 and 0.1; cumulative counts 1, 3, 10, 20, 27, 30.
- 06Check with the other rules: Scott’s rule gives a raw width of 3.49 × 11.674 × 30^(−1/3) = 13.11 and Freedman–Diaconis gives 2 × 15.25 × 30^(−1/3) = 9.82. Both round to the same tidy width of 10, so every rule draws the same histogram here.
Answer. The histogram peaks in the 70s (10 students, 33.33%) and falls away evenly on both sides. The mean (74.3) and median (74.5) are almost equal and the sample skewness is −0.18, so the scores are roughly symmetric. No score lies outside the 1.5 × IQR fences (44.375 to 105.375), so there are no outliers.
How to make a histogram from a frequency table
If your data are already grouped, choose Frequency table and enter one row per class: the lower limit, the upper limit and the frequency. The tool draws one bar per class, so the bins match your table exactly.
Textbook tables often use integer class limits with gaps, such as 40–49 and 50–59. A histogram’s bars must touch, so the tool converts the limits into class boundaries halfway across each gap (39.5 to 49.5, 49.5 to 59.5 and so on). If the classes have different widths, the bars show frequency density (frequency ÷ width) so that each bar’s area, not its height, matches its frequency. For the mean, median and mode of grouped data, use the grouped data calculator.
Should you exclude outliers from a histogram?
Usually not. A histogram exists to show the whole distribution, and an unusual value is part of it. This tool flags any value outside the 1.5 × IQR fences (the same rule a box plot uses) but always keeps it in the chart.
Remove a value only when you can show it is a mistake, such as a data-entry error (999 among two-digit scores) or a measurement from the wrong population, and say in your report that you removed it. If one extreme value squeezes everything else into a few bars, keep it and switch to the Freedman–Diaconis rule, which bases the bin width on the IQR and is far less stretched by outliers than Sturges’ or Scott’s rule.
How to read the shape of a histogram
Describe a histogram by its center, its spread and its shape. These shape patterns come up most often:
| Shape | What you see | Typical example |
|---|---|---|
| Symmetric, bell-shaped | One central peak with tails of similar length | Heights, measurement error, many test scores |
| Right-skewed | Peak on the left, long tail to the right; mean > median | Incomes, waiting times, house prices |
| Left-skewed | Peak on the right, long tail to the left; mean < median | Scores on an easy test, age at retirement |
| Bimodal | Two separate peaks | Two groups mixed together, such as two shifts or two species |
| Uniform | Bars of roughly equal height | Random digits, a die rolled many times |
Histogram vs bar chart
A histogram’s x-axis is a number line, so the bars touch and their order is fixed by the data. A bar chart’s x-axis lists categories, so the bars are separated and can be reordered. If reordering the bars would not change the meaning, you need a bar chart; if the bars are consecutive intervals, you need a histogram.
For small samples, a dot plot or stem-and-leaf plot shows every value, and a box plot compares several groups side by side more compactly than several histograms.
Common use cases
- Checking assumptions: see whether data are roughly normal before a t-test or a confidence interval.
- Quality control: compare the spread of part measurements with the specification limits.
- Teaching and homework: produce a labelled frequency or relative frequency histogram and frequency table to the bin width, or from the frequency table, a question gives.
- Reporting: show the distribution of customer ages, delivery times or survey scores in a slide or paper, downloaded as PNG or SVG.
- Spotting problems: reveal outliers, data-entry errors (a 999 among two-digit values) or a mix of two groups.
Assumptions and limitations
- The picture depends on the bin width and starting point. Different reasonable choices can make the same data look smoother or bumpier, so compare a couple of bin rules before drawing conclusions.
- Sturges’ rule assumes data close to normal and gives too few bins for large (n > 200) or strongly skewed samples; use the Rice or Freedman–Diaconis rule in that case.
- Histograms need a reasonable amount of data. With fewer than about 20 values, a stem-and-leaf plot keeps every value visible and a box plot summarizes the spread more reliably.
- From raw data, all bins have equal width. Unequal-width classes are supported only in Frequency table mode, where the bars show frequency density.
- In frequency table mode the mean and standard deviation are estimates that treat every value as its class midpoint. For a table of counts by distinct value or by your own class limits, use the Frequency Distribution Calculator.
Frequently asked questions
How many bins should a histogram have?
What is the Freedman–Diaconis rule?
Can I make a histogram from a frequency table?
What is the difference between frequency, relative frequency and percent histograms?
Which bin does a value on a boundary go into?
How do I choose the bin width for a histogram?
Why do the bars in a histogram touch?
Can a histogram show whether my data are normally distributed?
Cite this page
Statculator. (2026, November 14). Histogram Maker. Retrieved November 14, 2026, from https://statculator.com/charts/histogram-maker/