Skip to content
ENExplore Calculators

Histogram Class Width Calculator

Work out histogram class width instantly with clear inputs, formula shown and shareable results.

About Histogram Class Width Calculator

Sturges' rule suggests 1 + log₂n classes and the Rice rule 2∛n. Dividing the range by the class count gives the width, which is usually then rounded up to a convenient value.

Formulas

Sturges' rule

classes = ⌈1 + log₂n⌉, width = range / classes

Rice rule

classes = ⌈2·∛n⌉

Worked example

With the default values below, Histogram Class Width Calculator returns Class width using Sturges' rule of 10.714286. Change any input above and every figure here is recalculated in your browser.

Inputs used

Smallest value
12
Largest value
87
Number of observationsminimum 1
60

Results

Class width using Sturges' rule
10.714286
Classes by Sturges' rule
7
Classes by the Rice rule
8
Range of the data
75.000000

Step by step

  1. 1Values used
  2. 2Sturges' rule
  3. 3Rice rule
  4. 4Class width using Sturges' rule= 10.714286
  5. 5Classes by Sturges' rule= 7
  6. 6Classes by the Rice rule= 8
  7. 7Range of the data= 75.000000

Assumptions and limits

  • The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 6 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

For 60 observations spanning 12 to 87?

Sturges gives 7 classes of width about 10.71, so 11 or even 15 would be tidy choices.

Does the class count matter?

Very much. Too few hides structure and too many produces a spiky, noisy histogram.

Histogram Class Width Calculator | Calcrivo