What Is Histogram?
A histogram groups continuous data into equal-width bins and draws a bar for each bin, with the height showing how many values fall inside it. It is the quickest way to see where data are centred, how widely they spread and whether the distribution is symmetric or skewed.
This tool builds the frequency distribution for you: bin edges, counts and the tallest bin, plus an estimate of the shape. Leave the number of bins blank for an automatic choice, or set your own to see how the picture changes. Related searches such as histogram maker, frequency table and frequency distribution calculator are all covered by the one tool.
Below you will find how bin width is calculated, a variables table, a worked example and answers to common questions such as how many bins to use and the difference between a histogram and a bar chart.
How to Use the Histogram Calculator
- Paste or type your data, separated by commas, spaces or new lines.
- Leave the bin count blank for an automatic choice, or enter a number to see more or less detail.
- Read the histogram and the frequency table. Try a few different bin counts, because the shape can change with the grouping.
Histogram Formula
Sturges' rule for the number of bins
Bin width
Relative frequency
Histogram Variables Explained
| Symbol | Meaning | Notes |
|---|---|---|
| n | Number of data values | |
| k | Number of bins | Automatic or chosen by you |
| w | Bin width | (max − min) ÷ k |
| fᵢ | Frequency of bin i | Count of values in the bin |
Histogram Worked Example
Using the example values (press “Load example” above to try them):
- Range = max − min = 25 − 11 = 14.
- Number of bins (Sturges' rule): ⌈log₂(20) + 1⌉ = 6.
- Bin width = range ÷ bins = 14 ÷ 6 = 2.33333.
- Count how many values fall in each bin. Each bin includes its lower edge; the last bin also includes the maximum.
- For comparison, other bin rules suggest: Sturges' rule 6; Square-root rule 5; Rice rule 6; Scott (3.49 s n^−⅓) 3; Freedman-Diaconis 5.
Result: Number of bins = 6; Bin width = 2.33333.
How to read a histogram
The height of each bar is the number of values in that range, so tall bars show where data is concentrated. Look first at the overall shape, then at the centre, the spread and anything unusual such as gaps or isolated bars far from the rest.
| Shape | What it looks like | Typical meaning | Better summary |
|---|---|---|---|
| Symmetric, bell-shaped | Mirror image around the middle | Many natural measurements (heights, errors) | Mean and SD |
| Right-skewed | Long tail to the right | Incomes, waiting times, house prices | Median and IQR |
| Left-skewed | Long tail to the left | Exam scores with a ceiling, age at death | Median and IQR |
| Bimodal | Two separate peaks | Two groups mixed together | Split the groups |
| Uniform | Bars about equal height | Equally likely outcomes, e.g. a fair die | Range |
| With outliers | Isolated bar(s) far away | Errors or rare events | Check the data |
Choosing the number of bins
The bin count changes the story the histogram tells. Too few bins smooth away real features such as two peaks; too many produce a jagged chart that shows noise. The step-by-step panel lists what five common rules suggest for your data so you can try them.
| Rule | Formula | Best for |
|---|---|---|
| Sturges | k = ⌈log₂ n + 1⌉ | Roughly normal data, n under about 200 |
| Square root | k = ⌈√n⌉ | Quick default, any size |
| Rice | k = ⌈2 n^(1/3)⌉ | Larger samples |
| Scott | w = 3.49 s n^(−1/3) | Near-normal data |
| Freedman-Diaconis | w = 2 IQR n^(−1/3) | Skewed data and outliers |
Histogram or bar chart?
A histogram is for numeric data split into continuous ranges, so the bars touch and the x-axis is a number line. A bar chart compares separate categories such as countries or product names and its bars have gaps. Mixing them up is a very common error in school projects.
The cumulative chart (ogive)
The second chart shows the running total of the percentage of values up to each bin edge. Read it to answer “what share of the data is below x?”, for example the median is where the curve crosses 50 %.
Where Histogram Is Used
Seeing the shape of data
Checking whether a variable looks symmetric, skewed or has more than one peak.
Building a frequency table
Producing class intervals and counts for a school or lab report.
Spotting gaps and outliers
Finding empty bins or isolated values that need a closer look.
Checking assumptions
Looking at the distribution before running a test that assumes roughly normal data.
Common Histogram Mistakes to Avoid
- Using uneven bin widths without adjusting heights (use frequency density if bins differ).
- Choosing bin edges that put key values exactly on the boundary; here each bin includes its lower edge.
- Reading too much into small differences in bar height with few observations.
- Leaving a long empty tail from one outlier; check or trim the data first.
- Too few bins hide the shape and too many make it noisy. Start with the automatic value and adjust.
- A histogram is for numeric data. For categories, use a bar chart, where the bars are separated.
- Look for skew, several peaks and outliers before choosing a summary statistic such as the mean.
Histogram Terms and Definitions
- Bin
- A range of values grouped together, also called a class interval.
- Frequency
- The number of observations in a bin.
- Relative frequency
- Frequency divided by the total count.
- Skewness
- A measure of asymmetry of a distribution.
- Ogive
- A cumulative frequency graph.
Histogram FAQs
How do I make a histogram?
Paste your values, optionally set the number of bins and read the chart. The frequency table beneath lists each bin and its counts.
How do I choose the right bin width?
Start with the automatic value, then try a few more and fewer bins. Choose the one that shows the shape clearly without too much noise. Five standard rules are listed in the steps.
What is the difference between frequency and relative frequency?
Frequency is a count; relative frequency is the count divided by n, shown as a percentage.
Can I make a histogram with unequal bins?
This tool uses equal-width bins, which is the standard form. For unequal bins use frequency density (frequency ÷ width) on the y-axis.
What does a histogram with two peaks mean?
Usually two different groups combined in one data set, such as heights of men and women. Analyse the groups separately.
How many data points do I need?
At least 20 or so to see a shape; more is better. With very few points a dot plot is clearer.
What is a histogram?
A histogram is a bar chart for numeric data in which each bar covers a range of values (a bin) and its height is the number of observations in that range.
How many bins should I use?
There is no single correct number. Sturges' rule, k = ⌈log₂ n + 1⌉, is a common starting point, and the square-root rule is another. Try several and choose the one that shows the shape clearly.
What is the difference between a histogram and a bar chart?
A histogram groups continuous numeric values into ranges and its bars touch. A bar chart compares separate categories.
What is relative frequency?
It is the share of all observations that fall in a bin, shown here as a percentage of the total count.