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

  1. Paste your data, or enter the minimum and maximum.
  2. Enter the number of classes (Sturges' rule is suggested).
  3. Read the class width and the frequency table.

What you enter

What you get

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

References

Related reading

More Statistics

All free tools · By Dr. Zubair Khalid, DVM, MS, PhD.