MECHOWL QUALITY ANALYSIS AI

X-bar R chart maker: control limits, A2 D3 D4 constants and the Western Electric rules

Paste subgroup data from Excel to get the X-bar R chart with its center lines and control limits, the out-of-control signals of the tests in JIS Z 9020-2, and the A2, D3, D4 constants with the working.

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 125 rows and 3 columns.

What each column means

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

One column: split by the subgroup column (or cut in order by the subgroup size). Several columns: each row is one subgroup.

The same number or name on the rows of one subgroup.

Date, time and the like. The value on the first row of each subgroup is written on the horizontal axis.

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

Settings

Cuts one column of data into subgroups of n values from the top.

More settings (Subgroups for the limits, Unit, Chart title, Period and more)

Empty: all subgroups. For example, 20: the first 20 subgroups set the control limits, and the later subgroups are judged against the same lines.

e.g. mm.

Empty: “X̄-R chart”.

e.g. 1–31 Oct 2026. Written on the chart and the report.

Empty: all rows. A value: only the rows with that value.

Judgement rules

By default, the page uses the eight tests shown as examples in JIS Z 9020-2 annex B (the Western Electric rules, with the point counts of Nelson (1984)). With “Set of tests” you can switch to the examples in figure 3 of the standard (four). Switch tests on or off, or change their numbers, to match your company's or industry's rules; changes are written in the report.

By default the eight tests of annex B. With the examples of figure 3, the switches and numbers below are not used: points are marked for ① a point beyond a control limit, ② 7 points in a row on one side and ③ 7 points in a row increasing or decreasing.

Source of the default: JIS Z 9020-2:2025

Result

UCL 10.01856 mm: Out-of-control signals (5 subgroups)

Result of the sample data

X̄-R chartSubgroup size n = 5 Subgroups k = 25 Unit: mm Period: 1–25 Nov 2026 Tests that marked points: Test 5 (2 of 3 beyond 2σ) Test 6 (4 of 5 beyond 1σ)X-R chartSubgroup size n = 5 Subgroups k = 25 Unit: mm Period: 1–25 Nov 2026 Tests that marked points: Test 5 (2 of 3 beyond 2σ)Test 6 (4 of 5 beyond 1σ)Subgroup valueCenter lineControl limitsPoint meeting another test9.98009.990010.000010.010010.020010.0300Mean X (mm)UCL 10.01856CL 10.00321LCL 9.987860.00000.02000.04000.0600Range R (mm)UCL 0.05623CL 0.02660Test655,66611/0111/0311/0511/0711/0911/1111/1311/1511/1711/1911/2111/2311/25Subgroup (Date)

Out-of-control signals (5 subgroups)

Tests used: 1, 2, 3, 4, 5, 6, 7, 8 (from the eight tests shown as examples in JIS Z 9020-2 annex B (the Western Electric rules)). A signal is a prompt to check the state of the process, not a pass or fail decision.

Upper control limit of the X̄ chart UCL
10.01856 mm
Lower control limit of the X̄ chart LCL
9.98786 mm

How to read it

What the chart shows

  • Out-of-control signals at subgroups 11/18, 11/20, 11/22, 11/23, 11/25. The tests that marked them: Test 5 (2 of 3 beyond 2σ); Test 6 (4 of 5 beyond 1σ).

Common misreadings

  • Control limits are not specification limits. A point can be inside the control limits and outside the specification, and the other way round.
  • Control limits computed with the signalling points included are wider. Remove the subgroups whose cause you have found and compute the limits again (“Subgroups for the limits”).

Next steps

  • Check the records for a change in the 4Ms (man, machine, material, method) at the dates and times of the marked subgroups.

Numbers

Subgroup size n5
Number of subgroups k25
Grand mean X̿10.00321 mm
Average range R̄0.02660 mm
Upper control limit of the X̄ chart UCL10.01856 mm
Lower control limit of the X̄ chart LCL9.98786 mm
Upper control limit of the R chart UCL0.05623 mm
Lower control limit of the R chart LCLNone (subgroup size 6 or less)
Estimated within-subgroup standard deviation σ̂0.011436 mm
Subgroups with out-of-control signals5

