Histogram Calculator
Enter class boundaries and frequencies to work out frequency density, draw the histogram and estimate the mean. Ideal for unequal class widths, with every step of the working shown.
| Class | Frequency | Width | Freq. density |
|---|---|---|---|
| 0 < x ≤ 10 | 10 | 10 | 1 |
| 10 < x ≤ 15 | 15 | 5 | 3 |
| 15 < x ≤ 20 | 20 | 5 | 4 |
| 20 < x ≤ 30 | 12 | 10 | 1.2 |
| 30 < x ≤ 50 | 8 | 20 | 0.4 |
How it works
Find each class width
0–10: 10; 10–15: 5; 15–20: 5; 20–30: 10; 30–50: 20.
Calculate frequency density
10 ÷ 10 = 1; 15 ÷ 5 = 3; 20 ÷ 5 = 4; 12 ÷ 10 = 1.2; 8 ÷ 20 = 0.4.
Draw the bars
Plot frequency density on the vertical axis. Each bar spans its class on the horizontal axis with no gaps, so the area of each bar equals its frequency.
Estimate the mean
Multiply each class midpoint by its frequency, add them up, and divide by the total frequency. It is an estimate because we use midpoints.
Result:Mean ≈ 18.58
Frequency density
Example substitution
The class is 5 wide, so the bar is 3 high.
Worked examples
Classes 0–10, 10–15, 15–20, 20–30, 30–50 have frequencies 10, 15, 20, 12, 8. Find the frequency densities.
- 1Widths: 10, 5, 5, 10, 20
- 2Frequency ÷ width: 10÷10, 15÷5, 20÷5, 12÷10, 8÷20
A histogram bar from 20 to 30 has height 1.2. How many values are in the class?
- 1Frequency = area: frequency density × width
- 2Calculate: 1.2 × 10
Frequently asked questions
What is frequency density?+
Frequency density = frequency ÷ class width. It is plotted on the vertical axis of a histogram so that bars of different widths can be compared fairly.
How is a histogram different from a bar chart?+
A histogram shows continuous data with no gaps between bars, and the area of each bar (not its height) represents the frequency. Bars can have different widths.
How do you find the frequency from a histogram?+
Frequency = frequency density × class width — the area of the bar. A bar from 20 to 30 with height 1.2 has frequency 1.2 × 10 = 12.
How do you estimate the mean from a histogram?+
Multiply each class midpoint by its frequency, add these up, and divide by the total frequency. It is an estimate because you do not know the exact values.
What if all the classes are the same width?+
Then frequency density is proportional to frequency, so the histogram looks the same as a frequency diagram. Frequency density matters when the widths are different.