Control Chart Calculator

A control chart answers one question: is a process stable, or has something changed? Paste measurements in time order to get the control limits, the band that routine variation stays inside, for an X̄–R, X̄–S, or individuals (I–MR) chart. The tool plots both charts and flags the points and patterns that signal a change, using the Western Electric run rules and a trend test.

Key terms
Control chart
A plot of a measured quantity in time order, with a center line and an upper and a lower control limit. Points inside the limits with no unusual pattern are treated as routine variation.
Subgroup
A few measurements taken together under the same conditions, such as five consecutive parts every hour. The chart plots one average and one range (or standard deviation) per subgroup; 4 or 5 parts per subgroup is typical.
Control limits (UCL, LCL)
The upper and lower lines, set three standard deviations of the plotted value above and below the center line. They come from the process’s own variation, not from the drawing or the specification.
Range and moving range
Simple measures of spread. A range is the largest minus the smallest value in a subgroup; a moving range is the difference between two consecutive single values. Their averages (R̄ and MR̄) set how far apart the limits are.
Common and special causes
Common causes are the many small sources of variation that are always present. A special cause is something specific that changed, such as a worn tool, a new material lot, or a focus shift. Finding and removing special causes is what the chart is for.
Signal and run rule
A signal is a point beyond a control limit or a pattern that is unlikely by chance, such as eight points in a row above the center line (a run rule). It says “look for a cause”; it does not mean the parts are out of specification.
False alarm and average run length
A false alarm is a signal from a process that has not changed. The average run length (ARL) is the average number of points plotted before a signal: about 370 for a stable process when only the 3σ limits are used.
Phase I and Phase II
Phase I computes trial limits from past data and checks whether the process was stable. Phase II uses limits fixed from a stable period, or a known mean and σ, to judge new data.

Inputs

X̄–R for subgroups of up to about 10 values, X̄–S for larger ones, and I–MR when each measurement stands alone (one value per batch, shift, or day).

2–25

Measurements per subgroup, typically 4 or 5. Every subgroup must have the same size.

Separate values with spaces, tabs, commas, or new lines, and use a period as the decimal mark. Consecutive blocks of n values form the subgroups, so a missing value would shift every later subgroup. Use at least 20–25 subgroups (or 50–100 single values). The example is an ablation depth in µm, 25 subgroups of 5, with a small upward shift starting around subgroup 18.

Control limits

Phase I estimates the center line and σ from these data: use it first, on a run of past data. Phase II judges new data against a known mean and σ, usually from an earlier stable Phase I study.

Numbers or ranges of subgroups to drop from the limits and the charts once you have found their cause. The pasted data stay as they are, and the rest keep their numbers. Editing the data or changing how they are grouped clears this list.

Run rules

Extra rules catch small shifts sooner but add false alarms. With known limits, a stable process gives a false alarm every 370 points on average with rule 1 alone, every 92 with rules 1–4, and every 78 with the trend rule too.

Results

Out-of-control signals— A signal means “look for a special cause,” not “adjust the process.” In Phase I, find the cause, leave those subgroups out, and recalculate.
X̄ chart center line—
X̄ chart UCL · LCL—
R chart center line—
R chart UCL · LCL—
Within-subgroup σ estimate— —
Subgroups · values used— —
Constants—

X̄ chart

Shaded bands: within 1σ and 2σ of the center line, the zones the run rules use (σ of the plotted value: σ/√n for subgroup means). Red points break a rule; where there is room, the label beside each gives the rule number (T = trend).

R chart

Rule violations

How the control limits are calculated

A Shewhart chart puts its limits three standard deviations of the plotted statistic (three standard errors) either side of the center line. The standard deviation is estimated from variation within subgroups, so that shifts between subgroups show up as signals instead of widening the limits. From \(k\) subgroups of size \(n\), the tool takes the grand mean \(\bar{\bar x}\) (the mean of the subgroup means), the average range \(\bar R\) (the mean of the subgroup ranges, largest minus smallest value), and the average standard deviation \(\bar s\) (the mean of the subgroup standard deviations, each with the \(n-1\) divisor). From \(N\) individual values it takes their mean \(\bar x\) and the average \(\overline{MR}\) of the \(N-1\) moving ranges \(|x_i - x_{i-1}|\). The limits are:

