How this calculator works
The smallest and largest observations define the outer edges. Internal bins are left-closed and right-open; the last also contains the largest value. Count heights add to n, relative heights add to one, and density heights multiplied by width add to one. The table supplies bar edges and heights for plotting. Constant data require a separately chosen display range and are rejected here.
Formula
width = (max-min)/k; relative height_i = f_i/n; density height_i = f_i/(n × width).
Worked example
Data 0, 1, 2, 3, 4 with two bins give edges [0,2) and [2,4], counts 2 and 3, relative heights 0.4 and 0.6, and density heights 0.2 and 0.3.
Advertisement
Frequently asked questions
Can the chart shape change with bin count?
Yes. Too few bins hide detail; too many emphasise random variation.
Why can density be greater than one?
Density is probability per measurement unit. Bar area, rather than height alone, is the probability share.
Is a drawn histogram returned?
The result is a table of exact edges and heights for creating the histogram.