Paste a list of numbers and get a histogram with equal-width bins chosen by Sturges' rule, the count written on each bar, and a normal curve fitted to your mean and standard deviation so you can see at a glance whether the data is bell-shaped.
Separate values with commas, spaces, tabs or new lines — paste a column straight from a spreadsheet and it will parse. Decimals and negatives are fine.
32 values in 6 equal-width bins (Sturges' rule), with the normal curve of the same mean and standard deviation for comparison.
Show the working, step by step
What a histogram shows
A histogram takes one continuous variable, cuts its range into intervals of equal width, and draws a bar for each interval whose height is the number of values that fell inside it. The bars touch because the intervals do: there is no gap between "23 to 28" and "28 to 33". Read left to right, the picture tells you where the values cluster, how far they spread, and whether the spread is even on both sides of the centre.
That is what separates it from a bar chart. A bar chart compares categories — regions, products, months — and its bars can be shuffled into any order without losing anything. A histogram's bars are fixed to the number line, and their area carries the meaning. The sample above is 32 delivery times in minutes. The histogram maker puts them in 6 bins of width 5, from 18 to 48, with counts of 4, 13, 9, 3, 2 and 1. The bulk of deliveries take between 23 and 33 minutes; a thin tail runs out to the right.
How the bins are chosen
k = ⌈log₂ n + 1⌉ width = (max − min) / k
The number of bins comes from Sturges' rule, published in 1926 and still the default in R's
hist() and in Excel. For the 32 delivery times, log₂ 32 is 5, so k = 6, and
the width is (48 − 18) / 6 = 5 minutes. The first bin starts at the minimum and the last
one ends at the maximum, closed on the right so the largest value is counted exactly once.
Sturges assumed the data is roughly normal and derived the count from the binomial distribution. That gives it two known weaknesses. It grows only logarithmically, so on a large sample — say 5,000 values, where it still offers just 14 bins — it oversmooths and can hide real structure. And on strongly skewed data it forces most values into one or two bars on the crowded side while the tail gets bins that hold almost nothing.
Two alternatives are worth knowing. The square-root rule, k = ⌈√n⌉, is what many spreadsheet tools use; it agrees with Sturges here (√32 rounds up to 6) but gives many more bins as n grows. The Freedman–Diaconis rule sets the width rather than the count, at 2 × IQR / ∛n, so a few extreme values cannot stretch the bins; on the sample data it asks for 9 bins of about 3.5 minutes. Neither is implemented here, and none of the three is right for every dataset. If the bars look like a comb or a block, the rule has misjudged your data, not the other way round.
Reading the shape
- Symmetric, one peak — the bars fall away evenly from the middle and mean and median almost coincide. A mean and standard deviation describe this well, and the normal curve will sit close to the bars.
- Right skew — a long tail to the right, mean above the median. Typical of delivery times, incomes, response times: anything with a hard floor and no ceiling. The sample data does this mildly, with a mean of 28.3 and a median of 27.
- Left skew — the mirror image, with a tail to the left. Common in scores on an easy test or ages at death.
- Bimodal — two peaks. Usually two populations mixed together: two machines, two shifts, two species. The mean lands between the humps, where hardly any values sit, and describes nothing.
- Outliers — an isolated bar far from the rest, often a single value. It pulls the mean and can inflate the standard deviation a great deal while leaving the median untouched.
The shape decides which summary to report. Symmetric and single-peaked: mean plus standard deviation. Skewed, bimodal or contaminated by outliers: median plus interquartile range, which the IQR calculator gives you along with the outliers flagged. The mean, median and mode calculator shows all three centres side by side, and the gap between mean and median is itself a quick measure of skew.
Standard deviation from a histogram
Sometimes the histogram is all you have — a figure in a report, with no raw data behind it. You can still recover a mean and standard deviation by treating each bar as if every value in it sat at the bar's midpoint. Multiply each midpoint by its frequency, sum, and divide by the total count to get the mean; then weight the squared deviations of the midpoints by the same frequencies for the variance.
x̄ ≈ Σ(f × m) / n s² ≈ Σ f (m − x̄)² / (n − 1)
On the sample data this gives a mean of 28.78 and a standard deviation of 6.04, against the true 28.31 and 6.11 from the raw values. The error comes from values not really being at their midpoints — the first bin's four values average 20.75, not 20.5 — and shrinks as bins get narrower. The grouped data standard deviation calculator does the whole computation from a table of intervals and frequencies, with the working shown.
The fitted normal curve
The curve drawn over the bars is the normal distribution with your data's mean and standard deviation, scaled so that its height at any point is the number of values a bin of that width would be expected to hold if the data were normal. It is a reference, not a fit in the least-squares sense: it uses only two numbers from your data and ignores the shape entirely.
That is what makes it useful. Where the bars and the curve agree, the mean and SD are doing their job, and tools that assume normality — the normal distribution calculator, z-scores, the 68–95–99.7 rule — will give sensible answers. Where they disagree, the mismatch is the diagnosis. On the delivery times the tallest bar, 23 to 28, holds 13 values where the curve expects about 9, the 33-to-38 bar holds 3 against an expected 5, and the last two bars hold more than the curve allows for. A crowded centre just left of the mean and a stretched tail to the right is what right skew looks like against a symmetric reference. The standard deviation graph draws the same histogram with the ±1, ±2 and ±3 SD bands shaded, so you can count how many of your values fall inside each.
Dot plots for small samples
With 16 values or fewer, Sturges' rule gives at most five bins, and a histogram turns into a handful of blocks that could be hiding anything. A dot plot — one dot per value, stacked where values repeat or nearly coincide — loses nothing, because there is nothing to bin. Every value stays visible, an outlier is unmistakable, and a gap in the data shows as a gap rather than being averaged into a bar. Most other calculators on this site draw one under the results for exactly that reason. Use this histogram maker when n is large enough that individual points would blur into a smear, and a dot plot when it is not.
Related calculators
-
Standard deviation graph
The same histogram with ±1, ±2 and ±3 SD bands shaded.
-
Grouped data SD
Mean and SD from class intervals and frequencies.
-
Five-number summary
Min, quartiles and max as a box plot.
-
IQR & outliers
The robust spread measure for skewed data.
Common questions
How many bins should a histogram have?
There is no single right answer, only rules of thumb. This maker uses Sturges' rule,
k = ⌈log₂ n + 1⌉, which gives 6 bins for 32 values, 8 for 100 and 11 for
1,000. It is the default in R and Excel and works well for modest, roughly bell-shaped
samples. If the bars look too coarse or too spiky, the shape is telling you the rule has
not suited your data — see the section on bin rules above.
What is the difference between a histogram and a bar chart?
A bar chart compares separate categories, so its bars have gaps and can be reordered freely. A histogram divides one continuous number line into touching intervals, and the order and width of the bars carry meaning: area represents count. Sorting histogram bars by height would destroy the picture.
How do I calculate the standard deviation from a histogram?
Take the midpoint of each bar as a stand-in for every value in it, multiply by the bar's
frequency, and treat the result as grouped data: the mean is
Σ(f × m) / Σf and the variance is Σf(m − x̄)² / (n − 1). The
grouped data calculator does
this from a table of class intervals and frequencies. Expect a small error, because the
values inside each bin are not really all at the midpoint.
What does the curve on the histogram mean?
It is the normal distribution with the same mean and standard deviation as your data, scaled so its height is the count you would expect in each bin if the data were normal. Bars that follow it suggest the mean and SD summarise the data well; bars that lean away from it, or have a second hump, suggest they do not.
Can I use this as a dot plot calculator?
For small samples, yes in spirit: the counts on each bar are the same information a dot plot shows as stacked dots. Below about 20 values a dot plot is honestly the better picture, because Sturges' rule gives so few bins that the shape is mostly hidden. Every other calculator on this site draws a strip of stacked points for exactly that reason — try the standard deviation calculator with the same numbers.
Does the histogram use the sample or population standard deviation?
The sample version, dividing by n − 1, on the assumption that the numbers
you have are a sample from something larger. The bins and counts are unaffected either
way; only the SD figure in the results grid and the width of the fitted curve change,
and by very little unless n is small.