Calculation steps
  1. Grand meanX̿ = Σ X̄ᵢ / kk = 25 → X̿ = 10.00321
  2. Average rangeR̄ = Σ Rᵢ / kR̄ = 0.02660
  3. ConstantsConstants for subgroup size n = 5 (3 decimals, as in the JIS table)A₂ = 0.577, D₃ = — (none), D₄ = 2.114, d₂ = 2.326 (constants version constants-2026-11-17e)
  4. X̄ chartUCL, LCL = X̿ ± A₂R̄10.00321 ± 0.577 × 0.02660 = 10.01856, 9.98786
  5. R chartUCL = D₄R̄, LCL = D₃R̄2.114 × 0.02660 = 0.05623, None (subgroup size 6 or less)
  6. 1σ for the tests1σ (X̄) = A₂R̄ / 30.005116
Mean, range and signals by subgroup
SubgroupMean X̄Range RTests met
11/0110.00020.02
11/0210.00020.042
11/0310.0010.021
11/049.99760.045
11/059.99820.032
11/069.99420.026
11/0710.00220.014
11/0810.00480.019
11/0910.00220.028
11/109.99760.033
11/1110.00480.019
11/1210.0010.028
11/1310.0020.013
11/149.9970.028
11/159.99520.02
11/1610.00540.037
11/179.99720.02
▲ 11/189.99640.015X̄: 6
11/1910.01360.046
▲ 11/2010.01520.026X̄: 5
11/2110.010.03
▲ 11/2210.0140.024X̄: 5,6
▲ 11/2310.01140.027X̄: 6
11/2410.00660.016
▲ 11/2510.01220.036X̄: 6
Tests used (the eight tests shown as examples in JIS Z 9020-2 annex B (the Western Electric rules))
TestDescriptionUsed
11 point more than 3σ from the center line (beyond a control limit)○
29 points in a row on the same side of the center line○
36 points in a row steadily increasing or decreasing○
414 points in a row alternating up and down○
52 out of 3 points in a row more than 2σ from the center line, on the same side○
64 out of 5 points in a row more than 1σ from the center line, on the same side○
715 points in a row within 1σ of the center line○
88 points in a row more than 1σ from the center line, on either side○

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 specification with process capability

References

  • ISO 7870-2:2023 Control charts — Part 2: Shewhart control charts · ISO
  • NIST/SEMATECH e-Handbook of Statistical Methods, 6.3 Univariate and Multivariate Control Charts · NIST · Open
  • D. C. Montgomery, Introduction to Statistical Quality Control, 8th ed., 2019 · Wiley
  • The Shewhart Control Chart—Tests for Special Causes · Journal of Quality Technology 16(4), 237–239 (L. S. Nelson, 1984)
  • NIST/SEMATECH e-Handbook of Statistical Methods, 6.3.2 What are Variables Control Charts? · NIST · Open
  • NIST/SEMATECH e-Handbook of Statistical Methods, 6.3.2.1 Shewhart X-bar and R and S Control Charts · NIST · Open
  • JIS Z 9020-2:2025 Control charts — Part 2: Shewhart control charts (in Japanese) · Japanese Standards Association (JSA)

Standards are shown by number and title only.

X-bar R chart explained

An X-bar R chart (X̄-R chart) plots the mean X̄ and the range R of each subgroup (a few values taken in a row under the same conditions) in time order, and compares them with the center line and the control limits (usually the center line ± 3σ) to show whether something unusual has changed in the process. The X̄ chart shows changes in the process mean; the R chart shows changes in the variation within subgroups.

X-bar R chart by hand: step by step

  1. Take a few values in a row under the same conditions as one subgroup (subgroup size n, usually 4 or 5), and collect 20 to 25 subgroups or more.
  2. Compute the mean X̄ and the range R (largest − smallest) of each subgroup.
  3. Compute the grand mean X̿ and the average range R̄, and the control limits with the constants A₂, D₃ and D₄ for the subgroup size: X̿ ± A₂R̄ for X̄, D₄R̄ and D₃R̄ for R.
  4. Plot the points in time order and draw the center lines and the control limits.
  5. Look for points beyond the control limits and for points that meet a pattern test (such as 9 points in a row on one side), and find what changed in the 4Ms at that time.

