Histogram Maker
Paste numbers or type a frequency table. Get the histogram and the full table: tally, relative, cumulative.
Spaces, commas, new lines or a pasted spreadsheet column. Words are skipped and listed. With semicolons or tabs, 1,5 reads as 1.5. Up to 10,000 values.
10-20 5, [10, 20) 5 or 10 to 20: 5 for classes; 15 4 for a value seen 4 times. Classes like 10-19, 20-29 get boundaries 9.5, 19.5, 29.5.
The classes are the ones you typed.
Chart
Frequency table
Classes, mean, median and mode: the working
How to make a histogram with a frequency table
- Paste your numbers. Any mix of spaces, commas and new lines works, and a column copied from a spreadsheet pastes as it is. Already have counts? Tap Frequency table and type a class and its count per line.
- Leave Classes on Sturges' rule, or set the class width and where the first class starts (useful when your worksheet says "use classes of width 10 starting at 40"), or the number of classes.
- Read the table: class, midpoint, tally marks in groups of five, frequency, relative frequency, cumulative frequency and percent. Untick any column you do not need, then Copy table and paste it into a spreadsheet or document.
- Switch the bars to relative frequency or density, add a frequency polygon or an ogive, then download a PNG or SVG, or print the chart with its table.
How the classes are chosen
Sturges' rule sets the number of classes to k = ⌈log2 n + 1⌉: 20 values give 6 classes, 50 give 7 (log2 50 = 5.64, plus 1 is 6.64, rounded up), 100 give 8, 1,000 give 11 and 10,000 give 15. The page then divides the range by k and rounds the width up to a tidy number (1, 2, 2.5 or 5 times a power of ten) and starts the first class at a tidy value at or below the minimum, choosing them so that there are exactly k classes and the maximum lands in the last one. Every number it used is written out under the table.
Sturges' rule was designed for data that is roughly bell-shaped and fairly small. For skewed data or thousands of values it gives too few classes and can hide detail, so treat it as a starting point and try a chosen width as well.
The boundary rule, midpoints and touching bars
Each class includes its lower boundary and excludes its upper one: [10, 20) holds 10 and 19.99 but not 20, which goes in [20, 30). The last class is closed, [60, 70], so the maximum is counted. A class midpoint is (lower + upper) / 2, so the midpoint of [10, 20) is 15. The bars touch because the classes do: there is no gap on a number line between 19.99 and 20. If your table writes classes with gaps, like 10-19 and 20-29 for whole numbers, the class boundaries sit halfway across the gap at 9.5, 19.5 and 29.5, and the midpoints are 14.5 and 24.5.
A worked example
Take this table of minutes spent on homework: 0-10: 4, 10-20: 9, 20-30: 13, 30-40: 8, 40-50: 3, so n = 37. Relative frequencies are 4/37 = 0.108, 9/37 = 0.243 and so on; the cumulative frequencies are 4, 13, 26, 34, 37. The grouped mean is (4 × 5 + 9 × 15 + 13 × 25 + 8 × 35 + 3 × 45) / 37 = 895 / 37 = 24.19 minutes. The middle value is the 18.5th, which falls in 20-30 (13 values come before it), so the grouped median is 20 + ((18.5 − 13) / 13) × 10 = 24.23 minutes. The modal class is 20-30, with 13.
What it cannot do
- More than 10,000 raw values or 50 classes: past 10,000 numbers only the first 10,000 are used, and the page says so.
- One data set per histogram. To compare two groups, make two histograms with the same class width and start, or use a box plot.
- No normal curve fitting, no skewness or kurtosis and no tests: it describes the data you give it.
- Grouped mean, median and mode are estimates; with raw data the exact mean and median are shown beside them.
- Tally marks are drawn for counts up to 200; above that the tally cell is left blank because nobody counts 1,000 strokes.
- The PNG and SVG use the fonts on the device that opens them (Geist where it is installed, otherwise Helvetica or Arial).
Privacy and what is stored
Your numbers never leave your device: the table and the histogram are worked out and drawn by code in this page, and the downloads are made in the browser. Once you edit, the data and settings are saved in this browser's local storage so a reload keeps them; Clear saved data deletes them in one tap. The page sends an anonymous page-view count and, at most, two fixed words (hist-make, hist-export), never a number or a title.
Questions
How many classes should a histogram have?
A common starting point is Sturges' rule: k = log2(n) + 1, rounded up, where n is the number of values. 20 values give 6 classes, 50 give 7, 100 give 8, 1,000 give 11. The rule assumes roughly bell-shaped data and gives too few classes for very large or very skewed sets, so it is a default, not a law; textbooks usually ask for 5 to 20 classes, and you can set the width or the number yourself.
Which class does a value on a boundary go in?
This maker uses the rule most textbooks and spreadsheet tools use: each class includes its lower boundary and excludes its upper one, written [10, 20). A value of exactly 20 is counted in [20, 30). The last class is closed, [60, 70], so the largest value is always counted.
How do I make a histogram from a frequency table?
Tap Frequency table and type one class and its count per line, such as 10-20 5, or a value and its count, such as 15 4. Classes written with gaps, like 10-19 and 20-29, get their class boundaries halfway across the gap (9.5, 19.5, 29.5), so the bars touch.
How do you find the mean and median from grouped data?
The grouped mean is the sum of frequency times midpoint divided by n. The grouped median is L + ((n/2 − CF) / f) × w, where L is the lower boundary of the class holding the middle value, CF the cumulative frequency before that class, f its frequency and w its width. Both are estimates because every value is treated as if it sat in its class; the page shows the working and, for raw data, the exact mean and median beside them.
What if my classes have different widths?
Then the bar heights show frequency density, frequency divided by class width, and the area of each bar, not its height, stands for its frequency. Drawing plain frequency heights with unequal widths makes wide classes look far bigger than they are, so the page switches to density by itself and says so.