How to use the Histogram chart tool
- Paste your values under Numbers, separated by commas or spaces. Line breaks and tabs also work as separators.
- Enter a whole number from 1 to 80 under Number of bins.
- Select Build histogram, or select Example to chart eight sample values in five bins.
- Read one row per bin in the Result box: the interval, a bar and the number of values that fell inside it.
- Select Copy and paste the chart somewhere that uses a monospace font so the rows stay readable.
How the histogram bins are calculated
The tool finds the smallest and largest value, then divides that range by the number of bins to get one shared bin width. The first bin starts at the minimum, and each following bin starts where the previous one ends. A value goes into the bin given by the whole part of (value - minimum) / width.
Every interval includes its lower edge and excludes its upper edge, written with a square bracket and a round one, as in [2.4, 3.8). The last bin is the exception: it is closed on both sides so the maximum value has a home. Edge labels are rounded to 12 significant digits to hide floating-point noise.
Bars are scaled to the fullest bin, which always gets 30 blocks. Other bins get their share of 30, rounded up, so a bin with at least one value shows at least one block and an empty bin shows none.
Worked example with five bins
The values 1, 1, 2, 3, 3, 4, 7, 8 span from 1 to 8. With five bins the width is (8 - 1) / 5 = 1.4. Three values fall below 2.4, two fall in the next bin, the single 4 lands in [3.8, 5.2), nothing lies between 5.2 and 6.6, and 7 and 8 share the last bin.
[1, 2.4) ██████████████████████████████ 3
[2.4, 3.8) ████████████████████ 2
[3.8, 5.2) ██████████ 1
[5.2, 6.6) 0
[6.6, 8] ████████████████████ 2Accepted input and error messages
Separators are commas and any whitespace, alone or combined. The parser is strict about everything else.
- Values may be integers, decimals, negative numbers or scientific notation such as 1e3.
- Do not use thousands separators. The text 1,000 is read as the two values 1 and 0.
- An entry that is not a finite number, including the empty entry left by a leading or trailing comma, stops the run with: Enter a finite observation.
- The bin count must be a whole number from 1 to 80. Anything else returns: Bins must be a whole number from 1 to 80.
- If every value is identical there is no range to divide, so the tool prints a single line such as 5: 3 observations.
- A value on a bin edge can land in the lower bin through floating-point rounding. With 0.1, 0.2, 0.3, 0.4 in three bins, 0.2 is counted in the first bin.
Choosing a number of bins
The bin count changes what a histogram shows. Too few bins merge separate peaks into one wide bar. Too many leave most bins with zero or one value. This tool does not pick a count for you, so try two or three settings and compare.
Two common starting points are the square root of the number of values, and Sturges' rule, which is 1 plus the base-2 logarithm of the count, rounded up. For 100 values those give 10 and 8 bins.
Frequently asked questions
Can I download the histogram as an image?
No. The result is text made of block characters, with a Copy button and no Download link. To get a picture, paste the text into a document that uses a monospace font and take a screenshot.
Why do the bins start at my smallest value and not at zero?
The range is taken from the data: the first bin starts at the minimum and the last ends at the maximum. There is no setting for custom edges, and adding an extra value to stretch the range would also add it to the counts.
How many numbers can I paste?
The code sets no limit on the number of values; only the bin count is capped at 80.
Are my numbers sent to a server?
No. The values are parsed and counted by JavaScript in your browser, and the chart is plain text produced on the page. Measurements you paste stay on your device.