Calculate histogram bin width and class intervals for frequency distributions.
Last updated: March 2026
| Sample Size (n) | Square Root Rule | Sturges' Rule | Rice Rule | Recommended |
|---|---|---|---|---|
| 25 | 5 | 5 | 5 | 5 |
| 50 | 7 | 6 | 7 | 6–7 |
| 100 | 10 | 8 | 9 | 8–10 |
| 200 | 14 | 9 | 12 | 10–12 |
| 500+ | 22+ | 10 | 17+ | 12–20 |
Class width is the size of each interval (bin) in a frequency distribution or histogram. It represents the range of values contained within each class interval. Choosing the right class width is critical for creating informative histograms and frequency distributions.
Too small a class width produces many narrow bins, making the histogram cluttered. Too large a class width produces few wide bins, losing detail from the data. The class width calculation follows the formula: Class Width = Range ÷ Number of Classes, rounded up to the next whole number.
Class intervals are typically left-inclusive and right-exclusive (e.g., [10, 15), [15, 20)) to avoid overlap. However, for the last class, the upper bound is inclusive.
Test scores range from 45 to 98. Create 6 classes.
Rounding up ensures all data points fit within the class intervals. Rounding down might leave some high values without a class.
Use that number as-is. No rounding is needed. For example, if raw width = 10.0, use class width = 10.
While mathematically possible, class widths are typically whole numbers for simplicity. Use the rounding method to convert to integers.
Range is the difference between the maximum and minimum values in the dataset: Range = Max - Min. It represents the total spread of your data.
Use the Square Root Rule (k = √n), Sturges' Rule, or Rice Rule as guidelines. For most datasets, 5-20 classes works well.
Outliers can affect the range and thus class width. Consider the context—include them naturally or separately if they're truly anomalous.
Related Tools