X̄-R Chart Calculator — Subgroup Averages and Ranges

Paste subgrouped measurements and get the X̄ and R charts, with σ̂ = R̄/d₂ and A₂, D₃, D₄ computed for your subgroup size rather than looked up, honest stair-step limits when the subgroups are unequal, and every constant named on the figure.

When an X̄-R chart is the right chart

Use it when you can take several measurements close together under conditions you believe are the same — five parts an hour off one spindle, four bottles from one filler head, three coupons from one coil. That grouping is the whole instrument. Variation *within* a subgroup becomes the yardstick, and variation *between* subgroups is what the chart tests against it.

That is why an X̄-R chart is more sensitive than an I-MR chart on the same process: it separates the two sources instead of estimating short-term variation from consecutive differences. If you genuinely only get one measurement per batch, the I-MR chart is the honest choice — and this tool will say so rather than quietly substituting the overall standard deviation.

Above a subgroup of about ten the range starts wasting information: it uses the largest and smallest observation and ignores everything in between. NIST puts the relative efficiency of R against s/c₄ at 1.000 for n = 2 and 0.850 by n = 10. Past that, the X̄-S chart is the same idea with a better estimator.

Data

Paste straight from Excel, Minitab or a CMM export — include the header row and the columns are matched by name, in any order.

#SubgroupMeasurement
1
2
3
4

0 rows of data

Loading the calculation engine…

Enter data on the left to chart it

SVG is vector — it stays sharp at any size in a report. PNG 4× is roughly 600 dpi at figure width. Every export carries the estimator, the constants and the rule set drawn inside the figure, so the file is readable on its own.

Downloads carry a small “made with spcplot.com” credit along the bottom edge. The chart on screen is never watermarked, and the credit is a credit rather than a licence restriction — the figures are yours to publish either way. A Pro or Lifetime licence removes it.

Options

This plot has no adjustable options yet.

Your measurements are processed entirely in this browser tab. Nothing you type here is uploaded, so confidential production data stays confidential.

The X̄-R chart formulas, and which form this tool computes

The published formulas come in two shapes that are the same arithmetic. The familiar one is x̄̄ ± A₂R̄ for the averages, and D₃R̄ to D₄R̄ for the ranges. The other is x̄̄ ± 3σ̂/√n with σ̂ = R̄/d₂, and R̄ ∓ 3d₃R̄/d₂.

This tool computes the second and reports the first. A₂ is only ever 3/(d₂√n) and D₃, D₄ are only ever 1 ∓ 3d₃/d₂, so nothing is lost — but writing it this way is what makes the unequal-subgroup case come out right without a second code path, and it means the sigma multiple can be something other than three without silently continuing to use factors with a 3 baked into them.

d₂ and d₃ have no closed form. They are the mean and the standard deviation of the range of n standard normal observations, and they are obtained here by integrating the range density rather than by copying a table — which is why this tool has a value for a subgroup of 40 and a printed table does not.

Unequal subgroup sizes, which most templates get wrong

The standard error of a subgroup average is σ/√n, so a subgroup of three genuinely has wider limits than a subgroup of five. Less obviously, the *centre line* of the range chart moves too: the expected range of n observations is d₂(n)·σ, so a smaller subgroup has a smaller expected range as well as a wider band around it.

The default here is to recompute every limit at that subgroup’s own n and draw the result as a staircase. The alternative — one flat limit from the average n — is offered, labelled as an approximation and warned about on the figure, because it is what most spreadsheet templates do and you sometimes need to reproduce one. It is too wide for the large subgroups and too narrow for the small ones, and on tidy demonstration data the two are visually indistinguishable, which is exactly why the wrong version survives.

A subgroup that ends up holding a single observation is excluded from R̄ rather than contributing a range of zero. One of those left in pulls every limit inward.

Reading the figure

Solid line is the centre line, dashed lines are the control limits, and a point drawn in red with a number beside it failed the test with that number. Read the range chart first: if the spread is unstable, the averages chart is being judged against a yardstick that is itself moving, and its limits do not mean what they appear to.

The active rule set is printed under the chart, because Nelson, Western Electric and ISO 7870-2 flag different points on the same data — nine consecutive points on one side of the centre line, eight, and seven respectively. The default is Nelson test 1 alone, which is what Minitab applies out of the box, so a chart compared against an existing output should agree point for point on the first try.

Everything under the rule line is disclosure and has no switch: which estimator produced σ̂, which constants were used and whether they were computed or rounded to a published table, how the rows were subgrouped, and whether any limits were frozen on a baseline. A control chart with unnamed limits is a picture.

Common questions

What are the X̄-R chart formulas?
Centre lines x̄̄ and R̄. Averages limits x̄̄ ± A₂R̄, equivalently x̄̄ ± 3R̄/(d₂√n). Range limits D₃R̄ and D₄R̄, equivalently R̄ ∓ 3d₃R̄/d₂. A₂ = 3/(d₂√n), D₃ = max(0, 1 − 3d₃/d₂), D₄ = 1 + 3d₃/d₂. The figure prints the value of every factor at your subgroup size.
Why does my R chart have no lower control limit?
Because D₃ is exactly zero for every subgroup size below seven — 1 − 3d₃/d₂ is negative there, and a range cannot be negative. Tables print 0.000 or a dash and both mean the same thing. One consequence is worth knowing: when the lower limit is clamped, the zone tests below the centre line cannot fire for a reason that has nothing to do with your process, so this tool suppresses them and names them rather than reporting them as passed.
What subgroup size should I use?
Four or five is the usual answer: large enough for the average to behave normally, small enough that everything in the subgroup was made under conditions you can defend as identical. That second half is the real constraint. Five parts taken from five different machines is not a rational subgroup, and the chart built on it will have limits so wide it can never signal.
How many subgroups do I need before the limits mean anything?
Shewhart asked for at least 25. Below that the chart still draws and prints a warning saying how many subgroups fed the limits, because limits from eight subgroups move as soon as a ninth arrives. Once you have a stable baseline, freeze it and judge new data against it instead of recomputing on every append.
Can I paste my data straight out of Excel?
Yes — a subgroup column and a measurement column, one observation per row, with or without a header. If your sheet writes the subgroup label once and leaves the cells below it blank, that works too: a blank label continues the subgroup above. If you have nothing but a bare column of measurements, paste it and set how many consecutive rows make a subgroup. The figure downloads as SVG or PNG.
Is my data uploaded anywhere?
No. The whole calculation runs as JavaScript in this browser tab, and nothing on this site accepts a measurement — the only server code here takes a payment. That is why the tool is usable on data you are contractually barred from putting in a cloud service.