Class Width Calculator
Class width, class limits, midpoints and frequencies for a frequency table.
Class width = (maximum − minimum) ÷ number of classes, rounded up. For data from 12 to 72 in 5 classes, (72 − 12) ÷ 5 = 12, which is bumped to 13 so the maximum fits in the last class.
Free, runs in your browser. Nothing you enter is uploaded.
How to use it
- Paste your data, or enter the minimum and maximum.
- Enter the number of classes (Sturges' rule is suggested).
- Read the class width and the frequency table.
What you enter
- Data, or minimum and maximum
- Number of classes
What you get
- Class width
- Class limits and midpoints
- Frequencies
- Suggested number of classes
Formula
Class width = ⌈(max − min) ÷ k⌉ | Sturges: k = 1 + log₂(n) | Midpoint = (lower + upper) ÷ 2
Worked example
Input: 15 values from 12 to 72, 5 classes
Result: Class width 13
Classes 12–25, 25–38, 38–51, 51–64, 64–77 cover all values.
Questions
How do you find the class width?
Subtract the smallest value from the largest, divide by the number of classes you want, and round up to a convenient number.
Why round the class width up?
Rounding down would leave the largest values outside the last class. Many textbooks also add 1 when the division is exact for the same reason.
How many classes should I use?
Usually 5 to 20. Sturges' rule gives k = 1 + log₂(n), so 100 values suggest about 8 classes.
How do you find a class midpoint?
Add the lower and upper class limits and divide by 2.
Limitations
- Rounding conventions differ between textbooks; check which one your course uses.
References
Related reading
- How to Calculate Class Width (Formula and Examples)
- How to Identify Class Midpoints in a Frequency Distribution
More Statistics
- Standard Deviation Calculator
- Mean, Median & Mode Calculator
- Variance Calculator
- Z-Score Calculator
- P-Value Calculator
- Confidence Interval Calculator
- T-Test Calculator
- Chi-Square Test Calculator
- Correlation Coefficient Calculator
- Linear Regression Calculator
- Normal Distribution Calculator
- Probability Calculator
All free tools · By Dr. Zubair Khalid, DVM, MS, PhD.