Histogram Maker
Paste your numbers and get a histogram with a frequency table in seconds. This free histogram maker sorts raw data into bins, counts how many values land in each one, and draws the chart for you. Choose from five automatic bin rules or set your own. The tool runs in your browser and does not upload your data.
Enter Your Data
Comma-separated values, one series per bar.
Parsed 16 values
Bins
A simple rule that works well for many small-to-medium datasets.
Advanced settings
Min/Max set the histogram's range on their own, independent of Underflow/Overflow below.
Histogram type
Each bar shows how many values fall in that bin.
More statistics
Frequency Distribution
What You Can Do Here
How to Make a Histogram With This Tool
- Add your data. Paste your numbers, or upload a CSV, TSV, or text file. The tool skips blank cells and tells you how many entries were not numbers.
- Choose your bins. Automatic mode works for most data sets. Open Manual to set the number of bins or the bin width.
- Check the table and statistics. The frequency table sits under the chart and always matches it.
- Adjust the look. Edit the title, axis labels, colors, and grid lines.
- Download or embed. Save a PNG, JPG, or SVG, or copy the embed code for your site.
What Is a Histogram?
A histogram is a chart that shows how often values fall inside equal-width ranges, called bins. The height of each bar is the number of data points in that bin. Histograms work with numeric data such as ages, test scores, weights, and wait times.
How Many Bins Should a Histogram Have?
There is no single right answer. Too few bins hide the shape of your data. Too many bins make the chart messy.
To help, statisticians created simple rules. Each rule is a short formula that suggests how many bins to use. This tool offers five of them.
Four Terms You Need
- n is how many numbers you have. In our example, n = 20.
- Round up (⌈ ⌉) means always go to the next whole number. 4.32 becomes 5.
- Standard deviation (s) shows how spread out your numbers are. In our example, it is about 8.7.
- IQR is the spread of the middle half of your data. Sort your numbers, then subtract the value one quarter of the way in (Q1) from the value three quarters of the way in (Q3). In our example, 42.5 − 30.5 = 12.
The Example Data
We use the same 20 test scores for every rule. The minimum score is 22, and the maximum is 52, so the range is 30.
How Each Rule Works
Sturges. It uses only the number of values you have.
Bins = ⌈log₂ n⌉ + 1.
Here, log₂ 20 is about 4.32. Round up to 5, then add 1.
Result: 6 bins.
Square Root. Take the square root of n and round up.
√20 is about 4.47. Round up to 5.
Result: 5 bins.
Rice. Take the cube root of n, double it, and round up.
The cube root of 20 is about 2.71. Doubled, that is 5.43. Round up to 6.
Result: 6 bins.
Freedman-Diaconis. It finds the bin width first, using the IQR.
Width = 2 × IQR ÷ cube root of n = 2 × 12 ÷ 2.71, which is about 8.8.
Then divide the range by the width: 30 ÷ 8.8 is about 3.4. Round up to 4.
Result: 4 bins.
Scott. It also finds the bin width first, but it uses the standard deviation.
Width = 3.49 × s ÷ cube root of n = 3.49 × 8.7 ÷ 2.71, which is about 11.2.
Then divide the range by the width: 30 ÷ 11.2 is about 2.7. Round up to 3.
Result: 3 bins.
|
Rule |
Bins for the 20 Scores |
|---|---|
|
Sturges |
6 |
|
Square Root |
5 |
|
Rice |
6 |
|
Freedman-Diaconis |
4 |
|
Scott |
3 |
Why Do the Answers Differ?
The data is the same. Only the rule changed. Each rule looks at your data in a slightly different way, so each suggests a different number of bins. That is normal. None of them is a mistake.
Which Rule Should You Start With?
Start with the default, Sturges. If the chart looks too blocky or too busy, try another rule and compare.
Try Freedman-Diaconis if your data has an extreme value. Say one score is 500 and all the others sit between 10 and 15. That one score makes the standard deviation jump, but the IQR barely moves. Because Freedman-Diaconis uses the IQR, it handles that data better.
What Happens When the IQR Is Zero?
If more than half of your numbers are the same, the IQR becomes zero, and the Freedman-Diaconis formula cannot work. In that case, the tool switches to Scott’s rule so you still get a chart.
Limits
Automatic mode never goes above 60 bins. In Manual mode, you can use up to 200.
Setting Bins by Hand
Choose Manual, then pick one of two options:
- By count: you say how many bars you want.
- By width: you say how wide each bar should be.
Only one option is active at a time, so the two never conflict. For exam scores out of 100, a width of 10 gives you one bar for each 10-point band, like 0 to 10, 10 to 20, and so on.
How to Make a Histogram by Hand
Here is the same process the tool follows. Use these 20 scores, sorted:
22, 23, 27, 28, 29, 31, 31, 33, 35, 36, 37, 38, 39, 41, 42, 44, 45, 48, 50, 52
- Find the range. 52 − 22 = 30.
- Pick the number of bins. Sturges gives ⌈log₂ 20⌉ + 1 = 5 + 1 = 6.
- Find the bin width. 30 ÷ 6 = 5.
- Write the bins. 22 to 27, 27 to 32, 32 to 37, and so on.
- Count the values in each bin.
- Draw one bar per bin. The bars touch because the bins run on a continuous scale.
|
Bin |
Frequency |
Percentage |
Cumulative Frequency |
|---|---|---|---|
|
22-27 |
2 |
10% |
2 |
|
27-32 |
5 |
25% |
7 |
|
32-37 |
3 |
15% |
10 |
|
37-42 |
4 |
20% |
14 |
|
42-47 |
3 |
15% |
17 |
|
47–52 |
3 |
15% |
20 |
|
Total |
20 |
100% |
Which Bin Does a Boundary Value Go In? Each bin includes its lower edge and excludes its upper edge. So 27 goes in the 27–32 bin, not 22–27. The last bin also includes its upper edge, so the maximum value (52) is counted. Every value lands in exactly one bin.
What the Numbers Say. The mean is 36.55, and the median is 36.5. They are almost equal, so the distribution is close to symmetric.
How to Read the Shape of a Histogram
- Bell-Shaped. Values cluster in the middle and thin out evenly on both sides. The mean and median are close.
- Right Skewed. Most values are low, with a long tail of high values. The tail pulls the mean above the median.
- Left Skewed. Most values are high, with a tail of low values. The tail pulls the mean below the median.
- Bimodal. Two separate peaks. It can mean two groups are mixed in one data set.
- Uniform. Bars of about equal height. Every range holds a similar number of values.
The tallest bar shows the most common range, which is close to the mode. A short, isolated bar far from the rest is worth checking. It may be an outlier or a typing error.
Frequency vs Cumulative Frequency
A frequency histogram shows how many values fall in each bin. A cumulative frequency histogram shows the running total, so each bar counts every value up to and including that bin. In the table above, the cumulative column ends at 20, which is the full sample.
Choose “Cumulative Frequency” under Advanced settings to plot it. This tool draws cumulative frequency as bars. It does not draw an ogive, which is a line graph plotted at the upper bin boundaries.
What to Do About Outliers
An outlier can stretch the axis and squeeze the rest of the data into one or two bars. The “Exclude outliers” option removes values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR.
The option is off by default. When you turn it on, the tool shows how many values it removed and how many it used. The statistics and the table then describe the filtered data, so report them that way. An outlier can also be a real result, so check it before you drop it.
Histogram vs Bar Graph
A bar graph compares separate categories, like sales by region. Its bars have gaps, and you can reorder them. A histogram shows how one numeric variable is spread out. Its bars touch and stay in numeric order.
A quick test: if you can swap the bars without losing meaning, you want a bar graph. If the order matters, you want a histogram.
How to Make a Histogram in Excel or Google Sheets
Excel: select your data column, then go to Insert, then Insert Statistic Chart, then Histogram. Right-click the horizontal axis and choose Format Axis to change the bin width or the number of bins.
Google Sheets: select your data, go to Insert, then Chart, and set the chart type to Histogram. Use the Customize tab to change the bucket size.
Want the exact count and percentage for each bin? Copy your column from the spreadsheet and paste it into this histogram maker. The frequency table appears under the chart.
Examples
Classroom Scores. A teacher enters 30 test scores. Sturges gives 6 bins. If most bars sit between 70 and 85 and a few sit below 60, the chart shows a small group that may need extra help. A list of 30 numbers makes that harder to see.
Delivery Times. A shop enters the delivery time in days for 50 orders. If most bars sit at 2 to 4 days with a thin tail out to 10, the tail is the part worth investigating.
Package Weights. A packing line weighs 200 items that should be 500 grams. Bars tightly centered on 500 point to a steady process. A second peak may mean two settings that do not match.
Common Mistakes
- Too Few or Too Many Bins. Try two- or three-bin rules and compare.
- Using a Histogram for Categories. Use a bar graph for groups like “red, blue, green.”
- Very Small Samples. With very few values, one point can change the shape of the whole chart. A dot plot or a plain list may be clearer.
- Dropping Outliers Without Saying So. Always note it when you exclude them.
- Setting Min and Max Too Tight. Values outside the range are counted in the first or last bin, unless you turn on the Underflow or Overflow bin.
Frequently Asked Questions
About This Page
This guide was written and reviewed by Muhammad Umer Shuaib, who builds and maintains bargraphmaker.co, along with other educational web tools like a grade calculator. The examples and explanations on this page are created specifically for this guide. This page is reviewed and updated when important information or tool features change.