Scientific FigureScientific Figure
Online histogram maker

Histogram Maker & Histogram Builder

This histogram maker draws frequency, relative frequency, density and cumulative histograms from raw measurements, a spreadsheet column or a frequency table, for lab reports, statistics classes and journal figures. Every bin edge and count is computed by code before a bar is drawn.

Histogram styles

Five journal presets of the histogram maker, each drawn from a different sample: yeast cell diameters, seed mass, mitochondrial length, age at diagnosis and reaction times. Click a card to apply the style, or load its measurements into the composer.

Nature

Flat bars with thin outlines in the Nature preset; the histogram maker binned these 60 yeast cell diameters by Sturges' rule.

Science

Grayscale for Science, with the bin count fixed at eight because the prompt to the histogram maker says “8 bins”.

Cell Press

Cell Press on a density scale, where the histogram maker puts the normal curve in the same units as the bars.

Clinical grayscale

A stated bin width of 5 years sets the histogram maker's edges here, in clinical grayscale with a y axis titled Patients.

Dark slide

For talks, a dark slide; Freedman–Diaconis bins in the histogram maker keep the two reaction-time peaks apart.

Histogram examples

Four histogram examples, each rendered from the prompt and data on its card: 60 resting heart rates binned by Sturges' rule, finch beak depths before and after a drought overlaid as relative frequency, regression residuals on a density scale with a normal curve, and exam scores counted cumulatively in bins of 10. Click one to load it into the histogram maker.

Frequency, one sample

For these 60 heart rates the histogram maker chose 5 bpm bins by Sturges' rule.

Two samples overlaid

Given two samples, the histogram maker puts both on the same 0.5 mm bin edges, so the shift in beak depth reads bar by bar.

Density with normal curve

Asked for a density scale, the histogram maker makes the bars' total area 1, so a normal curve fits over them.

Cumulative frequency

Ask the histogram maker for “cumulative” and each bar adds the bins before it, so the last bar equals n.

What is a histogram?

A histogram shows how one continuous variable is distributed: its range is cut into adjacent bins, and the area of each bar stands for the number of observations in that bin. The bars touch because the bins cover an unbroken number line, which is what separates a histogram from a bar graph of separate categories.

About this histogram maker

  • Type or paste raw values into the histogram maker (Diameter (µm): 5.3, 4.9, 5.0…), or attach as many as three spreadsheets (CSV, TSV or Excel) with one sample per column.
  • The histogram maker treats a two-column table of bin ranges and counts (10–15, 4) as data already grouped and draws it as given, with class limits such as 50–59 joined at the boundaries 49.5 and 59.5.
  • The histogram maker defaults to Sturges' rule with round edges; a stated bin width, bin count, Freedman–Diaconis or Scott's rule overrides it, and whole numbers over a short range get one bar per value.
  • In the histogram maker each bin holds its left edge and not its right, except the last bin, which holds both, so a value on an edge is counted once and in a predictable place.
  • The histogram maker recounts the bins from your values on every regeneration, so switching the journal preset or the colours never moves a bar.

Histogram vs bar graph vs frequency polygon

A histogram bins one continuous measurement to show its distribution; a bar graph gives one value to each of several separate categories. Read the x axis to tell them apart: a numeric scale means a histogram, group names mean a bar graph. A frequency polygon carries the same counts as a histogram, drawn as points at the class midpoints joined by lines.

HistogramBar graphFrequency polygon
X axisA number line divided into binsCategory names in any orderClass midpoints on a number line
Bar heightObservations in the bin, or their densityA mean, count or percentage per categoryNo bars: a point at each class frequency, joined by lines
Space between barsNone, neighbouring bins share an edgeEqual gaps between categoriesNo bars; the line drops to zero one class beyond each end
Can the order change?No, bins follow the number lineYes, by size or by nameNo, points follow the number line
AnswersWhich values are common, and how spread out?Which category is largest?How do two distributions compare on one axis?

To compare one measurement across groups, give the histogram maker one line per group and it draws each full shape on shared bins; past three groups a box plot makes the same comparison more compactly.

Types of histogram the histogram maker draws

Six histograms researchers and students ask for, what each one puts on the y axis, and what to write so the histogram generator draws it.

Frequency histogram

Bar height is the count in the bin, and the heights add up to n. The histogram maker's default. Use it for one sample when readers care about how many observations there are, such as 60 resting heart rates or 200 particle diameters.

Relative frequency histogram

Bar height is the count divided by n, so the bars add up to 1 (or to 100% when you ask for percent). Ask the histogram maker for “relative frequency”. Use it when samples of different sizes share an axis; the shape matches the frequency version.

Density histogram with a normal curve

Bar height is the count divided by n times the bin width, so the total area is 1 and a normal curve with the sample's mean and SD sits on the same scale. The histogram maker draws it when the prompt says “density histogram with a normal curve”. This is the usual check before a t-test or ANOVA, and of regression residuals.

