An X-bar & R chart is a pair of control charts for measured data collected in small subgroups: the X-bar chart tracks the subgroup average (process center) and the R chart tracks the subgroup range (process spread). You read them together, spread first. It is the workhorse chart of the machine shop.

The X-bar & R chart is what most people picture when they think of statistical process control: pull four or five consecutive parts every so often, measure a feature, and plot two lines. It is popular because it is powerful and cheap. A handful of parts per subgroup catches a process shift fast, and the arithmetic is simple enough to do by hand at the machine. This guide builds one step by step, with the constants and the reading rules, so you can set one up on a real feature today.

When should you use an X-bar and R chart?

Use it when three things are true: your data is measured on a continuous scale (diameter, weight, torque, length, not pass/fail), you can sample a small subgroup of two to nine consecutive pieces at regular intervals, and those pieces come from a single process stream. That combination is common in machining, filling, molding, and assembly, which is why this chart shows up more than any other on a shop floor.

If any of those is false, pick a different chart. One value at a time means an individuals and moving-range chart. Subgroups of ten or more mean an X-bar & S chart, because at that size the range stops using the data efficiently and the standard deviation does a better job. Counted data means an attribute chart. The full decision tree is in which control chart to use; this post assumes you have landed on X-bar & R and want to build it.

How do you build an X-bar and R chart, step by step?

Nine steps take you from raw parts to a live chart. Do them in order.

  1. Pick the characteristic and subgroup size. Choose one measurable feature that matters, and a subgroup size n (commonly 4 or 5) of consecutive parts from one stream. Consecutive is the point: the subgroup should capture only short-term variation.
  2. Collect at least 20 to 25 subgroups. Sample at set intervals until you have 20 to 25 subgroups. Fewer than that and the limits are too shaky to trust. Record every value, not the average.
  3. Compute each subgroup's average and range. For each subgroup, the average X-bar is the mean of its values; the range R is the largest value minus the smallest. Two numbers per subgroup.
  4. Compute the grand average and mean range. The center line of the X-bar chart is X-double-bar, the average of all the subgroup averages. The center line of the R chart is R-bar, the average of all the ranges.
  5. Look up the constants for your subgroup size. A2, D3, and D4 depend only on n; take them from the table below. They convert R-bar into three-sigma control limits without your having to compute a standard deviation.
  6. Compute the R chart limits. Upper control limit is D4 times R-bar; lower control limit is D3 times R-bar. For subgroups of six or fewer, D3 is zero, so the R chart has no lower limit.
  7. Compute the X-bar chart limits. Upper and lower control limits are X-double-bar plus or minus A2 times R-bar. The A2 constant already bakes in the three-sigma width for that subgroup size.
  8. Check the R chart first. Plot the ranges. If the R chart is out of control, stop: the spread is unstable, so the X-bar limits are not trustworthy yet. Find and fix the cause of the spread before you read the averages.
  9. Read the X-bar chart against the run rules. With a stable R chart, plot the averages and apply the pattern rules. Points beyond the limits or non-random runs are signals to investigate.
Subgroup size nA2 (X-bar limits)D3 (R lower)D4 (R upper)
21.88003.267
31.02302.574
40.72902.282
50.57702.114
60.48302.004
70.4190.0761.924
80.3730.1361.864
90.3370.1841.816
100.3080.2231.777
Control limit formulas for the X-bar and R chart Three constants, four limits X̄ CHART (the average) CL = X̄̄ UCL = X̄̄ + A2 · R̄ LCL = X̄̄ − A2 · R̄ Tracks where the process is centered R CHART (the spread) CL = R̄ UCL = D4 · R̄ LCL = D3 · R̄ (= 0 if n ≤ 6) Tracks how much the process varies
Every limit comes from R-bar and one constant. No standard deviation to compute; the constants carry the three-sigma math.

What does the math look like on a real feature?

Work a quick example with subgroups of five, so n equals 5 and the constants are A2 = 0.577, D3 = 0, and D4 = 2.114. Say you are checking a shaft diameter and, across your 25 subgroups, the average of the subgroup averages comes out to X-double-bar = 12.500 mm and the average range is R-bar = 0.020 mm. The R chart upper limit is D4 times R-bar, or 2.114 times 0.020, which is 0.0423 mm; the lower limit is zero because D3 is zero at n = 5, so the R chart has an upper limit only. The X-bar limits are X-double-bar plus or minus A2 times R-bar, or 12.500 plus or minus 0.577 times 0.020, which is 12.500 plus or minus 0.0115, giving an upper limit of 12.5115 mm and a lower limit of 12.4885 mm. That is the entire calculation: four limits from two summary numbers and three tabled constants, no square roots in sight. Any subgroup average outside 12.4885 to 12.5115, or any range above 0.0423, is a signal.

Why do you read the R chart before the X-bar chart?

Because the X-bar limits are built from R-bar, so they only make sense if the spread is stable. A2 times R-bar sets the width of the average chart's limits; if the range is wandering, that width is being computed from a moving target, and a point falling inside the X-bar limits tells you nothing reliable. Check the R chart first. If it is in control, the spread is consistent and you can trust the X-bar limits. If it is not, the process spread is changing (a worn tool, a loose fixture, an inconsistent material), and that is the problem to chase before you worry about the average.

A paired X-bar and R chart read together One process, two stacked charts X̄ CHART, average UCL CL LCL signal: beyond UCL R CHART, range UCL LCL=0 R chart is stable, so the X̄ limits can be trusted, and that one high average is a real signal.
The two charts share an x-axis. Confirm the R chart is in control first; only then does a point beyond the X-bar limits count as a genuine shift in the center.

How do you read the chart once it is running?

A process is in control when the points look like random scatter around the center line, inside the limits, with no patterns. Anything else is a signal to investigate. The classic tests are the Western Electric run rules: a single point beyond three sigma (outside a control limit); two of three consecutive points beyond two sigma on the same side; four of five beyond one sigma on the same side; and eight consecutive points on one side of the center line. A signal means look for a cause, not necessarily adjust the machine; re-check the measurement, look for an event like a setup or material change, and annotate the chart with what you find. Tampering with a stable process because one point drifted is a classic way to add variation, not remove it.

What do the numbers say about the X-bar and R chart?

The chart and its constants are long settled and documented:

What comes after a stable X-bar and R chart?

A stable chart proves the process is predictable; it does not prove the process meets the spec. Those are different questions. Once the X-bar & R chart shows sustained control, run a capability study to compare the process spread to the tolerance, which is the job of Cp and Cpk. And before trusting any of it, make sure the gauge is not the source of the variation you are charting, which is what measurement system analysis checks. The chart is only as good as the numbers feeding it, and on most floors those numbers start life on a paper check sheet that reaches the quality office days later. Harmony connects machines, software, and paperwork into one operational layer with no rip-and-replace, so a subgroup measured at the station becomes chartable data the instant it is entered, and a signal shows up while the shift that caused it is still running. CLS traded paper logs for that kind of real-time record, and the same live visibility turns a stack of check sheets into a control chart you can actually act on. Build the chart right, capture the data cleanly, and the two lines will tell you the truth about your process.