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.

What each column means

Guessed from the column names. Choose again if a guess is wrong.

The measurements (numbers) of one characteristic. Rows with an empty or text cell are left out.

Line, part, machine, period … Select it to look at one value at a time.

Settings

Drawn as a line; the values above it are counted.

Drawn as a line; the values below it are counted.

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

Histogramn = 120 x̄ = 50.046 mm s = 0.049 mm Class width 0.020 mm Period: Nov 2026Histogramn = 120 x = 50.046 mm s = 0.049 mm Class width 0.020 mm Period: Nov 2026FrequencySpecification limits (LSL, USL)MeanNormal distribution (mean, standard deviation)0510152025Frequency49.9049.9550.0050.0550.1050.1550.20Measurement (mm)LSL 49.90x 50.046USL 50.20

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 n120
Mean x̄50.046 mm
Standard deviation s0.0495 mm
Median50.040 mm
Minimum49.95 mm
Maximum50.16 mm
Range R0.21 mm
Skewness0.041
Excess kurtosis (0 for a normal distribution)−1.096
Number of classes12
Class width h0.020 mm
Values outside the limits0

Calculation steps
  1. Meanx̄ = Σ xᵢ / nn = 120 → x̄ = 50.0459
  2. Standard deviations = √( Σ(xᵢ − x̄)² / (n − 1) )s = 0.04946
  3. Number of classes and class widthClasses ≈ √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)
  4. Counting the classesEach 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
  5. SkewnessG₁ = 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
  6. Excess kurtosisG₂ = 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 (<)FrequencyPercentage
49.94049.96010.8 %
49.96049.98086.7 %
49.98050.0001411.7 %
50.00050.0201714.2 %
50.02050.0401210.0 %
50.04050.0601613.3 %
50.06050.08097.5 %
50.08050.1001915.8 %
50.10050.1201613.3 %
50.12050.14065.0 %
50.14050.16010.8 %
50.16050.18010.8 %
Mean and standard deviation by stratum
MachinenMeanStandard deviation
A6050.0050.0254
B6050.0870.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.

Next tool: Check the margin to the limits with capability indices

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

  1. Collect measurements of the same characteristic (50 to 100 or more is a guideline).
  2. Find the maximum and the minimum, and choose the number of classes (close to the square root of the number of values).
  3. Class width = (maximum − minimum) ÷ number of classes; round it to a convenient number in the measurement unit and set the first boundary.
  4. 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.
  5. 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

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

Download the template (histogram-template.xlsx)

Related tools

Request a tool (contact page of the official site)

Report

The company name and the other fields are kept on this device only.

Contact

We take enquiries on the contact page of the MechOwl official site. Requests for tools you would like are welcome there too.

To the contact page(opens in a new tab)