Histogram Maker

Histogram Maker

Paste your data, pick a bin rule, and the histogram draws itself — with the frequency table, mean, standard deviation, quartiles and a normal-curve overlay.

Numbers separated by commas, spaces or line breaks. Up to 500 values.
The overlay is a visual aid, not a normality test.
Try:
BINS · STURGES
6

Approximately symmetric — the bars are roughly balanced on both sides of the centre.

Values (n)
20
Mean
22.50
Sample SD
6.0914
Median
22.50
First quartile (Q1)
17.50
Third quartile (Q3)
27.50
Skewness
0.0000
Bin width
3.5000

CALCULATION

    Histogram

    Six bins, Sturges’ rule. The bars touch because the data are continuous.

    Bin width changes the story: with Scott’s rule the same data give 3 bins instead of 6, and the shape looks much coarser.

    Frequency table

    BinCountRelative frequencyCumulative

    A histogram turns a list of numbers into a picture of their distribution: it splits the range of the data into equal bins and counts how many values fall in each one. Tall bars show where the data pile up; gaps and tails show where they thin out. Paste your data into the tool above, pick a bin rule, and the histogram maker draws the chart, builds the frequency table and reports the mean, standard deviation, quartiles and skewness — with a normal-curve overlay if you want one.

    How to use the histogram maker

    1. Paste your data into the box, one number per line or separated by commas or spaces. The worked example (20 values) is already loaded.
    2. Pick a bin rule: Sturges, Scott or Freedman–Diaconis — or choose Manual and set the number of bins yourself.
    3. Tick “Show normal curve overlay” if you want the bell curve with the same mean and SD drawn over the bars.
    4. Click “Make histogram” (or just edit the data — the chart updates as you type).
    5. Read the results: the number of bins and the shape read at the top, the mean, SD, quartiles and skewness in the tiles, the steps in the calculation list, and the frequency table under the chart.

    When should you use a histogram?

    Use a histogram when you have one continuous variable and want to see its shape before you summarise it with numbers. The NIST handbook puts it plainly: a histogram shows the centre, the spread, the skewness, the presence of outliers and the presence of multiple modes of a univariate data set.

    • Before a test: look at the shape before choosing a test. If the bars are roughly bell-shaped, a t-test or ANOVA is reasonable; if they are skewed or bimodal, consider a Shapiro–Wilk test or a non-parametric alternative.
    • To find the centre and spread: the mean and standard deviation describe a symmetric pile; the median and quartiles describe a skewed one. The histogram tells you which pair to quote.
    • To spot outliers and gaps: a lone bar far from the rest is worth investigating before it drags the mean around.
    • To check for two groups hiding in one variable: two humps usually mean two populations mixed together, and one mean would describe neither.
    • Not for categories: a histogram is for numbers on a continuous scale. For counts of categories (colours, departments, yes/no), use a bar chart — see below.

    How many bins should I use? Sturges vs Scott vs Freedman–Diaconis

    There is no single right number of bins — and that is the point. The three rules on this page answer the question three different ways, and on the same data they disagree:

    RuleBin width hBinsWhat it uses
    Sturges3.50006Sample size n only: k = ceil(log2 n) + 1
    Scott7.85433The spread: h = 3.5s / n1/3
    Freedman–Diaconis7.36813The spread: h = 2 × IQR / n1/3

    The table above is for the worked-example data (20 values, 12 to 33, sample SD 6.0914, IQR 10.0000). Sturges looks only at n = 20 and always returns 6 bins for any 20 values, however spread out they are. Scott and Freedman–Diaconis look at the spread: with a wide spread relative to the range they choose wide bins, and 3 bins is what comes out. Neither is wrong — the 3-bin picture is coarser and hides the dip in the middle, while the 6-bin picture is finer but noisier. Try all three on your own data and watch the story change: that is exactly why the choice of bin width matters, and why you should always say which rule you used.

    Histogram vs bar chart

    They look alike, but they are different plots. In a histogram the bars touch because the data are continuous — there is no gap between 15.5 and 15.5, so there is no gap between the bars. The horizontal axis is a number line, and the height of a bar is a count of values in that interval. In a bar chart the bars are separated because the categories are distinct — “red” and “blue” have nothing between them. If your x-axis is categories, draw a bar chart; if it is a range of numbers, draw a histogram.

    The normal-curve overlay is a visual aid, not a normality test. It draws the bell curve with the same mean and SD as your data over the bars, so you can see at a glance whether the pile is roughly bell-shaped. It does not test anything: a formal check is the Shapiro–Wilk test, and the overlay can look convincing even when the test would disagree.

    If you want the numbers behind the bars as a table — frequencies, relative and cumulative frequencies, midpoints and class boundaries — use the frequency distribution calculator: it builds the same table from the same data.

    Worked examples

    Example 1 — Sturges, 20 values

    The same 20 values are used on this page, on the box plot maker and on the frequency distribution calculator, so you can compare three views of one dataset: 12, 15, 14, 18, 16, 20, 22, 19, 17, 21, 23, 25, 24, 26, 28, 27, 29, 30, 31, 33. The mean is 22.5, the median is 22.5, the sample SD is 6.0914 (population SD 5.9372) and the skewness is 0.0000 — the dataset is deliberately symmetric (the values pair up to sum to 45). Sturges gives k = ceil(log2 20) + 1 = 6 bins. The range is 33 − 12 = 21, so the bin width is 21 / 6 = 3.5 and the edges are 12, 15.5, 19, 22.5, 26, 29.5, 33. The counts are 3, 3, 4, 3, 4, 3 — they sum to 20 — and the shape read is approximately symmetric.

    Example 2 — why the bin rules disagree

    On the same 20 values, Scott’s rule gives h = 3.5 × 6.0914 / 201/3 = 7.8543, so k = ceil(21 / 7.8543) = 3 bins, with edges 12, 19.8543, 27.7087, 33 and counts 7, 8, 5. Freedman–Diaconis gives h = 2 × 10.0000 / 201/3 = 7.3681, so k = ceil(21 / 7.3681) = 3 bins, with edges 12, 19.3681, 26.7361, 33 and counts 7, 7, 6. The two spread-based rules agree with each other (3 bins) and disagree with Sturges (6 bins) because they use the spread and Sturges does not. The 3-bin chart looks like a single smooth hump; the 6-bin chart shows the dip in the middle. Both are the same data.

    Example 3 — 1 to 10, and the error cases

    With the ten values 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, Sturges gives k = ceil(log2 10) + 1 = 5 bins, each of width 1.8, with two values in every bin. A single value on its own is not a dataset — the calculator asks for at least 2 numbers. And if every value is identical, there is no spread to bin: the calculator says so instead of drawing a blank chart.

    Frequently asked questions

    How many bins should I use?

    Start with Sturges (the default) and then try Scott and Freedman–Diaconis. If the rules disagree, say which one you used — the number of bins changes the picture, and a reader who does not know your rule cannot reproduce your chart. For most small datasets Sturges’ 5–8 bins is a sensible starting point; for large datasets the spread-based rules usually do better.

    Histogram vs bar chart?

    A histogram is for continuous numbers: the bars touch, the x-axis is a number line and the height is a count in an interval. A bar chart is for categories: the bars are separated and the height is a count of a category. If your x-axis has gaps between the values, it is a bar chart.

    Source: the NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.3.14. Histogram — a histogram shows the centre, spread, skewness, outliers and multiple modes of a univariate data set. All examples on this page were recomputed with Python (scipy.stats), last updated 19 November 2026.

    See all 91 free statistics tools on Empirical Rule Calculators.