Worked examples

  1. Example 1: Subgroup size 3, 4 subgroups (no LCL for R)

    Subgroup	Value
    1	1
    1	2
    1	3
    2	2
    2	3
    2	4
    3	3
    3	4
    3	5
    4	2
    4	2
    4	2

    Means 2, 3, 4, 2 → X̿ = 11/4 = 2.75. Ranges 2, 2, 2, 0 → R̄ = 1.5. Constants for n = 3 (table values): A₂ = 1.023, D₄ = 2.575, D₃ = 0 (none). UCL = 2.75 + 1.023 × 1.5 = 4.2845, LCL = 1.2155; R chart UCL = 2.575 × 1.5 = 3.8625, no LCL.

  2. Example 2: Subgroup size 7 (a positive LCL for R)

    x1	x2	x3	x4	x5	x6	x7
    1	2	3	4	5	6	7
    2	3	4	5	6	7	8

    Data side by side (one row = one subgroup). Means 4 and 5 → X̿ = 4.5; ranges 6 and 6 → R̄ = 6. Constants for n = 7 (table values): A₂ = 0.419, D₃ = 0.076, D₄ = 1.924. UCL = 4.5 + 0.419 × 6 = 7.014, LCL = 1.986; R chart UCL = 1.924 × 6 = 11.544, LCL = 0.076 × 6 = 0.456.

  3. Example 3: Subgroup size 10 (the largest on this page)

    Value
    0
    1
    2
    3
    4
    5
    6
    7
    8
    9
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    Settings: Subgroup size (without a subgroup column) = 10

    One column cut into subgroups of 10 from the top. Means 4.5 and 5.5 → X̿ = 5, R̄ = 9. Constants for n = 10 (table values): A₂ = 0.308, D₃ = 0.223, D₄ = 1.777. UCL = 5 + 0.308 × 9 = 7.772; R chart LCL = 0.223 × 9 = 2.007.

  4. Example 4: Subgroup size 11 (outside this page)

    x1	x2	x3	x4	x5	x6	x7	x8	x9	x10	x11
    1	2	3	4	5	6	7	8	9	10	11
    2	3	4	5	6	7	8	9	10	11	12

    A subgroup size of 11 is outside the X̄-R chart of this page (2 to 10). The page points to the X̄-s chart.

  5. Example 5: Unequal subgroup sizes

    Subgroup	Value
    1	1
    1	2
    2	1
    2	2
    2	3

    Subgroup 1 has 2 values and subgroup 2 has 3. The X̄-R constants depend on the subgroup size, so the page says the chart cannot be used for unequal subgroups.

  6. Example 6: Test 5 with more points beyond than points (input error)

    Subgroup	Value
    1	1
    1	2
    2	2
    2	3

    Settings: Test 5: points beyond = 5

    “5 out of 3 points in a row” cannot be. The page shows an input error in the test settings.

Common mistakes

  • Drawing the specification limits instead of the control limits (a control chart shows whether the process is stable, not whether parts meet the specification).
  • Mixing data from different conditions (another machine, another lot) in one subgroup: the control limits widen and changes no longer show.
  • Going on using control limits that still include the subgroups whose special cause has been found.

FAQ

What subgroup size should I use?
Subgroups of 4 or 5 are common. This page takes 2 to 10. For 11 or more, use the X-bar S chart.
Which tests should I use?
By default, this page uses the eight tests shown as examples in annex B of JIS Z 9020-2 (the Western Electric rules). With “Set of tests” you can switch to the examples of figure 3 of the standard (four). Test 1 (a point beyond a control limit) is always used. The more of the other tests you use, the smaller the changes you notice, but the more often a test is met by chance. Switch tests or change their numbers on this page to match your company or industry rules.
Is my data sent anywhere?
No. The calculations and the chart are made in your browser only.

Scope

An X-bar R chart of equal subgroups of 2 to 10 values: means and ranges. The control limits are 3σ (constants A₂, D₃, D₄).

Not covered by this tool:

  • Subgroups of different sizes (use the X̄-s chart or a standardised chart).
  • Control charts for attributes, such as defectives and defects (p, np, c and u charts).

Excel template: X-bar R chart

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 (xbar-r-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)