help-calc

06 Statistics and Data

Class Limits Calculator: Find Class Boundaries

Card 06-0146 · Updated · Standard formula, shown below

Class width 10
Lower boundary
9.5
Result, rounded to 1 decimal place
Upper boundary
19.5
Result, rounded to 1 decimal place
Lower class limit
10
Input
You enter
Lower class limit, Upper class limit, Number of classes
You get
Class width, Lower boundary, Upper boundary
Rounding
0 dp · 1 dp

This calculator works out the class limits, class boundaries, and class width for a grouped frequency distribution. You enter the lower and upper limits of a class interval and the number of classes, and you get the class boundaries (the true limits) and the class width. Class boundaries are essential for correctly drawing histograms and calculating statistics like the mean and median from grouped data.

Formula

The class width (for integer data) is the difference between the upper and lower limits plus one:

Class width = Upper limit − Lower limit + 1

Class boundaries are the midpoints between the upper limit of one class and the lower limit of the next class. For integer data, they are found by subtracting 0.5 from the lower limit and adding 0.5 to the upper limit:

Lower boundary = Lower limit − 0.5
Upper boundary = Upper limit + 0.5

If your data are continuous (like measurements in inches or grams), the boundary is the exact midpoint between the upper limit of one class and the lower limit of the next. For example, if one class is 10–19 and the next is 20–29, the boundary is 19.5.

Worked Example

Using the default values: lower limit = 10, upper limit = 19, number of classes = 5.

  1. Class width = 19 − 10 + 1 = 10
  2. Lower boundary = 10 − 0.5 = 9.5
  3. Upper boundary = 19 + 0.5 = 19.5

So the class interval 10–19 has boundaries 9.5–19.5 and a width of 10. The calculator shows the same: width = 10, lower boundary = 9.5, upper boundary = 19.5.

Why Class Limits Matter

When you group raw data into classes, you lose the exact values. Class limits are the smallest and largest values that can belong to a class. For example, if you have test scores from 0 to 100 and you create classes of width 10, the first class might be 0–9, the second 10–19, and so on. The limits are the integers at the ends.

Class boundaries are the real numbers that separate classes. They are used because the gap between the upper limit of one class and the lower limit of the next is not always a whole number. For continuous data, a value like 19.5 is the true dividing line between the class 10–19 and 20–29. Boundaries are essential for drawing histograms where bars must touch.

How to Choose Class Limits

Choosing good class limits depends on your data and its range. Here are the common steps:

  • Find the range: maximum value − minimum value.
  • Decide the number of classes (usually 5 to 20, depending on sample size).
  • Divide the range by the number of classes to get the approximate class width.
  • Round up to a convenient number (like 5, 10, or 20).
  • Start the first class at or below the minimum value, then add the width to get the next lower limit.

For example, if your data range from 12 to 87 and you want 6 classes, the range is 75, so the width is 75/6 = 12.5, which you round up to 13. Starting at 12, your lower limits would be 12, 25, 38, 51, 64, and 77. The upper limits are one less than the next lower limit (for integer data).

Common Mistakes and Misconceptions

A frequent error is confusing class limits with class boundaries. Limits are the stated values (e.g., 10 and 19), while boundaries are the true continuous values (9.5 and 19.5). Another mistake is using the wrong class width: for integer data, the width is upper − lower + 1, not just upper − lower. For example, the class 10–19 contains 10 integers (10, 11, …, 19), so its width is 10, not 9.

When data are continuous (e.g., weights measured to the nearest kilogram), the boundaries are the midpoints between the upper limit of one class and the lower limit of the next. If the limits are 10–19 and 20–29, the boundary is 19.5. But if the data are measured to the nearest 0.1, the boundary would be 19.95. Always consider the precision of your measurements.

Using Boundaries in Histograms and Statistics

In a histogram, bars are drawn using class boundaries on the horizontal axis, not the limits. This ensures there are no gaps between bars. The height of each bar represents the frequency (or relative frequency) of that class.

Class boundaries are also used when calculating the mean and median from grouped data. For the median, you need the lower boundary of the median class. For the mean, you use the class midpoint (the average of the lower and upper boundaries) as a representative value for each class.

Limits of This Calculator

This calculator assumes integer data (whole numbers). If your data are continuous and measured to a decimal place, the boundaries will be slightly different. For example, if measurements are to the nearest 0.1, the boundary would be 0.05 above the upper limit, not 0.5. The calculator also assumes that classes are consecutive and have equal width, which is the standard for grouped frequency distributions.

For unequal class widths, you would need to calculate boundaries individually. Also, the number of classes is an input because it does not affect the boundary calculation for a single class, but it is useful for planning the full distribution.

Frequently Asked Questions

What is the difference between class limits and class boundaries?

Class limits are the stated endpoints of a class interval (e.g., 10 and 19). Class boundaries are the true continuous values that separate classes (e.g., 9.5 and 19.5). Boundaries are always 0.5 below the lower limit and 0.5 above the upper limit for integer data.

How do I find the class width if the data are continuous?

For continuous data, the class width is simply the difference between the lower limits of two consecutive classes (e.g., 20 − 10 = 10). For integer data, you add 1 because the classes include both endpoints.

Why do we subtract 0.5 to get the lower boundary?

Because the lower limit represents the smallest value that rounds to that class. For integer data, any value from 9.5 to 19.5 would round to a value between 10 and 19, so the true boundary is 9.5.

Can class boundaries be negative?

Yes, if your data include negative values. For example, a class from −10 to −1 has a lower boundary of −10.5 and an upper boundary of −0.5. The calculator handles negative limits correctly.

What if my data are measured to the nearest 0.1?

Then you subtract 0.05 for the lower boundary and add 0.05 for the upper boundary. For example, a class of 10.0–19.9 has boundaries 9.95 and 19.95. This calculator uses 0.5 for integer data, so adjust manually for decimal precision.

Related

Formula used
in lower | Lower class limit | - | 10 | -999999 | 999999
in upper | Upper class limit | - | 19 | -999999 | 999999
in n | Number of classes | - | 5 | 1 | 1000
out width | Class width | - | (upper - lower + 1) | 0
out lower_b | Lower boundary | - | lower - 0.5 | 1
out upper_b | Upper boundary | - | upper + 0.5 | 1

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.

More on this shelf

The whole Statistics and Data shelf →