Histogram Maker
Paste your numbers and get a frequency or relative frequency histogram with class boundaries, midpoints and the full frequency distribution table. Free, no sign-up.
PNG, SVG or CSV download. Runs in your browser.
Your data
Example: 30 quiz scores. Replace them with your own numbers.
Clear all data?
Labels
Leave blank and it matches what the bars show.
Hover over or tap a bar to see its value. From the keyboard, tab to the chart and use the arrow keys.
Paste at least 2 numbers to download your histogram.
Written from your data. Edit it if you like, then copy it into your document or web page.
Show data table
On this page
How to use the histogram maker
- Paste your numbers. One per line, or separated by spaces or commas. You can also open a CSV file. It stays in your browser.
- Set up the classes. Pick how many classes you want and the tool works out the width, or type the width yourself. Leave Start at blank and no value lands on a boundary.
- Choose the bar height. Frequency shows counts. Relative frequency shows each class as a share of the total, and Percent shows the same share out of 100.
- Check the table. It lists class boundaries, midpoints, frequency, relative frequency, percent and running totals. Copy it straight into your homework or a spreadsheet.
- Download or share. Save the histogram as a PNG or SVG, the table as a CSV, or copy a link that opens the same chart.
A different class width can change the shape a lot. If your histogram looks odd, try a few widths before you settle on one.
How to make a histogram by hand
A histogram is a bar graph for numerical data: the values are grouped into classes of equal width, and touching bars show how many values fall in each class.
The tool follows the textbook method from OpenStax Introductory Statistics, section 2.2:
- Pick a starting point just below the smallest value, carried to one more decimal place than the data. OpenStax explains that when the boundaries have that extra decimal place, "no data value will fall on a boundary."
- Find the class width. Subtract the starting point from the largest value, carried to the same extra decimal place (98.5 for the example scores), divide by the number of classes, and round up.
- List the boundaries by adding the width over and over.
- Count the values in each class. That count is the frequency.
- Draw touching bars, one per class, as tall as the frequency (or the relative frequency).
Changing the number of classes changes the look of a histogram. Try two or three settings before you describe the shape.
With your data
Frequency histogram vs relative frequency histogram
A frequency histogram shows how many values fall in each class. A relative frequency histogram shows what share of all the values fall there: the class count divided by n. With the example data, the 71.5 to 81.5 class holds 11 of 30 scores, a relative frequency of 11 ÷ 30 ≈ 0.367, or about 36.7%.
| Measure | Frequency histogram | Relative frequency histogram |
|---|---|---|
| Vertical axis shows | How many values fall in each class | The share of all values in each class (count ÷ n) |
| Each histogram adds up to | n, the total number of values (30 in the example) | 1 |
| Shape of the graph | The same either way. Only the numbers on the vertical axis change. | |
Only the numbers on the vertical axis change. As OpenStax puts it, "The graph will have the same shape with either label." Relative frequency is the better pick when you compare two groups of different sizes, like two classes with 24 and 31 students, because each histogram then adds up to 1.
How many classes should a histogram have?
There's no single right answer, but OpenStax notes that "many histograms consist of five to 15 bars or classes for clarity." Fewer classes smooth the data into a rough outline. More classes show detail but can look choppy when you don't have many values. This tool warns you when you go outside 5 to 15, and it keeps the width rounded to a number that's easy to count in. For more on bins and equal widths, see the tricky cases in the histogram vs bar graph guide.
Histogram or bar graph?
Use a histogram when your data are numbers that can be grouped into ranges, like test scores, heights or wait times. Use a bar graph when your data are categories, like favorite sport or eye color. For categories, the relative frequency bar graph maker counts the answers for you, and the histogram vs bar graph guide walks through tricky cases.
Related tools and guides
Frequently asked questions
What is a relative frequency histogram?
It's a histogram where each bar's height is the share of the data in that class instead of the count. Divide each class count by the total number of values. The bars add up to 1 (or 100%), and the shape is the same as the regular frequency histogram.
How do you find the class width for a histogram?
Subtract the starting boundary from the largest value, carried to one more decimal place, and divide by the number of classes you want, then round up. With the example quiz scores, (98.5 − 51.5) ÷ 5 = 9.4, which rounds up to a class width of 10.
What's the difference between class limits and class boundaries?
Class limits use the same precision as the data, like 52 to 61 for whole-number scores. Class boundaries sit halfway between one class's upper limit and the next class's lower limit, like 51.5 to 61.5, so the bars meet with no gap. The table shows both when your data are whole numbers.
Can a histogram have gaps between bars?
Only when a class has no values in it. The empty class still takes up its space on the axis, so you see a gap where its bar would be. Gaps between every bar are the sign of a bar graph, which is for categories rather than numbers.
Can I make a histogram from a frequency table I already have?
This tool needs the raw numbers so it can sort them into classes. If you only have class counts, the bar graph maker can draw them with the class ranges as categories, though its bars will have small gaps.
How this page is checked
Cedrick Reese built this histogram maker on the same chart engine as the rest of BarGraphCreator. The class width, boundaries, midpoints, counts and relative frequencies were recalculated separately from the tool's own code against the 30-score example and against edge cases: all values the same, decimal data, negative numbers, a starting value that puts values exactly on a boundary, and a class with no values. The construction method and the 5 to 15 classes guideline come from OpenStax Introductory Statistics, section 2.2. If the class width logic changes, the boundary edge cases above are run again.
Last updated: