MECHOWL QUALITY ANALYSIS AI
Histogram Maker: How to Make a Histogram (Number of Classes and Bin Width Chosen Automatically)
Paste measurements to get a histogram with automatic classes, the mean, standard deviation and skewness, and the values outside the specification limits.
Last updated
Your data is not sent. Everything is computed in your browser
Data
Column names in the first row. Tabs or commas, full-width digits, thousands separators and blanks are read.
Read 120 rows and 2 columns.
More settings (Unit, Number of classes, Overlay the normal curve, Chart title and more)
e.g. mm. Written on the chart and the tables.
Empty: automatic (close to the square root of the number of values, 5 to 30).
Empty: Histogram.
e.g. 1–31 Oct 2026. Written on the chart and the report.
Empty: all rows. A value: only the rows with that value.
Result
x̄ 50.046 mm: No values outside the limits
Result of the sample data
No values outside the limits
n = 120, mean 50.046 mm, standard deviation 0.0495 mm, 0 outside the limits (0 above the USL 50.20, 0 below the LSL 49.90)
- Mean x̄
- 50.046 mm
- Standard deviation s
- 0.0495 mm
How to read it
What the chart shows
- The mean is 50.046 mm and the standard deviation 0.0495 mm; the values range from 49.95 to 50.16 mm (median 50.040 mm).
Common misreadings
- The shape looks different with another number or width of classes. When you see two peaks or an isolated island, check it with another number of classes.
- A histogram does not show the time order. Look at changes over time with a control chart.
Next steps
- For two peaks or an isolated island, stratify the data (by machine, material lot or operator) and make the histograms again.
- With specification limits, check the margin to the limits in numbers with the process capability indices.
- Check whether the data can be taken as normal with a normal probability plot.
Numbers
| Number of values n | 120 |
|---|---|
| Mean x̄ | 50.046 mm |
| Standard deviation s | 0.0495 mm |
| Median | 50.040 mm |
| Minimum | 49.95 mm |
| Maximum | 50.16 mm |
| Range R | 0.21 mm |
| Skewness | 0.041 |
| Excess kurtosis (0 for a normal distribution) | −1.096 |
| Number of classes | 12 |
| Class width h | 0.020 mm |
| Values outside the limits | 0 |
Calculation steps
- Mean
x̄ = Σ xᵢ / nn = 120 → x̄ = 50.0459 - Standard deviation
s = √( Σ(xᵢ − x̄)² / (n − 1) )s = 0.04946 - Number of classes and class width
Classes ≈ √n (5 to 30); width = (max − min) ÷ classes, rounded to 1, 2, 2.5 or 5 × 10ⁿ√120 ≈ 10.95, (50.16 − 49.95) → width 0.020, 12 classes (first boundary 49.940) - Counting the classes
Each class is from ≥ to < (a value on a boundary goes to the upper class)1, 8, 14, 17, 12, 16, 9, 19, 16, 6, 1, 1 - Skewness
G₁ = n / ((n − 1)(n − 2)) × Σ((xᵢ − x̄)/s)³, standard error √(6n(n − 1) / ((n − 2)(n + 1)(n + 3)))G₁ = 0.041, standard error 0.221 - Excess kurtosis
G₂ = n(n + 1) / ((n − 1)(n − 2)(n − 3)) × Σ((xᵢ − x̄)/s)⁴ − 3(n − 1)² / ((n − 2)(n − 3))G₂ = −1.096
Frequency table
| From (≥) | To (<) | Frequency | Percentage |
|---|---|---|---|
| 49.940 | 49.960 | 1 | 0.8 % |
| 49.960 | 49.980 | 8 | 6.7 % |
| 49.980 | 50.000 | 14 | 11.7 % |
| 50.000 | 50.020 | 17 | 14.2 % |
| 50.020 | 50.040 | 12 | 10.0 % |
| 50.040 | 50.060 | 16 | 13.3 % |
| 50.060 | 50.080 | 9 | 7.5 % |
| 50.080 | 50.100 | 19 | 15.8 % |
| 50.100 | 50.120 | 16 | 13.3 % |
| 50.120 | 50.140 | 6 | 5.0 % |
| 50.140 | 50.160 | 1 | 0.8 % |
| 50.160 | 50.180 | 1 | 0.8 % |
Mean and standard deviation by stratum
| Machine | n | Mean | Standard deviation |
|---|---|---|---|
| A | 60 | 50.005 | 0.0254 |
| B | 60 | 50.087 | 0.0288 |
The results are reference values based on the data you entered and the formulas and criteria shown. They are not a quality guarantee or a pass/fail decision. The final decision rests with you.
References
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.3.14 Histogram · NIST · Open
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.11 Measures of Skewness and Kurtosis · NIST · Open
- JIS Z 8101-2:2015 Statistics — Vocabulary and symbols — Part 2: Applied statistics (in Japanese) · Japanese Standards Association (JSA)
Standards are shown by number and title only.
Histogram explained
A histogram divides the range of the measurements into classes (bins) and shows the number of values in each class, the frequency, as the height of a bar. It shows the centre, the spread and the shape of the distribution (skewed, two peaks, isolated islands) at a glance, and with the specification limits drawn on it, which side values tend to fall outside. It is one of the seven basic quality tools.
Histogram by hand: step by step
- Collect measurements of the same characteristic (50 to 100 or more is a guideline).
- Find the maximum and the minimum, and choose the number of classes (close to the square root of the number of values).
- Class width = (maximum − minimum) ÷ number of classes; round it to a convenient number in the measurement unit and set the first boundary.
- Count the values in each class to make a frequency table (a value on a boundary goes to the upper class), and draw the bars.
- Add the mean and the specification limits and read the shape: two peaks suggest two conditions mixed; an isolated island, another condition or a measuring error; one side cut off sharply (a cliff), sorting against the limits.
Worked examples
Example 1: Ten values (2 to 8, four classes automatically)
Value 2 3 3 4 4 4 5 5 6 8
x̄ = 44/10 = 4.4. Sum of squared deviations = 26.4 → s = √(26.4/9) = 1.7127. Classes √10 ≈ 3.2 → 5 (the minimum), width (8 − 2)/5 = 1.2 → the convenient 2, first boundary 2. [2, 4) holds 2, 3, 3 (3 values), [4, 6) holds 4, 4, 4, 5, 5 (5 values), [6, 8) holds 6 (1 value) and [8, 10) holds 8 (1 value). Sum of ((xᵢ − x̄)/s)³ = 6.3058 → G₁ = 10/(9 × 8) × 6.3058 = 0.8758.
Example 2: Values exactly on the boundaries and the limits (1 to 5, limits 1 and 5)
Value 1 2 3 4 5
Settings: Upper specification limit, USL (optional) = 5, Lower specification limit, LSL (optional) = 1, Number of classes (bins) = 4
Width (5 − 1)/4 = 1. Each class is from ≥ to <, so 5 falls in [5, 6) and there are 5 classes (1 value each). Values equal to the USL 5 or the LSL 1 are not counted as outside (only above the USL and below the LSL count) → 0 outside. The data are symmetric, so G₁ = 0. Sum of ((xᵢ − x̄)/s)⁴ = 5.44 → G₂ = 5·6/(4·3·2) × 5.44 − 3·16/(3·2) = 6.8 − 8 = −1.2.
Example 3: An isolated island (two values beyond an empty class)
Value 10.1 10.2 10.2 10.3 10.3 10.3 10.4 10.4 10.5 11.2 11.3
√11 ≈ 3.3 → 5 classes, width (11.3 − 10.1)/5 = 0.24 → the convenient 0.25, first boundary 10.00. [10.00, 10.25) 3 values, [10.25, 10.50) 5, [10.50, 10.75) 1 (10.5 is on a boundary, so it goes to the upper class), [10.75, 11.00) 0, [11.00, 11.25) 1, [11.25, 11.50) 1. The 2 values beyond the empty class are shown as an isolated island.
Example 4: USL ≤ LSL (input error)
Value 1 2 3
Settings: Upper specification limit, USL (optional) = 9, Lower specification limit, LSL (optional) = 10
The USL 9 is below the LSL 10. These are not valid limits, so no result is given and the input error is shown.
Example 5: All values equal
Value 5 5 5
The maximum equals the minimum, so the data cannot be divided into classes. The reason is shown and no result is given.
Common mistakes
- Too many or too few classes (too many leave gaps; too few hide the shape).
- Reading the shape of data with different conditions mixed together (machines, lots, operators); stratify them instead.
- A class width finer than the measurement resolution (classes with and without values alternate, giving a comb shape).
FAQ
- How many classes should I use?
- A number close to the square root of the number of values is a guideline, and the automatic setting of this page uses it (5 to 30). You can change the number of classes; check a reading of the shape by seeing whether it looks the same with another number of classes.
- Can I use it without specification limits?
- Yes. The limits are optional. With limits, the lines are drawn and the values outside are counted. The capability indices are on the Process capability (Cp, Cpk) page.
- Is my data sent anywhere?
- No. The calculation and the chart are made in your browser only.
Scope
The frequency distribution of the measurements of one characteristic. All classes have the same width.
Not covered by this tool:
- Classes of different widths.
- Fitting a distribution (Weibull and others).
Excel template: Histogram
A template with the column names and sample values only (no formulas). Enter your values, then copy the range and paste it into the box above.