Class Width Calculator

Class Width Calculator

Work out the class width for a grouped frequency table from the smallest value, largest value and number of classes, with the full set of class limits, boundaries and midpoints.

Class width = (max − min) ÷ classes, rounded up

Data recorded to:
Enter the smallest and largest values and how many classes you want

What Is Class Width?

Class width is the size of each group in a grouped frequency table: the difference between the lower limits of two neighbouring classes. With classes 41–50, 51–60 and so on, the width is 10.

To find it, divide the range of the data by the number of classes you want, then round up. Rounding up, never down, guarantees the classes stretch far enough to hold the largest value.

Each class has limits, the smallest and largest values that can be recorded in it, and boundaries, which sit halfway between one class's upper limit and the next class's lower limit. The boundaries close the gaps so a histogram's bars can touch.

Class Width Formula

As given in OpenStax Introductory Statistics, section 2.2. See Sources.

1. Divide the range

width = (max − min) ÷ number of classes

2. Round up to the data's precision

9.5 → 10 · if the division is already exact, add one unit

With whole-number limits, 3 classes of exactly 10 from 0 would be 0–9, 10–19 and 20–29, leaving 30 out. Adding one unit fixes that.

3. Limits, boundaries and midpoints

upper limit = lower limit + width − unit · boundary = limit ± unit ÷ 2 · midpoint = (lower + upper) ÷ 2

Worked Example: Grouping Exam Marks Into 6 Classes

Given:
Whole-number exam marks run from 41 to 98. The teacher wants 6 classes.
Step 1:
Range ÷ classes:
(98 − 41) ÷ 6 = 9.5
Step 2:
Round up to a whole mark:
width = 10 · 6 × 10 = 60 covers the range of 57 ✓
Step 3:
Build the classes from 41:
41–50, 51–60, 61–70, 71–80, 81–90, 91–100
Result:
Class width 10

The first class has boundaries 40.5–50.5 and midpoint 45.5. The last class, 91–100, runs past 98, which is fine: empty room at the top is better than a value with nowhere to go.

Class Width for Different Numbers of Classes

The exam marks (41 to 98) with 5 to 10 classes.

Raw and rounded class widths for 5 to 10 classes
ClassesRange ÷ classesWidthFirst classLast class
511.41241–5289–100
69.51041–5091–100
78.14941–4995–103
87.13841–4897–104
96.33741–4797–103
105.7641–4695–100

Common Class Width Mistakes

  • Rounding down. 9.5 rounded to 9 gives six classes reaching only 94, so 95 to 98 have nowhere to go.
  • Reading width from one class's limits. 41–50 looks like a width of 9, but it holds ten whole numbers. Subtract consecutive lower limits instead: 51 − 41 = 10.
  • Mixing limits and boundaries. Limits are what you record (41, 50); boundaries (40.5, 50.5) are for drawing and for continuous calculations.
  • Ignoring the data's precision. Times to 0.1 s need limits like 12.0–13.9 and boundaries at 11.95, not whole-number rules.

Class Width FAQs

How do you calculate class width?

Subtract the smallest value from the largest, divide by the number of classes, and round up.

Why always round up?

Rounding down makes the classes too narrow to reach the largest value.

How many classes should I use?

Usually 5 to 20. Sturges’ rule, log₂ n + 1, is a common starting point.

What is the difference between class limits and boundaries?

Limits are the smallest and largest recordable values in a class. Boundaries are halfway between neighbouring classes, so there are no gaps.

How do I find the class midpoint?

Average the lower and upper limits: (41 + 50) ÷ 2 = 45.5.

Can I choose a rounder width?

Yes. Widths of 5, 10 or 25 make tables easier to read. Any width at least as large as this one will work.

Does the first class have to start at the minimum?

No, starting at a round number just below it, such as 40, is common and often tidier.

What does “data recorded to 0.1” change?

The rounding unit. Widths round up to the nearest 0.1, limits step by 0.1, and boundaries sit 0.05 either side.

Sources

Related Tools