This calculator finds the class width for a grouped frequency table. Enter the largest and smallest values in the data and the number of classes you want; you get the exact width and the width rounded up to a whole number, which is what most textbooks use.
Formula
Class width = (largest − smallest) ÷ number of classes, rounded up to the next whole number (or to a convenient unit for decimal data).
Worked Example
Data from 42 to 97 in 7 classes.
- Range = 97 − 42 = 55
- 55 ÷ 7 = 7.857
- Rounded up: class width = 8
- Classes: 42-49, 50-57, 58-65, 66-73, 74-81, 82-89, 90-97
How to read the result
Start the first class at the smallest value (or a little below it) and add the width each time. Rounding up makes sure the classes cover the whole range. Some textbooks say to add 1 when the division comes out exact, so that the largest value is not on a boundary; check your course.
Limits and common mistakes
- The largest value must be greater than the smallest.
- 5 to 20 classes is usual; too few hide the shape, too many leave empty classes.
Frequently Asked Questions
Why round up?
So that the classes together reach the largest value.
How many classes should I use?
Often 5-20; Sturges’ rule suggests 1 + 3.3 log₁₀ n.
What if the width comes out exact?
Some courses add 1 to it; follow your textbook.
What are class limits?
The smallest and largest values that can go in each class.
Formula used
in mx | Largest value | - | 97 | - in mn | Smallest value | - | 42 | - in k | Number of classes | classes | 7 | 1 | 100 out cw | Class width (rounded up) | - | ceil(round((mx - mn) / k, 6)) + 0 * sqrt(mx - mn) | 0 out raw | Exact width | - | (mx - mn) / k | 3
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
- Coefficient of Variation (CV) Formula and Calculator19.56 %
- How to Calculate the Empirical Rule (68-95-99.7)85.00