Overlaid histograms for two samples

Two or three samples on the same bin edges, each a semi-transparent fill so the overlap shows. Give the histogram maker each sample on its own line (Before drought: …, After drought: …). Four to six samples, or the word “panels”, put each in its own panel on a shared x axis; “stacked” stacks them.

Cumulative frequency histogram

Each bar is the running total up to the end of its bin, so the last bar equals n. Type “cumulative” into the histogram maker. It answers questions such as how many students scored below 70, and the percentile of a value can be read straight off it.

Histogram from grouped data

The histogram maker draws counts that are already binned (40–49: 3, 50–59: 8…) as given, never re-binned. Class limits are joined at their boundaries (49.5, 59.5…) so the bars touch, and classes of unequal width switch the heights to frequency density so each area stays true to its count.

How to make a histogram with this histogram maker

1

Paste measurements into the histogram maker

Type one sample per line, Reaction time (ms): 276, 402, 294…, or attach the spreadsheet column. Two lines make two samples on shared bins; a frequency table of classes with counts is drawn as given.

2

Say how to bin and scale it

Leave the histogram maker on Sturges' rule or name a width or a count. Ask for relative frequency, percent, density, a normal curve or a cumulative count, and give the axis titles.

3

Generate and check the counts

The histogram maker draws from the computed edges and counts. Compare a bar or two with your own tally, keep editing in chat, and export to PNG, SVG or PPTX.

Make a histogram from a frequency table

Statistics courses usually hand over data already grouped: a frequency distribution table of class limits and counts. Here is one for 40 bean seedlings, measured to the nearest centimetre, with every column a textbook asks for. The buttons under the figure load it into the histogram maker.

Class (cm)BoundariesMidpointFrequencyRelative frequencyCumulative
10–149.5–14.51230.0753
15–1914.5–19.51770.17510
20–2419.5–24.522120.30022
25–2924.5–29.527100.25032
30–3429.5–34.53260.15038
35–3934.5–39.53720.05040
Total401.000
  1. 1

    Class width is the step between lower limits

    15 − 10 = 5, not 14 − 10 = 4. Limits such as 10–14 leave a one-unit gap because each height was rounded to a whole centimetre; typed as 10–14, 15–19…, the histogram maker reads both the gap and the width of 5.

  2. 2

    Boundaries close the gaps

    Each boundary sits halfway across a gap: 14.5 between 14 and 15. Bars run from boundary to boundary, 9.5 to 14.5, which is why they touch. Type class limits and the histogram maker places the boundaries itself.

  3. 3

    Midpoints stand for each class

    (10 + 14) ÷ 2 = 12. A frequency polygon puts its points at the midpoints, and the mean of grouped data uses them: Σ(frequency × midpoint) ÷ n = 955 ÷ 40 = 23.875 cm. The histogram maker labels the x axis at the boundaries instead, where the bars meet.

  4. 4

    Relative frequency divides by n

    Write “relative frequency” and the histogram maker divides each count by n: 12 ÷ 40 = 0.300. The column sums to 1 and the shape matches the frequency histogram; only the y-axis numbers change, as in the beak-depth example.

  5. 5

    Cumulative frequency finds the median class

    The running total first reaches 20, half of 40, in the 20–24 class, so that class holds the median. Write “cumulative” and the histogram maker draws this column as its bars, as in the exam-score example.

Frequency histogram of 40 bean seedling heights from a grouped frequency table, bars spanning class boundaries 9.5 to 39.5 cm with a dashed frequency polygon through the midpoints.0369129.514.519.524.529.534.539.5Seedling height (cm)FrequencyFrequency polygon
Figure 1. The seedling table as a frequency histogram, bars spanning the boundaries 9.5 to 39.5 that the histogram maker places from the class limits; the dashed line through the midpoints is the same table as a frequency polygon.

Paste your own table in the same shape, one class and its count per item, and the histogram maker joins the limits at their boundaries. Unequal classes switch to frequency density, so each bar's area stays true to its count.

How many bins? Sturges, Freedman–Diaconis and the bin width

The bin width decides what shape a histogram shows: too few bins hide a second peak, too many turn the bars into noise. A rule makes the choice reproducible, and the figure legend should state the width that was used.

  • Sturges: k = ⌈log₂ n⌉ + 1
  • Freedman–Diaconis: h = 2 × IQR × n^(−1/3)
  • Density: height = count ÷ (n × h)

In words

Sturges' rule sets the number of bins from the sample size alone: 7 for 50 observations, 8 for 100, 11 for 1,000. The Freedman–Diaconis rule sets the bin width from the interquartile range instead, which keeps a few extreme values from stretching every bin. A density histogram divides each count by n times the bin width, so the total area of the bars is 1 and a probability curve can be drawn over them.

