SPC Charts
Featured articles

X-bar and R Charts, Explained

Short answerAn X-bar and R chart is a pair of Shewhart charts for subgrouped data: one for the subgroup mean and one for the subgroup range, with 3-sigma limits from X-double-bar, R-bar, and standard constants that depend on subgroup size. On this site, those constants are included for n = 2 to 5.

Last reviewed December 1, 2026By SPC Charts rules team, Oxmaint Inc.2 min read
X bar r chart preview showing control charts, Cpk/Ppk and out-of-control alerts

How are the limits computed?

Average the subgroup means to get X-double-bar and the ranges to get R-bar. X-bar limits are X-double-bar ± A2 × R-bar. R limits are D3 × R-bar and D4 × R-bar. Within-subgroup sigma is often estimated as R-bar/d2, and then used for Cpk.

Formulas as commonly stated in the NIST/SEMATECH e-Handbook capability and control-chart chapters. Demo specs: LSL 19.85, USL 20.15 mm.
StatisticFormula used hereDemo value
X-double-barMean of subgroup means20.010 mm
R-barMean of subgroup ranges0.036 mm
X-bar UCL / LCLX-double-bar ± A2 × R-bar (n=5, A2=0.577)20.031 / 19.989 mm
R UCL / LCLD4 × R-bar / D3 × R-bar (D4=2.114, D3=0)0.076 / 0.000 mm
Within σ estimateR-bar / d2 (d2=2.326 for n=5)0.0155 mm
Cp(USL − LSL) / (6σ)3.230
Cpkmin( (USL − X-bar)/(3σ), (X-bar − LSL)/(3σ) )3.019
PpkSame form with overall sample standard deviation1.793

The NIST/SEMATECH e-Handbook: Shewhart Control Charts discusses Shewhart charts in public, citable language.

What is the demo actually showing?

Ten subgroups of five. Subgroup 6’s mean is 20.070 mm, above the X-bar UCL of 20.031 mm. The ranges are not the story; the location shift is. Cpk remains 3.019 because the within-subgroup estimate is still small.

Illustrative demo data: shaft diameter in millimetres, 10 subgroups of 5. Not a real process.
SubgroupX-barRangeAlert
120.0020.050—
220.0200.040—
319.9900.040—
420.0140.030—
519.9960.030—
620.0700.040Outside X-bar limits
720.0040.030—
819.9900.040—
920.0160.030—
1019.9960.030—
Average20.0100.036

When is X-bar and R the wrong chart?

  • When the data are individuals and you invented subgroups after the fact.
  • When n is larger than 5 and you need constants this preview does not include — use a method you can cite, not a silent extrapolation in our form.
  • When the subgroup is not a logically alike set (mixed cavities, mixed lots).

How can you rebuild the example?

  1. Download the sample CSV

    Open it in Excel or Google Sheets.

  2. Set n = 5 in the preview

    Leave the demo specs if you want the same indices.

  3. Confirm subgroup 6 is flagged

    And that Cpk and Ppk both appear.

  4. Then replace the values with yours

    Never show the demo as a customer study.

SPC Charts is a calculation and charting tool, not a substitute for a quality system, a process-validation study, or professional statistical advice. It is not affiliated with NIST, ISO, AIAG or any standards body.

Frequently asked questions

Why not always use individuals?

If you truly have rational subgroups, X-bar and R uses that structure. If you do not, I-MR is the more honest chart.

Which constants do you use for n = 5?

A2 = 0.577, d2 = 2.326, D4 = 2.114, D3 = 0.

Can I try this free?

Yes. The in-browser preview is free.

How much does the software cost?

$29 per run, $22 a month or $209 a year.

Official source. Chart and capability methods on this page follow NIST/SEMATECH e-Handbook: Shewhart Control Charts. Always confirm current rules and rates with your base jurisdiction before filing.

Rebuild this month’s chart pack from the sheet you already have

Control charts, Cpk and Ppk, and out-of-control alerts. Full report $29 per run or $209 a year.

Start a free preview