\[ \begin{aligned} \bar X\text{–}R:\quad \mathrm{UCL}, \mathrm{LCL} &= \bar{\bar x} \pm A_2 \bar R \\ \mathrm{UCL}_R &= D_4 \bar R \\ \mathrm{LCL}_R &= D_3 \bar R \end{aligned} \]
\[ \begin{aligned} \bar X\text{–}S:\quad \mathrm{UCL}, \mathrm{LCL} &= \bar{\bar x} \pm A_3 \bar s \\ \mathrm{UCL}_S &= B_4 \bar s \\ \mathrm{LCL}_S &= B_3 \bar s \end{aligned} \]
\[ \begin{aligned} \text{I–MR}:\quad \mathrm{UCL}, \mathrm{LCL} &= \bar x \pm 3\frac{\overline{MR}}{1.128} \\ &= \bar x \pm 2.660\,\overline{MR} \\ \mathrm{UCL}_{MR} &= 3.267\,\overline{MR} \end{aligned} \]

The constants come from the distribution of the range and the standard deviation of \(n\) independent normal values. The mean range is \(d_2\sigma\), with \(d_2 = \int_{-\infty}^{\infty} \bigl[1 - \Phi(x)^n - \bigl(1-\Phi(x)\bigr)^n\bigr]\,dx\) for the standard normal distribution function \(\Phi\); the standard deviation of the range is \(d_3\sigma\); and the mean of \(s\) is \(c_4\sigma\), with \(c_4 = \sqrt{2/(n-1)}\,\Gamma(n/2)/\Gamma\bigl((n-1)/2\bigr)\). So \(\hat\sigma = \bar R/d_2 = \bar s/c_4\), \(A_2 = 3/(d_2\sqrt n)\), \(A_3 = 3/(c_4\sqrt n)\), \(D_3, D_4 = 1 \mp 3d_3/d_2\), and \(B_3, B_4 = 1 \mp 3\sqrt{1-c_4^2}/c_4\), with negative values set to zero. With a standard given (Phase II), the X̄ limits are \(\mu_0 \pm 3\sigma_0/\sqrt n\), the range chart runs from \(D_1\sigma_0\) to \(D_2\sigma_0\) around \(d_2\sigma_0\), with \(D_1, D_2 = d_2 \mp 3d_3\), and the S chart runs from \(B_5\sigma_0\) to \(B_6\sigma_0\) around \(c_4\sigma_0\), with \(B_5, B_6 = c_4 \mp 3\sqrt{1-c_4^2}\). A moving range is the range of two values, so the individuals chart uses the \(n = 2\) factors: \(3/d_2 = 3/1.128 = 2.660\), \(D_4 = 3.267\), and, with a standard given, limits \(\mu_0 \pm 3\sigma_0\) and \(D_2\sigma_0 = 3.686\,\sigma_0\).

Factors for common subgroup sizes, for limits estimated from the data (Phase I):

nA₂D₃D₄d₂A₃B₃B₄c₄
21.88003.2671.1282.65903.2670.7979
31.02302.5741.6931.95402.5680.8862
40.72902.2822.0591.62802.2660.9213
50.57702.1142.3261.42702.0890.9400
60.48302.0042.5341.2870.0301.9700.9515
80.3730.1361.8642.8471.0990.1851.8150.9650
100.3080.2231.7773.0780.9750.2841.7160.9727

And for a standard given (Phase II), with d₃:

nd₃D₁D₂B₅B₆
20.85303.68602.606
30.88804.35802.276
40.88004.69802.088
50.86404.91801.964
60.84805.0790.0291.874
80.8200.3885.3070.1791.751
100.7970.6865.4690.2761.669

The calculator holds the factors for n = 2–25. A₂, A₃, B₃, B₄, D₃, D₄, d₂, d₃, and c₄ are the published values (Montgomery, Appendix VI). Computed from the integrals above, every one agrees to within 0.001, but eight differ in the last digit, because the classic tables were partly computed from rounded values: D₄ for n = 3, for example, is printed as 2.574 against an exact 2.5746, and the NIST handbook prints 2.575. D₁, D₂, B₅, and B₆ are computed from the integrals and shown to three decimals.

The average moving range is the standard estimate of σ for individual values. When a few very large moving ranges inflate it, the median moving range \(\widetilde{MR}\) is a more robust alternative, with limits \(\bar x \pm 3.145\,\widetilde{MR}\). Do not use the standard deviation of all the values: any shift or drift in the data inflates it and widens the limits, which hides the very signals the chart looks for (Wheeler, “Individual charts done right and wrong”).

Run rules