Sturges' rule, rounded to a width of 1, 2, 2.5 or 5 times a power of ten, is the histogram maker's default. Write “bin width 5”, “12 bins”, “FD bins” or “Scott's rule” to change it, and “starting at 40” to move the first edge.

One sample, three bin widths

The same 60 fruit-fly wing lengths, males and females mixed, binned three ways. Only the middle histogram shows two groups. Each button loads that width into the histogram maker.

Bin width 0.25 mm · 3 bars. One broad hump. Most males and most females share the middle bin, so “bin width 0.25” in the histogram maker makes the sample look unimodal.1.82.02.22.4Wing length (mm)
Bin width 0.25 mm · 3 barsOne broad hump. Most males and most females share the middle bin, so “bin width 0.25” in the histogram maker makes the sample look unimodal.
Bin width 0.05 mm · 11 bars. Two peaks, near 2.0 and 2.2 mm, with an empty bin between them. The histogram maker's default, Sturges' rule, picks 0.1 here and also keeps them apart.1.82.02.22.4Wing length (mm)
Bin width 0.05 mm · 11 barsTwo peaks, near 2.0 and 2.2 mm, with an empty bin between them. The histogram maker's default, Sturges' rule, picks 0.1 here and also keeps them apart.
Bin width 0.02 mm · 27 bars. Spikes and gaps, most bins holding 0 to 6 flies. The histogram maker stops at 30 bars and widens any narrower request.1.82.02.22.4Wing length (mm)
Bin width 0.02 mm · 27 barsSpikes and gaps, most bins holding 0 to 6 flies. The histogram maker stops at 30 bars and widens any narrower request.

When a shape changes with the bin width, split the sample by group if you can. The histogram maker overlays up to three samples on shared bins, and males and females then show two peaks at any reasonable width.

Reading the shape of a histogram

**A histogram is read for its center, spread, skewness, number of peaks and outliers, the features that point to the right model for the data.** Bin width changes what you see, so check a shape at a second width before reporting it.

ShapeWhat the bars doWhat it often meansWhat to check
Symmetric, one peakTallest in the middle, falling off evenly on both sidesClose to a normal distributionA normal probability plot before a t-test
Right-skewedA long tail of short bars to the right of the peakValues bounded at zero: sizes, times, concentrationsReport the median; try log-scale bins
Left-skewedThe long tail runs to the leftA ceiling, such as exam scores near 100%Median and IQR in the legend
BimodalTwo separate peaksTwo populations mixed in one sampleSplit by group and overlay the two
UniformBars of roughly equal heightNo preferred value, or bins too wideAsk the histogram maker for a narrower bin width
Outliers or gapsIsolated bars far from the rest, empty bins betweenMeasurement errors or a rare subgroupCheck those observations before excluding any

Skewness is named after the tail, not the peak: a right-skewed histogram has its peak on the left. In a right-skewed sample the mean sits to the right of the median, which is why both are worth stating in the legend.

When a journal figure needs a histogram

Histograms appear wherever a paper has to show what a sample looks like, not only its mean.

Distribution checks before a test

Reviewers ask whether data meet the normality assumption of a t-test or ANOVA; a density histogram with a normal curve answers that in one supplementary panel.

Regression residuals

Standardized residuals centred on zero with no long tail support a linear model; skewed or two-peaked residuals point to a missing variable or a needed transformation.

Quality control and calibration

Fill weights, assay replicates or instrument readings binned against their specification limits show drift and spread at a glance in methods and validation papers.

Size and timing distributions

Cell and particle diameters, mitochondrial lengths, reaction times, ages at diagnosis: right-skewed or multimodal variables whose shape a mean ± SD bar would hide.

Histogram maker vs Excel, Google Sheets and Desmos

The same data can come out with different bars in a spreadsheet, a graphing calculator and the histogram maker. These settings make the difference.

This histogram makerExcelGoogle SheetsDesmos
Default binsSturges' rule, rounded to a clean width such as 2, 5 or 10Scott's normal reference rule in the Histogram chart; the Analysis ToolPak uses the bin column you typeA bucket size chosen automatically, with an outlier percentile that trims the extremesWidth 1 until you write histogram(list, width)
Normal curve over the barsWrite “with a normal curve”; it is drawn in the bars' own unitsA NORM.DIST column scaled by n × bin width, added as a second series in a combo chartNo overlay option in the histogram chartGraph normaldist(mean, sd).pdf(x) over a density histogram
A frequency table already countedTyped or attached as classes with counts, joined at the boundariesDrawn as a column chart with the gap width set to 0Drawn as a column chart; the histogram chart needs raw valueshistogram() takes a raw list
Classes of unequal widthBars switch to frequency density so each area matches its countEqual widths in the Histogram chart, apart from overflow and underflow binsEqual bucket sizes onlyOne width per histogram

