Class Width Calculator

Enter your dataset's maximum value, minimum value, and number of classes to calculate the class width for your frequency table or histogram. The Class Width Calculator applies the formula (Max − Min) / n and also returns the range and suggested class intervals so you can structure your data distribution correctly.

The largest value in your dataset.

The smallest value in your dataset.

How many class intervals you want in your frequency table.

Results

Class Width

--

Range (Max − Min)

--

Rounded Class Width

--

Number of Classes

--

Class Intervals Overview

Results Table

Frequently Asked Questions

What is class width?

Class width is the difference between the upper and lower boundaries of a single class interval in a frequency distribution. When all classes have equal width, it equals (Maximum − Minimum) / Number of Classes. It is also described as the difference between the lower limits of two consecutive classes.

How do I calculate class width?

Use the formula: Class Width = (Max − Min) / n, where Max is the largest value in the dataset, Min is the smallest value, and n is the desired number of classes. For example, if Max = 45, Min = 0, and n = 9, the class width is 45 / 9 = 5.

Why is class width important?

Class width determines how data is grouped in a frequency table or histogram. A well-chosen class width reveals meaningful patterns in the data distribution — it balances granularity with readability, making trends easier to spot and interpret.

What happens if I choose a class width that's too large or too small?

A class width that is too large lumps too many values together, hiding important variation in the data. One that is too small creates too many narrow classes with very few observations each, making the distribution hard to interpret. Aim for 5–20 classes as a general guideline.

What is the range of a dataset?

The range is simply the difference between the maximum and minimum values in a dataset: Range = Max − Min. It represents the total spread of your data and is the numerator in the class width formula.

Should I round the class width?

Yes, in practice it is common to round the class width up to a convenient whole number or round number. This ensures class boundaries are neat and easy to work with, even if it means the last class extends slightly beyond the maximum value.

What is the difference between class width and class interval?

Class width refers to the numeric size of each class (e.g., 5 units wide), while a class interval refers to the actual range a class covers (e.g., 10–15). They are closely related — the class width is the length of any given class interval.

How many classes should I use in a frequency table?

A common rule of thumb is to use between 5 and 20 classes. Sturges' rule suggests k = 1 + 3.322 × log₁₀(n), where n is the number of data points. Fewer classes are used for smaller datasets, and more classes for larger datasets.

More Statistics Tools