Points beyond the control limits are not the only sign of a special cause. The zone rules of the Western Electric handbook catch smaller sustained shifts sooner. They divide each side of the center line into zones at 1σ and 2σ, where σ is the standard deviation of one plotted point (σ/√n for subgroup means). The tool checks these rules:

+3σ+2σ+1σCL−1σ−2σ−3σ

Rule 1: one point beyond a 3σ control limit.

+3σ+2σ+1σCL−1σ−2σ−3σ

Rule 2: two of three consecutive points beyond 2σ on the same side. The third point can be anywhere.

+3σ+2σ+1σCL−1σ−2σ−3σ

Rule 3: four of five consecutive points beyond 1σ on the same side.

+3σ+2σ+1σCL−1σ−2σ−3σ

Rule 4: eight consecutive points on the same side of the center line.

+3σ+2σ+1σCL−1σ−2σ−3σ

Trend: six consecutive points, each higher than the one before (or each lower).

Each rule drawn on its zones: shaded within 1σ and 2σ of the center line (CL), dashed at the 3σ control limits. Red points form the pattern, the dashed box is the window the rule examines, and the ringed point completes the pattern. That point is the one the tool flags.

These are the Western Electric (1956) versions of rules 1–4, which count the points on each side of the center line separately, plus the six-point trend test from Nelson’s (1984) list of eight tests. A point beyond 3σ also counts as beyond 2σ and beyond 1σ, and a point exactly on the center line breaks a run. Nelson’s run test uses nine points in a row rather than eight, which raises the in-control ARL with rule 1 from 153 to 217 points. His list also flags 14 points in a row alternating up and down, 15 in a row within 1σ (stratification), and 8 in a row beyond 1σ on either side (a mixture), which the tool does not check.

The tool applies the selected rules to the X̄ or individuals chart, and only rule 1 to the range, S, and moving-range charts. Ranges and standard deviations of small subgroups have skewed distributions that the symmetric zones do not fit, and consecutive moving ranges share a value, so they are not independent: Wheeler and Stauffer advise against rules 2–4 on a moving-range chart.

False alarms and how fast a shift is caught

Every rule added makes the chart react sooner to a small shift, and more likely to signal when nothing has changed. The average run length (ARL), the average number of points plotted before the first signal, measures both. For normal data and known limits, the ARL of a stable process and after a step shift of the mean by 0.5σ, 1σ, or 2σ:

RulesStable0.5σ1σ2σ
1 only37015543.96.30
1 and 415344.314.64.89
1–491.827.39.223.13
1–4 and trend77.526.39.183.13

The shifts are in σ of one plotted point: on an X̄ chart of subgroups of 5, a 1σ shift is a change of 0.45 process σ. The first three rows are exact, by the Markov-chain method of Champ and Woodall (1987), who give 91.75 for rules 1–4; the trend row is simulated, to within ±0.1.

The range, S, and moving-range charts add false alarms of their own, because these statistics have long upper tails: with known σ, a point crosses the UCL about once every 220 subgroups on an R chart with n = 5, and once every 110 points on a moving-range chart. In Phase I, where the limits come from the same data, what matters is the chance of at least one false signal in the whole data set. With every rule on, a perfectly stable set of 25 subgroups of 5 shows at least one signal about one time in four (27 % in a simulation that runs stable normal data through this tool), and a stable 100-point individuals series usually does (83 %). Investigate signals; do not adjust the process for every one.

The trend rule earns its place least. Davis and Woodall (1988) found that it is of virtually no help in detecting a drift of the mean once the other run rules are in use, and Wheeler and Stauffer (2017) advise against it. In the table it adds about 18 % more false alarms for no real gain, and for a drift of 0.1σ per point it shortens the ARL only from 12.1 to 12.0 points. Clear its box unless a trend is the failure you are watching for.

Worked example

The default data are 25 subgroups of 5 ablation-depth measurements. The grand mean is 12.138 µm and \(\bar R = 0.7032\) µm, so the X̄ limits are \(12.138 \pm 0.577 \times 0.7032 = 11.732\) to \(12.544\) µm. The R-chart UCL is \(2.114 \times 0.7032 = 1.487\) µm, and the within-subgroup σ is \(0.7032/2.326 = 0.302\) µm.

