πŸ“¦What is a Bin?
β–Ό

In the previous topic, we learned that a histogram groups numbers into ranges. Each of these ranges is called a bin. Think of a bin as a small box that holds all the values that fall inside a certain range.

For example, if we are looking at student heights from 140 cm to 180 cm, we can use bins of 5 cm:

  • 140–144 cm
  • 145–149 cm
  • 150–154 cm
  • … and so on, up to 180 cm.

Each student's height goes into exactly one bin. The number of students in each bin is the frequency of that bin.

What is Bin Width?

The bin width is the size of each range. In the example above, the bin width is 5 cm because each bin covers 5 cm. If we use ranges of 10 cm instead (140–149, 150–159, …), the bin width is 10.

πŸ’‘
Key Idea

Choosing the bin width is one of the most important steps in building a histogram. The bin width changes the shape of the chart and what we can learn from it.

βš–οΈChoosing the Right Bin Width
β–Ό

If the bin width is too small or too large, the histogram becomes hard to read. We need to find a balance between showing enough detail and keeping the picture clear.

Bin width too small

The chart will have too many bars. Each bar will be very short and the histogram will look full of spikes. It is hard to see the overall shape because there is too much detail.

Bin width too large

The chart will have only a few wide bars. We will lose the details and may miss important patterns. The histogram becomes too simple and tells us very little about the data.

The right balance

A good bin width gives us a clear shape with enough detail to spot patterns, but not so much detail that the chart becomes noisy. As a starting point, try to use between 5 and 15 bins for most datasets.

Example

If you are looking at the test scores of 30 students, using 30 bins (one for each score) would be too much. Using only 2 bins (Pass / Fail) would hide all the details. A bin width that gives you 5 to 8 bars usually works well.

πŸ“How to Calculate Bin Width
β–Ό

One simple way to find the bin width is to use the range of the data. The range is the difference between the largest value and the smallest value.

The Range Formula

Bin Width = (Maximum βˆ’ Minimum) Γ· Number of Bins

Steps to Use the Formula

  1. Find the maximum and minimum values in your data.
  2. Subtract the minimum from the maximum to get the range.
  3. Decide how many bins you want (usually between 5 and 15).
  4. Divide the range by the number of bins to get the bin width.
  5. Round up the result to a nice round number, if needed.
Worked Example

Suppose the test scores in your class go from 40 (lowest) to 100 (highest), and you want 6 bins.

  • Range = 100 βˆ’ 40 = 60
  • Bin Width = 60 Γ· 6 = 10
  • So your bins are: 40–49, 50–59, 60–69, 70–79, 80–89, 90–100
πŸ“
Note

This is just a starting point. After drawing your histogram, you may want to try a slightly smaller or larger bin width to see which one shows the data most clearly.

πŸ”Other Ways to Decide Bin Width
β–Ό

The range method is the simplest way to choose a bin width, but it is not the only one. Statisticians have also created other rules that work better for large datasets. You do not need to use them now, but it is good to know they exist.

1. Square Root Rule

The number of bins is roughly the square root of the number of values in your dataset.

Number of Bins β‰ˆ √(Number of Values)

Example: For 100 values, you would use about √100 = 10 bins.

2. Sturges' Rule

This rule is often used in textbooks for medium-sized datasets.

Number of Bins = 1 + 3.322 Γ— log(Number of Values)

Example: For 100 values, you would use about 1 + 3.322 Γ— log(100) β‰ˆ 8 bins.

3. Freedman–Diaconis Rule

This rule is more advanced and uses something called the interquartile range. It is often used by computer programs to choose the bin width automatically. You will see it later in your studies.

4. Computer-Chosen Bins

Most software (like Excel, Google Sheets, or Python) can choose the number of bins automatically. This is useful, but it is still important to check the chart and adjust the bins if it does not look right.

πŸ’‘
Which Rule Should You Use?

For small school datasets, the simple range method works fine. For larger datasets, software will usually pick a reasonable number of bins for you. There is no single "perfect" bin width β€” try a few and pick the one that tells the clearest story.

🎯Equal vs. Unequal Bins
β–Ό

So far, we have only used equal-width bins, which means every bin has the same width. This is the standard and easiest way to make a histogram.

Why Equal Width is the Standard

When all bins have the same width, the height of each bar shows the count directly, and we can compare the bars fairly. This is why most histograms you will see in your studies use equal-width bins.

When Unequal Bins Can Be Used

Sometimes the data is not spread out evenly. In these cases, using unequal-width bins can be helpful. For example:

  • If most values are small and only a few are very large, using equal bins may waste space on the chart.
  • In some real-world studies (like income or population data), unequal bins are used to focus on important ranges.

The Important Rule for Unequal Bins

If you decide to use unequal-width bins, the height of the bars should not represent the count anymore. Instead, you should use something called frequency density:

Frequency Density = Frequency Γ· Bin Width

This makes sure that wide bins do not look more important than narrow ones. The area of each bar (height Γ— width) becomes equal to the frequency, so the comparison stays fair.

⚠️
Important

If you use unequal bins but forget to use frequency density, your histogram will be misleading. Wider bins will look bigger than they really should and people will get the wrong picture of the data.

?
What is the simplest formula to calculate bin width using the range of the data?
  • A bin is a range that holds values, and the bin width is the size of that range.
  • If bins are too small, the histogram becomes too detailed; if too large, important patterns are hidden.
  • The simplest way to find bin width is the range method: (Max βˆ’ Min) Γ· Number of Bins.
  • Other methods exist (Square Root, Sturges, Freedman–Diaconis, or letting software choose).
  • Equal-width bins are the standard, but unequal bins can be used if you switch to frequency density instead of count.
πŸ“šExternal Resources
β–Ό