Why the histogram maker and Excel can count the same data differently

Excel puts a value equal to a bin edge in the bin that ends there, and R's hist() does the same by default. The histogram maker, like NumPy and Matplotlib, puts it in the bin that starts there. Exam scores of exactly 60, 70 and 80 on edges of 10 therefore sit one bar apart in the two programs; edges ending in .5, such as 59.5, avoid the question for whole-number data.

Bringing a spreadsheet into the histogram maker

Attach the sheet straight to the histogram maker: one column per sample, or a group column beside a value column. The FAQ below lists the file limits.

Histogram maker questions, answered

How many bins should a histogram have?

Usually five to 15, with more bins as the sample grows. Sturges' rule gives 7 bins for 50 values, 8 for 100 and 11 for 1,000. The histogram maker starts there and rounds the width to a clean number, so the final count can differ by one or two; large or skewed samples often read better with the Freedman–Diaconis rule.

Is this histogram maker free?

Yes to start — every new account gets 100 free credits and no card is required to sign up. Binning and counting in the histogram maker cost nothing; credits are spent only when the figure is drawn. An account is needed because each figure is saved to a workspace you can return to and edit.

Can I make a histogram from an Excel or CSV file?

Yes. Attach up to three .xlsx, .csv or .tsv files to the histogram maker, one sample per column with its name in the header row. A legacy .xls has to be re-saved as .xlsx first. Every value is binned, up to 200,000 in total, so a large export does not need to be sampled by hand.

Can the histogram maker work from a frequency table?

Yes. Give the classes with their counts, such as 40–49: 3, 50–59: 8, 60–69: 12, and the histogram maker draws them as given. The limits are joined at the class boundaries so the bars touch, and when classes differ in width the bars switch to frequency density so their areas stay proportional to the counts. The seedling table on this page is worked through column by column.

How do I choose the bin width?

Start from a rule, then take a round width near it: 2, 5 or 10 units rather than 3.7. Write “bin width 5” in the histogram maker to set it and “starting at 40” to place the first edge. Too wide merges real peaks and too narrow makes noise look like structure, so compare two widths before deciding, as the wing-length demo does.

Which bin does a value on a bin edge go into?

In this histogram maker, the bin that starts at that edge. Each bin includes its left edge and excludes its right one, except the last bin, which includes both ends so the maximum is always counted; NumPy uses the same convention. Excel and R's hist() count an edge value in the bin that ends there instead.

Should the y axis show frequency, relative frequency or density?

Frequency for a single sample, relative frequency to compare samples of different sizes, density when a probability curve is drawn over the bars or the bins are unequal. With equal bins all three give the same shape; only the scale on the axis changes. Name the one you want and the histogram maker titles the y axis to match.

Why do the bars in a histogram touch?

Because the bins are consecutive intervals of one number line with nothing between them. A gap would suggest values that cannot occur. Bars only stand apart when a bin is empty, which the histogram maker shows as a stretch of bare baseline.

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

A histogram shows the distribution of one numerical variable in bins; a bar chart compares a value across categories. The histogram's x axis is a continuous scale with touching bars, while a bar chart's categories stand apart and can be put in any order. The histogram maker bins one measured variable; category totals belong in the bar graph maker.

How do I tell whether a histogram is skewed?

Look at the tail: short bars trailing off to the right mean right-skewed, to the left mean left-skewed. The mean is pulled toward the tail, so a mean well above the median confirms a right skew. Ask the histogram maker for a normal curve and a skew shows as bars running past the curve on one side.

When should a histogram use log-scale bins?

When every value is positive and the data span more than one or two powers of ten, as particle sizes and concentrations often do. Equal bins on a log axis give the small values room and often turn a long right tail into a symmetric shape. Write “log bins” or “x axis on a log scale” in the histogram maker.

How do you draw a histogram by hand?

Find the range, choose a bin width, tally the values into the bins, then draw touching bars as tall as the counts. Start the first bin just below the smallest value; with whole numbers, edges ending in .5 (49.5, 59.5) keep any value from landing on an edge. The histogram maker follows the same steps in code, so its counts can be checked against a hand tally.

How do I compare two groups with histograms?

Put both samples on the same bin edges and the same axes, overlaid with transparent fills or in panels one above the other. Separate bins for each group make the shapes impossible to compare. Give the histogram maker each group on its own line of values with its name; up to three are overlaid and four to six go into panels.

What should a histogram's figure legend state?

The sample size, the bin width or the rule that chose it, and what the y axis measures. A reader cannot judge a shape without knowing the bin width. The histogram maker titles the y axis; the bin width and n belong in the legend text.

Sources

Paste your data into the histogram maker

Paste your measurements and the histogram maker returns a publication-ready figure in about a minute, every bin counted by code and only the drawing left to the AI.

Make a histogram