Uni-Sine
MathematicsStatistics

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.

Try it

Histogram Maker

Draw histograms with frequency density and cumulative frequency

Go to its page

How to use the histogram maker

  1. In the Data section, choose Grouped table if your data is already in classes, or Raw data for a list of values.
  2. 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.
  3. For raw data, open Classes and axes to set the Class width and where the First class from starts, or leave both on Auto.
  4. Switch the view between Histogram and Cumulative frequency.
  5. 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.

HistogramBar chart
DataContinuous numbers, such as times or heightsCategories, such as favourite colour
BarsTouch, because the classes join upHave gaps between them
What shows the amountThe area of each barThe height of each bar
Bar widthsCan differ if the classes differAll 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:

\text{frequency density} = \frac{\text{frequency}}{\text{class width}}Then each bar has an area equal to the number of values in its class

Example 1: a grouped table with unequal widths

The times, in minutes, that 50 people took to finish a quiz:

Time (minutes)FrequencyClass widthFrequency density
0 to 106100.6
10 to 151052
15 to 201452.8
20 to 3012101.2
30 to 508200.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:

practice
Pick an answer, then check it.
The class 40 to 65 kg has a frequency of 15. What is its frequency 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:

ScoreFrequency
30 to 401
40 to 505
50 to 607
60 to 705
70 to 802

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:

\text{median} \approx 15 + \frac{25 - 16}{14} \times 5 = 18.2

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?
Split the data into classes, count how many values fall in each, then draw a bar for each class with no gaps. If the classes are different widths, make each bar's height the frequency density, frequency divided by class width.
What is frequency density?
Frequency divided by class width. Plotting it on a histogram makes the area of each bar equal to its frequency, so classes of different widths compare fairly.
What is the difference between a histogram and a bar chart?
A histogram shows numerical data in classes that join up, so its bars touch and their area shows the amount. A bar chart shows categories, with gaps between bars whose height shows the amount.
How do I choose the class width?
Aim for about 5 to 12 classes, with round-number boundaries. The histogram maker picks a width on Auto, or you can set your own under Classes and axes.
How do you find the frequency from a histogram?
Multiply the bar's height, the frequency density, by its width. A bar 1.2 high and 10 wide holds 12 values.
Can I make a histogram with equal class widths?
Yes. With equal widths, turn on Frequency on the y axis and the bars show plain frequency, which is how most simple histograms are drawn.

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
Read next
Maths · StatisticsFrequency density formula: how to work it outThe frequency density formula, how to work it out for a histogram with unequal class widths, reading frequencies back, estimating from bars, and practice.