Histogram maker
This histogram maker turns your data into a correctly scaled histogram. Paste a list of raw values and it sorts them into classes, or type a grouped frequency table. When the classes have different widths, it plots frequency density, so each bar's area shows its frequency. It also draws the cumulative frequency curve and gives the estimated mean, median and quartiles.
It opens on a grouped table with classes of different widths, which is exactly where most histograms drawn by hand go wrong.
Histogram Maker
Draw histograms with frequency density and cumulative frequency
How to use the histogram maker
- In the Data section, choose Grouped table if your data is already in classes, or Raw data for a list of values.
- For a grouped table, type each class as From, To and its frequency f. For raw data, type or paste the values, one per row. A column pasted from a spreadsheet fills the table in one go.
- For raw data, open Classes and axes to set the Class width and where the First class from starts, or leave both on Auto.
- Switch the view between Histogram and Cumulative frequency.
- Read the results: total frequency, modal class, estimated mean, estimated median, quartiles and interquartile range, with a frequency density table underneath.
When every class has the same width, you can turn on Frequency on the y axis to plot plain frequency instead of density. Raw data can have up to 300 values. For practice, Practice and help sets frequency and frequency density questions with worked solutions.
What a histogram shows
A histogram shows how numerical data is spread out. The data is split into classes, ranges such as 10 to 15, and each class gets a bar. The bars touch, because the classes run on from each other with no gaps, which is the main thing that sets a histogram apart from a bar chart.
| Histogram | Bar chart | |
|---|---|---|
| Data | Continuous numbers, such as times or heights | Categories, such as favourite colour |
| Bars | Touch, because the classes join up | Have gaps between them |
| What shows the amount | The area of each bar | The height of each bar |
| Bar widths | Can differ if the classes differ | All the same |
Our bar graph guide covers bar charts in full.
Frequency density: histograms with unequal classes
If the classes are all the same width, the height of each bar can simply be the frequency. If they differ, plotting frequency makes wide classes look far too big. Instead, each bar's height is the frequency density:
Example 1: a grouped table with unequal widths
The times, in minutes, that 50 people took to finish a quiz:
| Time (minutes) | Frequency | Class width | Frequency density |
|---|---|---|---|
| 0 to 10 | 6 | 10 | 0.6 |
| 10 to 15 | 10 | 5 | 2 |
| 15 to 20 | 14 | 5 | 2.8 |
| 20 to 30 | 12 | 10 | 1.2 |
| 30 to 50 | 8 | 20 | 0.4 |
The 30 to 50 class has 8 people, more than the 6 in 0 to 10, but it is twice as wide, so its bar is lower: 0.4 against 0.6. The tallest bar, 15 to 20, is the modal class, because it has the highest density. Type the five classes into the Grouped table and the histogram maker gives these densities, a modal class of 15 to 20, and an estimated mean of 20.4 minutes.
Check you can work out a density:
Reading a frequency off a histogram
To go back from a bar to a frequency, multiply its height by its width: frequency = frequency density × class width. A bar from 20 to 30 with a height of 1.2 holds 1.2 × 10 = 12 values. That is why the area of a histogram, not its height, tells you how many values are in each part.
Making a histogram from raw data
Choose Raw data and paste your values. The histogram maker picks a class width that gives about the square root of the number of values as classes, on a step of 1, 2 or 5 times a power of ten, and starts the first class at a round number.
Example 2: twenty test scores
Twenty scores: 47, 52, 61, 38, 55, 70, 44, 58, 63, 49, 66, 51, 42, 57, 74, 59, 53, 68, 46, 62. With the class width on Auto, the maker uses classes of 10 from 30:
| Score | Frequency |
|---|---|
| 30 to 40 | 1 |
| 40 to 50 | 5 |
| 50 to 60 | 7 |
| 60 to 70 | 5 |
| 70 to 80 | 2 |
A value on a boundary goes in the class above, so 70 counts in 70 to 80. The modal class is 50 to 60, and the estimated median is 55.7. Because these classes are all the same width, you can switch on Frequency on the y axis. Change the class width to 5 and the same scores spread over more, narrower bars, which shows more detail but more noise.
Cumulative frequency, the median and quartiles
Switch the view to Cumulative frequency to see a running total plotted against the upper end of each class. The median is read off halfway up the total, and the quartiles at a quarter and three quarters. For the quiz times in Example 1, the median is the 25th value, which falls in the 15 to 20 class:
The lower quartile is about 13.3 and the upper quartile 26.3, so the interquartile range is about 13 minutes. The calculator shows this working for each one. Our cumulative frequency guide covers drawing and reading the curve by hand, and the Mean, Median and Mode Calculator gives the averages for a grouped table too.
Common mistakes
- Plotting frequency when the widths differ. Wide classes then look far bigger than they are. Use frequency density.
- Leaving gaps between the bars. In a histogram the classes join, so the bars touch.
- Taking the modal class as the tallest frequency. With unequal widths, it is the class with the highest frequency density.
- Reading the height as the frequency. With frequency density on the axis, multiply the height by the width.
- Getting the class width wrong. The width is the upper boundary minus the lower one: 10 to 15 is 5 wide, not 6.
- Calling the median exact. From grouped data, the median and mean are estimates, because the actual values are hidden inside the classes.
Practise histograms in a short timed paper
Histograms with frequency density come up in GCSE Maths Higher, and data displays in Geometry, Algebra 2 & SAT Math and AP Statistics practice. Each daily paper is a short timed paper of 8 questions worth 25 to 35 marks, and the papers mix topics. To draw the same data as a box plot, use the Box Plot Calculator.
Common questions
How do you make a histogram?
What is frequency density?
What is the difference between a histogram and a bar chart?
How do I choose the class width?
How do you find the frequency from a histogram?
Can I make a histogram with equal class widths?
Revision cards
Say the answer first, then flip the card to check it.
Where to go next
- Solve it
Histogram Maker
Draw histograms with frequency density and cumulative frequency
Open the tool - Test it
Geometry, Algebra 2 & SAT Math
A new exam-style paper every day, with instant marking and a mark scheme
Start today's paper - Test it
AP Statistics
A new exam-style paper every day, with instant marking and a mark scheme
Start today's paper