Skip to content
Statculator
Charts & Graphs

Histogram Maker

Free histogram maker: paste data or a frequency table, pick bins by Sturges, Scott or Freedman–Diaconis, show frequency or percent and download PNG or SVG.

Free, no sign-up Runs in your browserBy Hira Noor, BS MathematicsUpdated

Try
Start from
30 values

Separate values with commas, spaces or new lines. You can paste a column from Excel or Google Sheets.

Bins

Automatic applies the bin rule below and rounds the width to a tidy value.

Sturges suits most samples under 200 values. Freedman–Diaconis copes best with skewed data and outliers.

Bar height shows

Draws the normal distribution with the same mean and standard deviation, scaled to the bars, to check normality by eye.

Results

Histogram with 6 bins0246810Frequency40 to 50: 1150 to 60: 2260 to 70: 7770 to 80: 101080 to 90: 7790 to 100: 33405060708090100
Bins include their left edge and exclude their right edge, except the last bin, which includes both.
Number of bins
6
Bin width
10
Modal class
[70, 80)
10 values (33.33%)
Count, n
30
Minimum
47
Maximum
98
Range
51
Mean
74.3
Median
74.5
Standard deviation, s
11.6742
Interquartile range, IQR
15.25
Sample skewness
-0.1751
Outliers (1.5 × IQR rule)
None
Bin rule used
Sturges’ rule
Bins cover
40 to 100

Interpretation: The tallest bar is [70, 80) with 10 of 30 values. The sample skewness is -0.18, so the distribution is roughly symmetric.

Frequency distribution

ClassMidpointFrequency, fRelative fCumulative f
[40, 50)4510.03331
[50, 60)5520.06673
[60, 70)6570.233310
[70, 80)75100.333320
[80, 90)8570.233327
[90, 100]9530.130
Total301

A class [a, b) contains values with a ≤ x < b. The last class is closed on both ends so the maximum is counted.

Bins suggested by each rule

RuleFormulaRaw bin widthSuggested bins
Sturges’ rulek = ⌈log₂ n⌉ + 18.56
Square-root rulek = ⌈√n⌉8.56
Rice rulek = ⌈2 · n^(1/3)⌉7.28577
Scott’s rulew = 3.49 · s · n^(−1/3)13.11234
Freedman–Diaconis rulew = 2 · IQR · n^(−1/3)9.81586

Suggested bins = ⌈range ÷ raw width⌉. Automatic mode rounds the chosen rule’s width to a tidy value, so the final count can differ by one or two.

Step-by-step solution

  1. 1

    Sort the data and find the range

    n = 30
    min = 47, max = 98
    range = 98 − 47 = 51
  2. 2

    Suggest a number of bins with Sturges’ rule

    k = ⌈log₂ n⌉ + 1 = ⌈log₂ 30⌉ + 1 = ⌈4.9069⌉ + 1 = 6
  3. 3

    Round the bin width to a tidy value

    Tidy widths are 1, 2, 2.5 or 5 times a power of ten; the closest one is used. Because the data are whole numbers, only whole-number widths are allowed.

    raw width = range / k = 51 / 6 = 8.5
    tidy width w = 10
  4. 4

    Start at a multiple of the width and count the bins

    start = ⌊47 / 10⌋ × 10 = 40
    bins needed = ⌈(98 − 40) / 10⌉ = 6
  5. 5

    Count the values in each bin

    A value on a boundary goes into the bin on its right, except the maximum, which stays in the last bin.

    [40, 50): 1
    [50, 60): 2
    [60, 70): 7
    [70, 80): 10
    [80, 90): 7
    [90, 100]: 3
  6. 6

    Use the counts as bar heights

    Bar heights are the raw counts. Relative frequency would divide each count by n.

    Heights sum to n = 30
  7. 7

    Draw adjacent bars

    Each bar spans its class on the x-axis with no gaps between bars, because the classes are consecutive intervals of a numeric variable.

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

  1. 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.
  2. 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.
  3. 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.
  4. Add a Chart title, X-axis label and Y-axis label, then use the PNG or SVG button under the chart to download it.
  5. 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:

RuleFormulaBest for
Sturges’ rulek = ⌈log₂ n⌉ + 1Roughly normal samples of up to about 200 values; the default in many textbooks
Square-root rulek = ⌈√n⌉A quick, easy-to-remember choice for small and medium samples
Rice rulek = ⌈2 · n^(1/3)⌉Larger samples, where Sturges gives too few bins
Scott’s rulew = 3.49 · s · n^(−1/3)Data close to a normal distribution
Freedman–Diaconis rulew = 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.

