How to Find Class Boundaries, Class Limits and Midpoints
How to find class boundaries: subtract half a unit of the data's precision from each lower class limit and add half a unit to each upper class limit, so 0.5 for whole numbers and 0.05 for data with one decimal place. The class limits are the smallest and largest values a class can hold, and each upper limit is the next lower limit minus one unit. The boundaries close the gaps between the classes so that they touch. The class midpoint is (lower limit + upper limit)/2, which equals the average of the two boundaries.
Last updated · by the simstat.com editorial team · How we write
Three ways to describe a class
A grouped frequency table sorts measurements into classes, intervals of values, and counts how many fall in each. Each class is described by three kinds of numbers:
- the class limits, the smallest and largest values the class can hold as the data were recorded;
- the class boundaries, the points on the number line where one class ends and the next begins;
- the class midpoint, the centre of the class.
The limits are written at the precision of the data, the boundaries half a unit outside them, and the midpoint halfway between.
Lower and upper class limits
The lower class limit is the smallest value that can go into a class, and the upper class limit the largest. Fuel consumption in R’s mtcars data is recorded to one decimal place, so a class with limits 10.4 and 14.3 holds the recorded values 10.4, 10.5, 10.6 and so on up to 14.3.
Jones (n.d.) builds the lower and upper class limits in two steps. The starting point is the lower limit of the first class; “Continue to add the class width to this lower limit to get the rest of the lower limits.” Then, “To find the upper limit of the first class, subtract one from the lower limit of the second class.” Jones’s notes work with whole numbers. For data with decimals the same step is one unit of the data’s precision: 0.1 for one decimal place, 0.01 for two.
Class boundaries close the gaps
Between the upper limit of one class and the lower limit of the next there is a gap of one unit: 14.3 ends one class and 14.4 starts the next. For measured data that gap is not empty. Illowsky and Dean (2023) call heights “continuous data, since height is measured”, and fuel consumption is the same: a car that does 14.34 miles per gallon is recorded as 14.3. The class boundaries split each gap in half, so the classes cover the whole number line without holes. Jones (n.d.) gives the rule: “Find the boundaries by subtracting 0.5 units from the lower limits and adding 0.5 units from [sic] the upper limits” (for whole numbers; half a unit of the precision in general), and adds that “The boundaries are also half-way between the upper limit of one class and the lower limit of the next class.”
Boundaries have one more decimal place than the data, on purpose. Illowsky and Dean (2023) explain that “when the starting point and other boundaries are carried to one additional decimal place, no data value will fall on a boundary.” Every value then lies strictly inside one class, and no rule is needed for ties. The boundaries are also what a histogram is drawn on: it “consists of contiguous (adjoining) boxes” (Illowsky and Dean, 2023), and the bars can touch only if each class ends where the next begins.
The same rule works for counts, which are discrete. For the number of books bought by students, Illowsky and Dean (2023) write: “Because the data are integers, subtract 0.5 from 1, the smallest data value and add 0.5 to 6, the largest data value.”
The formulas
Write s for the first lower limit, w for the class width, u for the precision unit (1 for whole numbers, 0.1 for one decimal) and i = 1, 2, … for the class number. The limits L and U of class i are
The lower and upper boundaries LB and UB lie half a unit outside the limits:
and the midpoint m is the average of either pair:
Two consequences follow. The upper boundary of one class equals the lower boundary of the next, UBi = LBi+1. And the class width is the distance between consecutive lower limits, or between the two boundaries of a class, w = Li+1 − Li = UBi − LBi. The difference Ui − Li is one unit less than the width.
How to find class boundaries step by step
The example uses the default data of our frequency distribution calculator. The class width is taken as given: Sturges’ rule suggests 6 classes, and the range divided by 6, rounded up to the next 0.1, gives a width of 4.0.
Worked example: class limits, boundaries and midpoints for fuel consumption
The data. Fuel consumption of the 32 cars in R’s mtcars data set, in miles per US gallon, from a 1974 issue of Motor Trend magazine (R Core Team, 2024). Values run from 10.4 to 33.9 and are recorded to one decimal, so the unit is 0.1 and half a unit is 0.05. Width 4.0, 6 classes.
Step 1: lower limits. Start at the minimum and add the width: 10.4, 14.4, and so on up to 30.4.
Step 2: upper limits. Subtract one unit from the next lower limit: 14.4 − 0.1 = 14.3. The last class ends at 34.4 − 0.1 = 34.3, above the maximum, 33.9.
Step 3: boundaries. Subtract half a unit from each lower limit and add it to each upper limit: 10.4 − 0.05 = 10.35 and 14.3 + 0.05 = 14.35. The upper boundary of class 1 is the lower boundary of class 2, 14.35.
Step 4: midpoints. Average the limits: (10.4 + 14.3) / 2 = 24.7 / 2 = 12.35. Averaging the boundaries gives the same value: (10.35 + 14.35) / 2 = 24.70 / 2 = 12.35.
Step 5: count. Each car falls strictly inside one pair of boundaries.
| Class limits | Class boundaries | Midpoint | Frequency |
|---|---|---|---|
| 10.4–14.3 | 10.35–14.35 | 12.35 | 4 |
| 14.4–18.3 | 14.35–18.35 | 16.35 | 10 |
| 18.4–22.3 | 18.35–22.35 | 20.35 | 9 |
| 22.4–26.3 | 22.35–26.35 | 24.35 | 4 |
| 26.4–30.3 | 26.35–30.35 | 28.35 | 1 |
| 30.4–34.3 | 30.35–34.35 | 32.35 | 4 |
Open the calculator with its default data and settings and it shows this table, with relative and cumulative frequencies and a histogram drawn on the boundaries. Its explanation of limits, boundaries and midpoints gives the same formulas.
Whole numbers
For whole numbers the unit is 1 and half a unit is 0.5. The gross horsepower of the same 32 cars runs from 52 to 335. With the calculator’s defaults (6 classes, width 48) the first class has limits 52 and 99 (the next lower limit, 100, minus 1), boundaries 51.5 and 99.5, and midpoint 75.5. The second class runs from 100 to 147, with boundaries 99.5–147.5 and midpoint 123.5. The last class, 292–339, ends at the boundary 339.5, and the six frequencies are 9, 8, 8, 3, 3, 1.
The midpoints end in .5 because the width is even. Jones (n.d.) suggests an odd width for whole numbers: “This will guarantee that the class midpoints are integers instead of decimals.”
For data with two decimal places, half a unit is 0.005; for three, 0.0005. Illowsky and Dean (2023): “If the value with the most decimal places is 3.234 and the lowest value is 1.0, a convenient starting point is 0.9995”.
How to find class midpoints
Add the lower and upper class limits and divide by two. Because each boundary moves its limit by the same half unit in opposite directions, the average of the boundaries is the same number. Illowsky and Dean (2023) define the midpoint from the boundaries, (lower boundary + upper boundary)/2; the limits give the same 12.35 for the first fuel-consumption class.
Consecutive midpoints differ by exactly the class width: 12.35, 16.35, and so on up to 32.35.
Estimating the mean from midpoints
When you only have the grouped table, you cannot add up the original values. Illowsky and Dean (2023) put it plainly: “What we must do is estimate the actual mean by calculating the mean of a frequency table”, using the midpoint of each class in place of its values:
where f is the frequency of a class and m its midpoint.
Worked example: the mean of fuel consumption from the grouped table
Multiply each midpoint by its frequency: 12.35 × 4 = 49.40, 16.35 × 10 = 163.50, 20.35 × 9 = 183.15, 24.35 × 4 = 97.40, 28.35 × 1 = 28.35 and 32.35 × 4 = 129.40.
The sum is 651.20, so the grouped mean is 651.20 / 32 = 20.35 miles per gallon.
The raw values add up to 642.9, so the exact mean is 642.9 / 32 = 20.09. The grouped estimate is 0.26 too high.
Here the error is small next to the class width of 4.0, but the grouped mean is still an estimate: it treats every car in a class as if it sat at the midpoint. For horsepower the grouped mean is 150.5 against an exact mean of 146.7. Use the raw data when you have them.
Boundaries, cut points and interval conventions
Not every book or program uses half-unit boundaries. Many cut the number line at chosen values and add a rule for values that land on a cut point. Illowsky and Dean (2023) use one such rule in an example where values do land on the cut points: “A value is counted in a class interval if it falls on the left boundary, but not if it falls on the right boundary.” Geraghty (n.d.) writes his classes as “Min to under Min + IW”, where IW is the interval width. Both are half-open intervals [a, b).
R’s default is the other way round. Its documentation for hist() says that with right = TRUE (the default), “the
histogram cells are intervals of the form (a, b], i.e., they include their right-hand endpoint, but not their left
one, with the exception of the first cell when include.lowest is TRUE”, and cut() also has right = TRUE by default; right = FALSE gives [a, b) (R Core Team, 2024).
The convention matters only when a value sits on a cut point. Use the lower limits 10.4, 14.4, …,
34.4 as cut points for the fuel data and 4 cars sit on one: 2 at 10.4, the lowest
cut point, and 2 at 30.4. With [a, b) intervals the counts are 4, 10, 9, 4, 1, 4, the same
as the table above. With R’s (a, b] they become 4, 10, 9, 4, 3, 2, because the cars at 30.4 move down a
class. hist() keeps the cars at 10.4 only because its default is include.lowest = TRUE;
cut() defaults to include.lowest = FALSE and returns NA for them. With the half-unit boundaries 10.35, 14.35, … as cut
points, both conventions give 4, 10, 9, 4, 1, 4, since no value can fall on a boundary.
Open-ended and unequal classes
Some tables end with an open class such as “65 and over”. Jones (n.d.) allows this for the first or last class: “It is possible to have an ‘below …’ or ‘… and above’ class. This is often used with ages.” An open class has only one limit, so it has no midpoint, and a grouped mean needs a value assumed for it; say which value you used.
Jones (n.d.) also requires classes of equal width, with “The exception here is the first or last class.” With
unequal widths, R’s hist() draws a density histogram by default, “a plot of area one, in which the area of the
rectangles is the fraction of the data points falling in the cells” (R Core Team, 2024).
How to report class limits and boundaries
State the precision of the data, the width and the first lower limit, and say whether the table shows limits or boundaries:
Fuel consumption of the 32 cars, recorded to 0.1 mpg, was grouped into 6 classes of width 4.0 mpg with limits 10.4–14.3 to 30.4–34.3 (class boundaries 10.35 to 34.35). The mean estimated from the class midpoints was 20.35 mpg; the exact mean was 20.09 mpg.
Give a computed mean one decimal place more than the data, the rounding rule of Illowsky and Dean (2023): “carry your final answer one more decimal place than was present in the original data.” If you used cut points rather than half-unit boundaries, say which end of each interval is closed.
To reproduce the table in R, use the boundaries as breaks:
hist(mtcars$mpg, breaks = seq(10.35, 34.35, by = 4), plot = FALSE) returns the counts and the midpoints above.
Common mistakes
Confusing class limits with class boundaries. Limits are values the data can take (10.4–14.3); boundaries lie between possible values (10.35–14.35). A table that labels 10.35–14.35 as “limits” mixes the two.
Finding the width as upper limit minus lower limit. 14.3 − 10.4 = 3.9, one unit short of the width. The width is the step between lower limits, 14.4 − 10.4, or between the boundaries of a class, 14.35 − 10.35: both give 4.0.
Mixing limits and boundaries in the midpoint. The average of the two limits and the average of the two boundaries agree, but (lower limit + upper boundary)/2 does not: (10.4 + 14.35) / 2 = 12.375, not 12.35.
Setting the upper limit at the next lower limit. 10.4 + 4.0 = 14.4 is the lower limit of the second class. Writing the first class as 10.4–14.4 puts a value of 14.4 in two classes.
Writing boundaries at the data’s precision. Boundaries such as 14.3 or 14.4 are possible data values, so some values fall on them and need an extra rule. One more decimal place avoids the problem.
Where to go next
Our class width guide explains the width, and the statistics hub lists more. Our frequency distribution calculator builds the full table from your data. For quartiles and a box plot of the same data, use the IQR calculator. For a histogram of sample means rather than of raw values, see the guide to the sampling distribution.
References
- Illowsky, B. & Dean, S. (2023). Introductory Statistics 2e, Section 2.2: Histograms, Frequency Polygons, and Time Series Graphs. OpenStax, Rice University.
- Illowsky, B. & Dean, S. (2023). Introductory Statistics 2e, Section 2.5: Measures of the Center of the Data. OpenStax, Rice University.
- Illowsky, B. & Dean, S. (2023). Introductory Statistics 2e, Section 1.3: Frequency, Frequency Tables, and Levels of Measurement. OpenStax, Rice University.
- Jones, J. (n.d.). Statistics: Grouped Frequency Distributions (Math 170 lecture notes). Richland Community College (undated web page, accessed December 2026).
- Geraghty, M. A. (n.d.). 2.5.3: Grouping Numeric Data, in Inferential Statistics and Probability: A Holistic Approach. LibreTexts (undated, accessed December 2026).
- R Core Team (2024). R documentation: hist (Histograms), cut (Convert Numeric to Factor) and mtcars (Motor Trend Car Road Tests). R Foundation for Statistical Computing.
Try it
- Frequency distribution calculator: table and histogram: Group numbers into classes: class width with the working, limits, boundaries, midpoints, relative and cumulative frequencies, and a histogram.
- IQR calculator: quartiles, fences and outliers: Quartiles by the TI-84, Excel and R methods, the interquartile range, Tukey fences, outliers and a box plot.
Related reading
- How to Find Class Width: Formula, Rounding and Decimals
- How to Find IQR (Interquartile Range): Formula and Examples
- What Is a Sampling Distribution? Central Limit Theorem and Standard Error
- Correlation vs Causation: Why Correlation Does Not Imply Causation
- Effect Size: Definition, Cohen's d and How to Interpret It
- How to Calculate the Correlation Coefficient (Pearson's r)
- More on statistics