Histogram Hub

Relative Frequency Histogram

What it is

A relative frequency histogram looks exactly like a normal histogram, but the bar heights show the proportion of the data in each bin instead of the raw count. Each bar is the count for that bin divided by the total number of values, usually shown as a percent. All the bars add up to 100 percent.

The shape never changes. You are dividing every bar by the same number, so the tall bars stay tall and the short ones stay short. Only the y-axis label changes.

Why use proportions

Two reasons. First, proportions let you compare datasets of different sizes on the same scale: a class of 20 and a class of 200 both add up to 100 percent, so their shapes line up. Second, relative frequency is the bridge to probability, since the proportion in a bin estimates the chance a new value lands there.

That second point is why this version shows up so often in a statistics course. Once the bars are proportions, you can read a question like "what share of scores were below 70" straight off the chart.

How to compute it

  1. Build the frequency table as usual, counting values per bin.
  2. Divide each count by the total number of values.
  3. Multiply by 100 for a percent.

That is the only change from a plain histogram. The counts become fractions of the whole.

A worked example

Here are 30 exam scores:

52, 58, 61, 63, 64, 66, 67, 68, 69, 70, 71, 72, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 84, 85, 87, 88, 91, 94, 98

Five bins ten points wide covers them:

BinCountDivisionRelative frequencyCumulative
50 to 6022 / 306.7%6.7%
60 to 7077 / 3023.3%30.0%
70 to 801111 / 3036.7%66.7%
80 to 9077 / 3023.3%90.0%
90 to 10033 / 3010.0%100.0%

The counts add to 30 and the proportions add to 100 percent. If yours do not, you have either missed a value or counted one twice.

Two things to notice. The 70 to 80 bar is the tallest either way, at 11 counts or 36.7 percent, which is the point about shape not changing. And the cumulative column answers the "below 70" question directly: 30 percent of the class scored under 70.

Which bin does a boundary value go in

A score of exactly 70 belongs to the 70 to 80 bin, not the 60 to 70 bin. The usual convention includes the lower edge and excludes the upper one, and the tool on this site follows it. Pick a rule and hold to it, or your proportions will not add up.

Relative frequency and density are not the same

A density histogram divides one step further, by the bin width, so the total area comes to 1 instead of the total height. With ten-wide bins, the 70 to 80 bar has a relative frequency of 36.7 percent and a density of 0.0367 per point.

If every bin is the same width, the two charts look identical apart from the axis numbers. They only diverge when bin widths vary, which is when density is the honest choice.

Make one instantly

In the histogram maker, set the Show option to "Relative frequency" and the y-axis switches from counts to percentages. The frequency distribution table already lists the relative frequency column for every class, so you can read the exact numbers next to the chart.

In a spreadsheet or in code

In Excel or Google Sheets, count each bin with COUNTIFS, then divide by COUNT of the whole range and format the column as a percent. The step by step versions are in the Excel guide and the Google Sheets guide.

In Python, matplotlib will do it in one argument. plt.hist(data, bins=5, weights=np.ones(len(data)) / len(data)) gives proportions, and density=True gives the density version described above. The Python guide covers both.

Before you build one

How many bins you choose changes every proportion in the table, so it is worth a minute of thought. The bin count guide walks through the common rules. Once the chart is drawn, the shape catalogue helps you name what you are looking at.

Frequently asked questions

What is a relative frequency histogram?
A histogram where each bar shows the proportion of data in that bin (count divided by total, as a percent) instead of the raw count. The bars add up to 100 percent.
How is it different from a regular histogram?
The shape is identical. Only the y-axis changes, from counts to proportions. That lets you compare datasets of different sizes on the same scale.
How do I calculate relative frequency?
Divide the frequency of each bin by the total number of values, then multiply by 100 to get a percent. For a bin holding 11 of 30 values, that is 11 divided by 30, or 36.7 percent. The tool on this site does it for you.
Should the relative frequencies add up to 1 or to 100?
Both are correct, and they are the same thing. As decimals they sum to 1, and as percentages they sum to 100. Pick one and label the axis to match. If the total misses by a little, it is usually rounding; if it misses by a lot, a value has been dropped or double counted.
Is a relative frequency histogram the same as a density histogram?
No. A density histogram divides by the bin width as well, so the total area is 1 rather than the total height. With equal-width bins the two look the same apart from the axis numbers. With unequal bins, only the density version is honest.
What is cumulative relative frequency?
A running total of the proportions as you move left to right, ending at 100 percent. It answers questions like what share of the data falls below a cutoff. There is more on it in the guide to frequency, relative frequency and cumulative frequency.