Statistics

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.

ClassFrequencyWidthFreq. density
0 < x ≤ 1010101
10 < x ≤ 151553
15 < x ≤ 202054
20 < x ≤ 3012101.2
30 < x ≤ 508200.4
0123405101520253035404550ValueFrequency density

How it works

  1. Find each class width

    0–10: 10; 10–15: 5; 15–20: 5; 20–30: 10; 30–50: 20.

  2. Calculate frequency density

    frequency density=frequencyclass width\text{frequency density} = \frac{\text{frequency}}{\text{class width}}

    10 ÷ 10 = 1; 15 ÷ 5 = 3; 20 ÷ 5 = 4; 12 ÷ 10 = 1.2; 8 ÷ 20 = 0.4.

  3. 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.

  4. Estimate the mean

    xˉ≈∑fx∑f=1207.565=18.58\bar{x} \approx \frac{\sum fx}{\sum f} = \frac{1207.5}{65} = 18.58

    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

frequency density=frequencyclass widthfrequency=area of bar\text{frequency density} = \frac{\text{frequency}}{\text{class width}} \qquad \text{frequency} = \text{area of bar}
Class widthUpper boundary − lower boundary
Frequency densityThe height of each bar
AreaFrequency density × width = frequency

Example substitution

10<x≤15,  f=15:FD=155=310 < x \le 15, \; f = 15: \quad \text{FD} = \frac{15}{5} = 3

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.

  1. 1
    Widths: 10, 5, 5, 10, 20
  2. 2
    Frequency ÷ width: 10÷10, 15÷5, 20÷5, 12÷10, 8÷20
Answer: 1, 3, 4, 1.2, 0.4

A histogram bar from 20 to 30 has height 1.2. How many values are in the class?

  1. 1
    Frequency = area: frequency density × width
  2. 2
    Calculate: 1.2 × 10
Answer: 12

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.

Related calculators