Sturges’ rule
k = ⌈log₂ n⌉ + 1
Square-root rule
k = ⌈√n⌉
Rice rule
k = ⌈2 · n^(1/3)⌉
Scott’s rule (bin width)
w = 3.49 · s · n^(−1/3)
Freedman–Diaconis rule (bin width)
w = 2 · IQR · n^(−1/3)
Bin width from a number of bins
w = (max − min) / k
Bins needed for a given width and start
k = ⌈(max − start) / w⌉
Relative frequency and percent
relative fᵢ = fᵢ / n percent = 100 × fᵢ / n
Formula symbols
SymbolMeaning
nnumber of data values
knumber of bins (classes)
wbin width, the same for every bin
ssample standard deviation
IQRinterquartile 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.

  1. 01Range: 98 − 47 = 51.
  2. 02Sturges’ rule: k = ⌈log₂ 30⌉ + 1 = ⌈4.9069⌉ + 1 = 6 bins.
  3. 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.
  4. 04Counts: [40, 50) 1, [50, 60) 2, [60, 70) 7, [70, 80) 10, [80, 90) 7, [90, 100] 3, which sum to 30.
  5. 05Relative frequencies: 0.0333, 0.0667, 0.2333, 0.3333, 0.2333 and 0.1; cumulative counts 1, 3, 10, 20, 27, 30.
  6. 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:

ShapeWhat you seeTypical example
Symmetric, bell-shapedOne central peak with tails of similar lengthHeights, measurement error, many test scores
Right-skewedPeak on the left, long tail to the right; mean > medianIncomes, waiting times, house prices
Left-skewedPeak on the right, long tail to the left; mean < medianScores on an easy test, age at retirement
BimodalTwo separate peaksTwo groups mixed together, such as two shifts or two species
UniformBars of roughly equal heightRandom 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?

There is no single correct number. Sturges’ rule, k = ⌈log₂ n⌉ + 1, gives 6 bins for 30 values and 8 bins for 100, and works well for moderate, roughly symmetric samples. Larger or skewed datasets usually look better with more bins from the Rice or Freedman–Diaconis rule; aim for enough bins to show the shape without many empty gaps.

What is the Freedman–Diaconis rule?

The Freedman–Diaconis rule sets the bin width to w = 2 × IQR × n^(−1/3), where IQR is the interquartile range and n the number of values. Because the IQR ignores the most extreme quarter of the data at each end, the rule is robust to outliers and skew, and it is often preferred for large or skewed samples.

Can I make a histogram from a frequency table?

Yes. Choose Frequency table and enter each class’s lower limit, upper limit and frequency. Classes with gaps, such as 40–49 and 50–59, are drawn between class boundaries (39.5 to 49.5 and so on) so the bars touch, and unequal class widths are drawn as frequency density.

What is the difference between frequency, relative frequency and percent histograms?

A frequency histogram shows the count of values in each bin. A relative frequency histogram divides each count by the total n, so the bar heights add up to 1, and a percent histogram multiplies those proportions by 100. The bars have the same shape in all three; only the y-axis scale changes, which makes relative versions useful for comparing samples of different sizes.

Which bin does a value on a boundary go into?

In this histogram maker a boundary value goes into the bin on its right, because bins include their left edge and exclude their right edge, written [a, b). The one exception is the maximum, which is counted in the last bin so no value is lost. Other software, including Excel’s built-in histogram, sometimes uses the opposite convention.

How do I choose the bin width for a histogram?

Pick a width that is easy to read, such as 1, 2, 5 or 10 units, and that splits the range into roughly 5 to 15 bins. Dividing the range by the number of bins you want, then rounding to a tidy value, is the quickest method. Choose Bin width above to set it exactly, and optionally fix the first bin’s starting value.

Why do the bars in a histogram touch?

The bars touch because each bin is a consecutive interval of one numeric scale, so one bin ends exactly where the next begins. Gaps would suggest missing ranges of values. A gap that does appear in a histogram is an empty bin, meaning no data fell in that interval.

Can a histogram show whether my data are normally distributed?

A histogram gives a quick visual check: normal data form a single, symmetric, bell-shaped mound. It cannot prove normality, and small samples often look irregular even when drawn from a normal population. Tick Overlay a normal curve to compare the bars with a bell curve of the same mean and standard deviation, check the skewness value and, for a formal check, use a normal probability plot or normality test.

Cite this page

Statculator. (2026, November 14). Histogram Maker. Retrieved November 14, 2026, from https://statculator.com/charts/histogram-maker/