No point crosses a control limit, but the zone rules catch four low means out of five (subgroups 8–12, rule 3). Late in the run they catch the upward shift: rule 2 at subgroup 24, rule 3 at 24, and rule 4 at 25. The realized shift was about 0.3 µm, roughly 1 process σ. Because the Phase I grand mean includes the shifted subgroups, those subgroups sit only about 1.5σ of X̄ above the center line, and rule 1 alone would have missed the shift. In Phase I, find the cause, remove the affected subgroups, and recalculate the limits before using them for monitoring.

The button under the rule violations table leaves the flagged subgroups out without editing the data. Here it is not enough on its own. Each rule flags only the point that completes its pattern, so leaving out subgroups 12, 24, and 25 gives a chart with no signals whose grand mean, 12.129 µm, still includes the shifted subgroups 18 to 23. The cause decides what to remove, not the flags. If the investigation shows that the shift began at subgroup 18, type 18-25 in the leave-out field: the 17 subgroups that remain give a grand mean of 12.045 µm, \(\bar R = 0.6788\) µm, and X̄ limits of 11.653 to 12.437 µm, with no signals.

With a standard given instead (Phase II, μ₀ = 12.0 µm and σ₀ = 0.30 µm), the X̄ limits are \(12.0 \pm 3 \times 0.30/\sqrt 5\), 11.598 to 12.402 µm, and the shift is unmistakable: rule 1 flags subgroups 20, 23, and 24, and the zone rules flag every subgroup from 20 to 25. The R chart runs from 0 to \(D_2\sigma_0 = 4.918 \times 0.30 = 1.475\) µm around \(d_2\sigma_0 = 0.698\) µm.

Assumptions and limits

References

Primary sources and standards

  1. ISO 7870-2:2023, Control charts — Part 2: Shewhart control charts, 2nd ed., replacing ISO 7870-2:2013 (the international standard guide to Shewhart charts, which also introduces warning limits and the analysis of patterns; general guidelines are in ISO 7870-1:2019).
  2. D. C. Montgomery, Introduction to Statistical Quality Control, 8th ed., Wiley (2020): Section 5.3 (Phase I and Phase II; the Western Electric and other sensitizing rules, p. 192), Chapter 6 (X̄–R, X̄–S, and individuals charts), Section 10.4 (autocorrelated data), and Appendix VI (factors for constructing variables control charts).
  3. Western Electric Co., Statistical Quality Control Handbook, 1st ed. (1956) (the zone tests, rules 1–4).
  4. L. S. Nelson, “The Shewhart control chart—tests for special causes,” J. Qual. Technol. 16(4), 237–239 (1984), doi:10.1080/00224065.1984.11978921 (the eight tests, including the six-point trend test and the nine-point run).
  5. C. W. Champ and W. H. Woodall, “Exact results for Shewhart control charts with supplementary runs rules,” Technometrics 29(4), 393–399 (1987), doi:10.1080/00401706.1987.10488266 (the Markov-chain method for run-rule ARLs, and 91.75 for rules 1–4).
  6. R. B. Davis and W. H. Woodall, “Performance of the control chart trend rule under linear shift,” J. Qual. Technol. 20(4), 260–262 (1988), doi:10.1080/00224065.1988.11979118 (the trend rule adds little once the zone rules are in use).
  7. W. A. Jensen, L. A. Jones-Farmer, C. W. Champ, and W. H. Woodall, “Effects of parameter estimation on control chart properties: A literature review,” J. Qual. Technol. 38(4), 349–364 (2006), doi:10.1080/00224065.2006.11918623 (how limits estimated in Phase I change the chart’s false-alarm rate).
  8. D. J. Wheeler and D. S. Chambers, Understanding Statistical Process Control, 3rd ed., SPC Press (2010) (XmR charts and the detection rules).
  9. D. J. Wheeler and R. Stauffer, “When should we use extra detection rules?” Quality Digest (October 2017), spcpress.com (what each zone rule adds; no zone rules on the moving-range chart; against the trend rule).
  10. D. J. Wheeler, “Individual charts done right and wrong,” Quality Digest Daily (2 February 2010), spcpress.com (limits from the average or the median moving range, never the global standard deviation).
  11. D. J. Wheeler, “Are you sure we don’t need normally distributed data?” Quality Digest Daily (1 November 2010), spcpress.com (how much of a non-normal distribution 3σ limits cover; ARL 70.9 for a chi-square distribution with 4 degrees of freedom).
  12. AIAG, Statistical Process Control (SPC) Reference Manual, 2nd ed. (2005); AIAG and VDA QMC published a joint AIAG & VDA SPC Manual, 1st ed., in 2026 (automotive-industry practice).

Textbooks

Free introductions