Scientific Figure
Histogram Tool

Histogram Maker & Histogram Builder

Generate frequency, relative frequency and density histograms from raw measurements, with every bin edge and count computed by code before a bar is drawn. Built for distribution checks, residual plots and lab reports.

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 composer.

Frequency, one sample
Two samples overlaid
Density with normal curve
Cumulative frequency

Histogram styles

Five journal presets, 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
Science
Cell Press
Clinical grayscale
Dark slide

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 creator

  • Type or paste raw values (Diameter (µm): 5.3, 4.9, 5.0…), or attach as many as three spreadsheets (CSV, TSV or Excel) with one sample per column.
  • A two-column table of bin ranges and counts (10–15, 4) is treated as data already grouped and drawn as given, with class limits such as 50–59 joined at the boundaries 49.5 and 59.5.
  • Bins default 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.
  • 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.
  • Every regeneration recounts the bins from your values, so switching the journal preset or the colours never moves a bar.

Types of histogram you can create

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 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). Write “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. Write “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 each sample 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. Write “cumulative”. 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

Counts that are already binned (40–49: 3, 50–59: 8…) are drawn 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 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 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.

How to make a histogram

1

Enter the measurements

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

2

Say how to bin and scale it

Leave the bins 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 figure is drawn 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.

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 wideRedraw with 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.

Histogram vs bar graph

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.

HistogramBar graphBox plot
X axisA number line divided into binsCategory names in any orderGroup names
Bar heightObservations in the bin, or their densityA mean, count or percentage per categoryNo bars: median, quartiles and whiskers
Space between barsNone, neighbouring bins share an edgeEqual gaps between categoriesBoxes stand apart
Can the order change?No, bins follow the number lineYes, by size or by nameYes
AnswersWhich values are common, and how spread out?Which category is largest?How do whole groups compare?

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

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 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. This 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.

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 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.

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” 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.

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. Reaction times, incomes and particle sizes are typically right-skewed.

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”.

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 steps are the same in a notebook as here.

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.

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 each group its own line of values with its name.

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

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's histogram function uses the same convention.

Can I create a histogram from data already grouped into classes?

Yes. Give the classes with their counts, such as 40–49: 3, 50–59: 8, 60–69: 12, and they are drawn 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.

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, and a density axis needs one sentence for readers outside statistics.

Sources

Create a histogram from your data

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

Make a histogram