Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Class Width
18
size of each class interval
Range (Max − Min) 90
Number of Classes 5

What Is Class Width?

Class width is the size of each interval (or "class") when you organize raw data into a grouped frequency distribution. Choosing a consistent class width lets you build a tidy histogram or frequency table where every bin spans the same range of values, making patterns in the data easy to see.

Number line divided into equal-width class intervals between a minimum and maximum value
Class width is the equal size of each interval spanning from the minimum to the maximum value.

How to Use This Calculator

Enter three values: the maximum value in your data set, the minimum value, and the number of classes (bins) you want. The calculator subtracts the minimum from the maximum to find the range, divides by the number of classes, and rounds the result up to the next whole number so that every data point fits inside a class.

The Formula Explained

The class width w is computed as $$w = \left\lceil \frac{\text{max} - \text{min}}{k} \right\rceil$$ where k is the number of classes and \(\lceil\ \rceil\) means "round up to the nearest integer." Rounding up (rather than down) guarantees the classes together cover the entire data range; rounding down could leave the largest value outside the final bin.

Advertisement
Formula breakdown showing range divided by number of classes then rounded up
The formula divides the data range by the number of classes and rounds up to the next whole number.

Worked Example

Suppose your data ranges from a minimum of 10 to a maximum of 100, and you want 5 classes. The range is \(100 - 10 = 90\). Dividing by 5 gives $$90 / 5 = 18$$ which is already a whole number, so the class width is 18. Your classes might then be 10–27, 28–45, 46–63, 64–81, and 82–99.

FAQ

Why round up instead of rounding to the nearest integer? Rounding up ensures the classes span at least the full range so no value is excluded. A slightly larger width is always safe.

How many classes should I choose? A common rule of thumb is between 5 and 20 classes; Sturges' rule suggests \(k = 1 + 3.322 \cdot \log_{10}(n)\), where n is the number of data points.

Can the class width be a decimal? Traditional practice rounds the width up to a whole number for clean class boundaries, which is what this calculator does.

Last updated: