Control Chart Selector, Shewhart Limits & Detection Power
Put this calculator on your own site
Paste this where you want the calculator to appear. It works on any site — WordPress, Squarespace, Webflow, Ghost or plain HTML — and needs no JavaScript of yours. It carries a link back here, which is the only thing we ask for it.
The standard deviation of all your readings puts the limits 42 percent too wide.
Upper Control Limit, Mean Chart
—units
Built from within-subgroup variation only
Limits, Chart Choice & What They Can Detect
Lower Control Limit, Mean Chart
—units
Upper Limit, Dispersion Chart
—units
Lower Limit, Dispersion Chart
—units
Within-Subgroup Sigma
—units
Chart Demanded (1 = I-MR, 2 = Xbar-R, 3 = Xbar-s)
—
Subgroups to Detect the Stated Shift
—
Limit Inflation if Overall SD is Used
—%
Standard Error of the Sigma Estimate
—%
These are trial limits from a baseline study. ISO 7870-2 expects any subgroup with an assignable cause to be investigated and removed and the limits then recomputed, so the first pass is never the last. The reported standard error of sigma assumes the subgroup ranges are independent; for a subgroup size of 1 the moving ranges overlap by one reading and are correlated, so the true uncertainty is larger than the figure shown, and the individuals chart is the least trustworthy of the three for that reason among others. All the constants assume the individual readings are approximately normal and independent - autocorrelated data such as a continuously monitored dyebath temperature will produce limits that are far too narrow, and count data such as neps or defects per unit needs an attribute chart, not this one. Detection power is calculated for a sustained step change and for the beyond-limits rule alone; run rules change both the detection and the false alarm figures. A negative limit inflation means the overall standard deviation came out smaller than the within-subgroup estimate, which normally signals subgrouping that is not rational or too few subgroups to estimate either quantity reliably. Finally, nothing here is a capability index: control limits describe what the process does, specification limits describe what the customer asked for, and drawing the two on the same chart is the most common and most damaging mistake in factory SPC.
Using this calculator
About the Control Chart Selector, Shewhart Limits & Detection Power
The formula
This is the expression the tool evaluates. Every term is named underneath, with the unit it must be supplied in.
Sigma from within the subgroupssigmaWithin = meanRange / d2(n)
d2 is the expected range of n readings from a normal distribution, expressed in standard deviations, so dividing the average range by it recovers sigma. This estimate deliberately sees only the variation inside a subgroup, which is what makes everything downstream a test rather than a description.
Mean chart limits, and where A2 comes fromxbarUcl = grandMean + m x sigmaWithin / sqrt(n) which at m = 3 equals grandMean + A2 x meanRange
A2 in the published tables is nothing more than 3 / ( d2 x sqrt(n) ), so working from d2 reproduces the tabulated factor exactly and still allows a multiplier other than 3. For n = 5 this gives A2 = 0.577, the value every SPC table prints.
Range chart limits, and where D3 and D4 come fromdispUcl = ( d2 + m x d3 ) x sigmaWithin = D4 x meanRange dispLcl = ( d2 - m x d3 ) x sigmaWithin = D3 x meanRange, floored at zero
d3 is the standard deviation of the range itself, so the range chart limits are the range plus and minus m of its own standard deviations. Above n = 9 the range is replaced by the subgroup standard deviation and the factors become B5 = c4 - m x sqrt(1 - c4 squared) and B6 = c4 + m x sqrt(1 - c4 squared).
Average run length to catch a shiftsubgroupsToDetect = 1 / [ Q( m - delta x sqrt(n) ) + Q( m + delta x sqrt(n) ) ]
Q is the upper tail of the standard normal, evaluated by the Abramowitz and Stegun 26.2.17 approximation. A shift of delta within-subgroup sigmas is sqrt(n) times larger on the subgroup mean, which is the entire reason subgrouping buys sensitivity.
Symbols used above
Symbol
Stands for
Unit
d2
Expected range of n normal readings, in standard deviations
—
d3
Standard deviation of that range, also in standard deviations
—
A2
Mean chart factor, equal to 3 / ( d2 x sqrt(n) )
—
D3, D4
Range chart factors, equal to 1 minus and plus 3 d3 / d2
—
ARL
Average run length, subgroups plotted before a signal appears
—
How the result is derived
Step by step, from the values you type to the figure on screen.
The 7 inputs are read from the form on every keystroke: Grand Average (X double bar), Average Subgroup Range (R bar), Standard Deviation of All Readings, Subgroup Size (n), Number of Subgroups (k), Limit Multiplier and Shift to Detect.
Each value is checked against the accepted range in the input table below. A value outside its range stops the calculation rather than producing a misleading figure — the results blank out and a message appears.
The validated values are substituted into the expression above, which resolves Upper Control Limit, Mean Chart together with every supporting figure in one pass — no value is carried over from a previous entry.
The supporting outputs — Lower Control Limit, Mean Chart, Upper Limit, Dispersion Chart, Lower Limit, Dispersion Chart, Within-Subgroup Sigma, Chart Demanded (1 = I-MR, 2 = Xbar-R, 3 = Xbar-s), Subgroups to Detect the Stated Shift, Limit Inflation if Overall SD is Used and Standard Error of the Sigma Estimate — come from the same pass, so they always describe the same case as the headline figure.
Results are rounded for display only. The full-precision value is used throughout the chain, so reading a rounded intermediate figure back into the tool by hand can shift the last digit.
What each input means
Where to read each value on the floor, the unit it must be in, and the range the tool accepts.
Input
Unit
Accepted range
Default
What it means
Grand Average (X double bar)
units
-100000 to 100000 units
180
Example figures are fabric mass in g/m2
Average Subgroup Range (R bar)
units
0.0001 to 100000 units
4.6
Average moving range when the subgroup size is 1
Standard Deviation of All Readings
units
0.0001 to 100000 units
2.8
Every individual reading pooled, subgroups ignored
Subgroup Size (n)
—
1 to 25
5
Readings per subgroup, 1 for an individuals chart
Number of Subgroups (k)
—
2 to 500
25
ISO 7870-2 asks for 20 to 25 before limits are fixed
Limit Multiplier
sigma
1.5 to 4 sigma
3
3 is the Shewhart action limit, 3.09 gives exactly 0.1 percent per tail
Shift to Detect
sigma
0.1 to 5 sigma
1
Sustained step change in the process mean
What the tool returns
The headline figure and every supporting value it is built from.
Output
Unit
What it tells you
Upper Control Limit, Mean Chart (headline result)
units
Built from within-subgroup variation only
Lower Control Limit, Mean Chart
units
Upper Limit, Dispersion Chart
units
Lower Limit, Dispersion Chart
units
Within-Subgroup Sigma
units
Chart Demanded (1 = I-MR, 2 = Xbar-R, 3 = Xbar-s)
—
Subgroups to Detect the Stated Shift
—
Limit Inflation if Overall SD is Used
%
Standard Error of the Sigma Estimate
%
Worked example
Given
0
Fabric mass baseline, grand average 180 g/m2
1
Average subgroup range 4.6 g/m2 over 25 subgroups of 5
2
Standard deviation of all 125 readings 2.8 g/m2
3
3 sigma limits, asked to catch a 1 sigma shift
Substituting
sigmaWithin = 4.6 / d2(5) = 4.6 / 2.326 = 1.9776 g/m2xbarUcl = 180 + 3 x sigmaWithin / sqrt(5) = 180 + 2.6533 = 182.6533 g/m2dispUcl = ( 2.326 + 3 x 0.8641 ) x sigmaWithin = 9.7266 g/m2, so D4 = 2.1145 against the tabulated 2.114limitInflationPct = ( 2.8 / 1.9776 - 1 ) x 100 = 41.5826 percent
Answer
0
Mean chart limits 182.6533 and 177.3467 g/m2
1
Range chart limits 9.7266 and 0 g/m2
2
Within-subgroup sigma 1.9776 g/m2, chart code 2
3
4.4953 subgroups on average to catch the 1 sigma shift
4
Overall SD would inflate the limits by 41.5826 percent
5
Sigma itself is known only to 7.4299 percent
The honest limits are 177.3467 to 182.6533. The shortcut limits, built on the standard deviation of all 125 readings, run from about 176.2 to 183.8 - and a roll sitting at 183 would plot comfortably inside them while being, by the process own within-subgroup behaviour, four sigma off target. The gap between the two is the between-subgroup drift, and it is roughly the same size as the within-subgroup noise: this process is not one process, it is a sequence of slightly different ones.
How to use it
Work through the input groups in order — Baseline Study, Subgrouping and Chart Design. The defaults are a realistic case, so you can change one value at a time and watch what moves.
There is no calculate button. Every figure recalculates as you type or drag, which is what makes this usable for a what-if sweep rather than a single answer.
Read Upper Control Limit, Mean Chart in the dark results panel — that is the headline figure, expressed in units.
Check the supporting rows underneath (Lower Control Limit, Mean Chart, Upper Limit, Dispersion Chart, Lower Limit, Dispersion Chart, Within-Subgroup Sigma, Chart Demanded (1 = I-MR, 2 = Xbar-R, 3 = Xbar-s), Subgroups to Detect the Stated Shift, Limit Inflation if Overall SD is Used and Standard Error of the Sigma Estimate) before acting on the headline — they are where an implausible input usually shows itself first.
Reset to defaults returns every field to the reference case, which is the quickest way to check whether a surprising result came from the tool or from an input you had changed earlier.
Where this is used
Process planning — establishing Upper Control Limit, Mean Chart before a trial is booked, so machine time and material in Quality Systems, Traceability, Utilities & Factory Decisions are committed against a calculated figure rather than an estimate.
Costing and quotation — Upper Control Limit, Mean Chart is an input to the cost sheet, and quoting from a worked number rather than a remembered one is what keeps a margin intact.
Troubleshooting — when the floor result drifts from plan, entering the measured values (starting with Grand Average (X double bar)) shows how much of the gap in Upper Control Limit, Mean Chart each variable explains.
Teaching and study — the accepted ranges bracket normal Quality Systems, Traceability, Utilities & Factory Decisions practice, so moving one variable at a time shows the shape of the relationship rather than a single answer.
Reading the result
Typical bands and what each one is telling you.
Value
What it indicates
Chart code 1
Subgroup of one: individuals and moving range. Limits are wide and a 1 sigma shift needs about 44 subgroups to surface.
Chart code 2
Subgroups of 2 to 9: mean and range chart, the mill standard, with n = 4 or 5 the usual compromise.
Chart code 3
Subgroups of 10 or more: mean and standard deviation chart. The range has lost too much of its efficiency to be trusted.
Limit inflation above 20 percent
Between-subgroup drift dominates. Limits from the overall SD would swallow the very signal you are charting for.
Sigma standard error above 10 percent
Too few subgroups. Fix the limits now and expect them to move once the study reaches 25.
Assumptions and limits
These are trial limits from a baseline study. ISO 7870-2 expects any subgroup with an assignable cause to be investigated and removed and the limits then recomputed, so the first pass is never the last. The reported standard error of sigma assumes the subgroup ranges are independent; for a subgroup size of 1 the moving ranges overlap by one reading and are correlated, so the true uncertainty is larger than the figure shown, and the individuals chart is the least trustworthy of the three for that reason among others. All the constants assume the individual readings are approximately normal and independent - autocorrelated data such as a continuously monitored dyebath temperature will produce limits that are far too narrow, and count data such as neps or defects per unit needs an attribute chart, not this one. Detection power is calculated for a sustained step change and for the beyond-limits rule alone; run rules change both the detection and the false alarm figures. A negative limit inflation means the overall standard deviation came out smaller than the within-subgroup estimate, which normally signals subgrouping that is not rational or too few subgroups to estimate either quantity reliably. Finally, nothing here is a capability index: control limits describe what the process does, specification limits describe what the customer asked for, and drawing the two on the same chart is the most common and most damaging mistake in factory SPC.
Every input is bounded to the range normal practice occupies (Grand Average (X double bar) -100000 to 100000 units, Average Subgroup Range (R bar) 0.0001 to 100000 units and Standard Deviation of All Readings 0.0001 to 100000 units, and so on for the rest). Those bounds are guard rails against typing errors, not a claim that the formula fails one unit outside them.
The calculation is deterministic: the same inputs always give the same result. It carries no allowance for machine condition, operator skill, ambient conditions or lot-to-lot material variation unless an input above explicitly represents one.
Nothing is sent anywhere. The maths runs in your browser, so the numbers you type never leave the page.
Standards and further reading
ISO 7870-1 - Control charts, Part 1: General guidelines, for chart selection and the role of rational subgrouping.
ISO 7870-2 - Control charts, Part 2: Shewhart control charts, which tabulates d2, A2, D3, D4, B3 and B4 and asks for 20 to 25 subgroups before limits are fixed.
ASTM E2587 - Standard Practice for Use of Control Charts in Statistical Process Control, for variables and attribute chart construction.
ISO 22514-2 - Statistical methods in process management, Capability and performance, Part 2, for the within-subgroup against overall distinction that separates control limits from performance indices.
Questions people ask
Why not just use the standard deviation of all my readings?
Because that statistic already contains the drift you are trying to detect. The standard deviation of every reading on the sheet is inflated by any movement of the process mean between subgroups, so limits built on it stretch until that movement fits inside them and the chart falls silent. In the worked example the overall SD is 41.58 percent larger than the within-subgroup estimate, which pushes the limits from a 5.31 unit band to a 7.51 unit band. Within-subgroup sigma answers a different question: how much does this process vary when nothing is disturbing it. That is the reference the chart tests every new subgroup against, and it is the only estimate that makes an out-of-control point mean anything.
The lower limit of my range chart is zero. Is the calculator broken?
No, that is correct and it is a real property of the range distribution. The lower factor is d2 minus three times d3, and for subgroup sizes of 2 to 6 that quantity is negative, so it is floored at zero and the tabulated D3 is printed as zero. From n = 7 upward it becomes positive: at n = 7 D3 is 0.076 and a genuine lower limit appears. The practical consequence is that a small subgroup range chart cannot signal an improvement in spread, only a deterioration. If you need to detect a reduction in variability, which matters when you are trying to prove a machine overhaul worked, you need n of at least 7 or a standard deviation chart.
When do I have to abandon the range chart for a standard deviation chart?
The boundary used here is n greater than 9, following ISO 7870-2, and the reason is efficiency rather than correctness. The range uses only the largest and smallest reading in the subgroup and throws away everything in between, so as the subgroup grows the discarded information grows with it. The relative efficiency of the range against the standard deviation is 1.00 at n = 2, about 0.955 at n = 5, and roughly 0.85 by n = 10, after which it keeps falling. Below that boundary the range costs almost nothing and can be computed on the shop floor without a calculator, which is exactly why it survived. Some texts move the boundary to 10 or 12; the choice is a convention, not a law.
My chart has not signalled in weeks. Does that prove the process is in control?
It proves very little on its own, because a 3 sigma chart is deliberately insensitive to small shifts. The worked example needs about 4.5 subgroups to catch a full 1 sigma step, and a 0.5 sigma step would take well over 100 - if you subgroup hourly, that is more than a fortnight of quietly off-target production. Two remedies exist and both have a price. Larger subgroups multiply the shift by the square root of n on the mean chart. Supplementary run rules, such as eight consecutive points on one side of the centre line, catch small sustained shifts quickly but shorten the false alarm interval from about 370 subgroups to roughly 150 when combined with the beyond-limits rule. If small shifts are what actually hurt you, a CUSUM or EWMA chart is the right instrument, not a Shewhart chart with more rules bolted on.