Math calculator

X-bar and R Chart Calculator

Is the process stable?

Chart the subgroups

Twenty subgroups of five from a process that is behaving. The grand mean is 99.6482, the average range 4.7280, and the limits run 96.9210 to 102.3754 — no point outside and no rule broken. Two sigma estimates sit beside each other: 2.0327 from the average range and 2.0976 from pooling every observation. On a stable process those agree; the next two presets are what happens when it is not stable.

20 subgroups of 5 · X-bar and R

Centre 99.6482, limits 96.9210 to 102.3754

Sigma from within the subgroups is 2.0327; pooling every observation instead gives 2.0976, and the two agree, which is what a stable process looks like. 0 of 20 subgroups break at least one rule, 0 of them by going outside the limits.

Grand mean

99.6482

R-bar 4.7280

X-bar limits

96.921 to 102.375

±0.5768 × R-bar

Sigma within

2.0327

pooled 2.0976

Subgroups flagged

0 of 20

0 beyond the limits

Every subgroup

Each subgroup’s mean and spread with any rules it breaks
#MeanRangeRules broken
199.18005.0800
298.11605.1100
398.18609.3700
4100.06202.9600
5100.49004.4300
697.98006.5200
799.85004.2100
8100.67203.9700
999.35204.5100
1099.80001.7900
1199.26403.5400
12100.87003.6000
13101.78806.5300
14100.15804.1500
1599.06806.3100
1698.66403.8500
17100.38206.2300
1898.11402.1600
19100.28004.1300
20100.68806.1100

Rule numbers refer to the Nelson set: 1 is one point beyond three sigma, 2 is nine points in a row on the same side of the centre, 3 is six points in a row rising or falling, and so on. Running all eight raises the false-alarm rate from about one point in 370 to roughly one in 91.

The constants, computed for n = 5

The Shewhart constants used for this subgroup size
ConstantValueWhat it is
d₂2.325929expected range of 5 standard normals
d₃0.864082standard deviation of that range
c₄0.939986how much a sample SD understates sigma
A₂0.5768193/(d₂√n) — the X-bar half-width per unit of R-bar
D₃, D₄0.000000, 2.114499range-chart limits per unit of R-bar
B₃, B₄0.000000, 2.088998S-chart limits per unit of S-bar

These are computed from their definitions rather than read from a table, so the chart works at any subgroup size from 2 to 25 — including the ones most printed tables stop before.

Constants computed R and S charts All eight Nelson rules Limits are not specifications

What this tool shows

The constants here are computed, not looked up. d₂ is the expected range of n standard normals and comes out of its integral; c₄ is a ratio of gamma functions. That means the chart works at any subgroup size from 2 to 25, and it means the values can be checked against the printed tables rather than copied from them — which the verification suite does at up to twelve sizes per constant.

  • X-bar with either an R chart or an S chart, switchable on the same data
  • Every Shewhart constant computed from its definition: d₂, d₃, c₄, A₂, A₃, B₃, B₄, D₃, D₄
  • All eight Nelson rules, with the false-alarm cost of running them stated
  • Two sigma estimates side by side — within-subgroup and pooled — and what their gap means
  • Presets for a stable process, a step change and a slow drift
  • The per-subgroup table showing which rule each flagged subgroup broke
Constants computed R and S charts Eight Nelson rules Two sigma estimates

Control limits come from the process. Specifications come from the customer. They are unrelated.

Updated 13 September 2026 · Works in any browser, no installation

An X-bar chart asks whether the process mean is moving more than the variation within subgroups can explain. That within-subgroup variation is the yardstick: it is what the process does when nothing has changed, and the limits are three of those sigmas either side of the grand mean. Everything turns on the subgroups being chosen so that only common-cause variation happens inside one — which is a decision about sampling, not about arithmetic.

At a glance

Formula shown
Limits are x̄̄ ± A₂·R̄ with A₂ = 3/(d₂√n), where d₂ is the expected range of n standard normals — computed here from ∫[1 − Φ(x)ⁿ − (1 − Φ(x))ⁿ]dx rather than read from a table. The range chart runs from D₃·R̄ to D₄·R̄ with D₄ = 1 + 3d₃/d₂. Using standard deviations instead gives x̄̄ ± A₃·S̄ with A₃ = 3/(c₄√n), and c₄ = √(2/(n−1))·Γ(n/2)/Γ((n−1)/2) in closed form.
Scenario support
Monitoring a manufacturing or laboratory process over time, establishing baseline control limits from a stable period, deciding whether an apparent shift is signal or noise, and separating common-cause variation from special causes before attempting to improve anything.
Educational estimate
Planning support from the values you enter — not professional advice.

Two sigmas, and their gap is the diagnosis

The chart prints two estimates of the process standard deviation. On a stable process they agree, and when they do not, the difference is the finding.

Within-subgroup sigma is the average range over d₂. It only ever sees variation inside a subgroup, so a shift between subgroups does not touch it.

Pooled sigma is the standard deviation of every observation. It contains the shift, the drift and anything else that moved.

On the step-change preset they are 2.1935 and 2.5830 — 17.8% apart. On the drifting preset, 1.8894 and 2.3436, a gap of 24.0%. On the stable preset, 2.0327 and 2.0976, under 3.2%.

Which is why the limits must come from the within estimate. Building them from the pooled figure widens the limits using the very variation they are supposed to detect, and a sufficiently bad process then draws limits wide enough to contain itself.

Where the constants come from

A2 = 0.577 at n = 5 is copied from a table in almost every treatment of this chart. It is a number with a derivation.

d₂ is the expected range of n standard normals — the integral of 1 − Φ(x)ⁿ − (1 − Φ(x))ⁿ over the whole line, evaluated here by Simpson’s rule.

A₂ is then just 3/(d₂√n). Three sigmas, divided by the √n that turns a process sigma into a sigma for the subgroup mean, divided by the d₂ that turns an average range into a sigma.

c₄ has a closed form and at n = 2 it is √(2/π), which says a two-point standard deviation runs 20.2% low on average.

Computing them earns two things. The chart works at subgroup sizes tables stop before, and the values can be checked against those tables rather than copied — which the verification suite does at twelve sizes for d₃ alone.

Eight rules, and what running them costs

The extra rules exist because a point outside the limits is a poor detector of anything except a large sudden shift. They are not free.

Rule 1 alone gives a false alarm about once every 370 points. That is the 3-sigma limit doing what it was designed to do.

Running all eight brings that to roughly one in 91. Four times as many false alarms, in exchange for catching shifts the limits cannot.

The step-change preset shows the trade paying off: ten subgroups flagged, only one of them outside the limits. The other nine are runs.

Choose the rules before looking at the chart. Applying rule 6 because a run happens to be visible is not a test, and a chart that is watched by people who investigate every alarm will be abandoned if four in five are noise.

The subgroup is the whole design

Everything on this page rests on what goes into one subgroup, and that is a sampling decision the arithmetic cannot check.

A subgroup should contain only common-cause variation. Five consecutive parts from one machine, taken within a minute — anything that could change between them belongs between subgroups instead.

Mixing two machines into one subgroup inflates the range, which widens the limits, which hides the very difference between the machines you wanted to see.

Spreading a subgroup over a shift does the same thing more slowly. The chart then reports that nothing is out of control, correctly and uselessly.

The tell is a chart that never signals and an R chart with a large average range. Compare the within-subgroup sigma against what you know the equipment can do; if it is far larger, the subgroups are too broad.

R or S, and why R won

The range chart is the default in most of industry and the standard deviation is the better statistic. The history explains the gap.

The range is one subtraction. In 1924 that mattered enormously, and it still matters on a shop floor where charts are filled in by hand.

The standard deviation uses every observation and the range uses two. At n = 5 the range is about 96% as efficient, so the loss is small; by n = 10 it is under 85%.

On the stable preset the two sigma estimates are 2.0327 from the range and 2.0384 from the standard deviation — 0.28% apart, which is what “good enough at n = 5” looks like.

The rule of thumb: R up to about n = 8, S above it. Both are on the toggle here, on the same data, so the difference can be looked at rather than argued about.

Control limits are not specification limits

This confusion is common enough to be worth stating on its own, because acting on it produces exactly the wrong behaviour.

Control limits describe what the process does. They come entirely from the data and know nothing about what anyone wants.

Specification limits describe what the customer will accept. They come from a drawing and know nothing about the process.

A process can be in perfect control and produce nothing acceptable, and a process can meet every specification while being wildly unstable.

Drawing specification limits on a control chart is the error to avoid. It invites adjusting the process every time a point drifts toward a tolerance, which adds variation rather than removing it. The question of whether the process meets the specification is a capability question, and it only means anything once the chart says the process is stable.

Reporting a control chart

Four items, and the third is the one that makes the limits reproducible.

Give the subgroup size and how subgroups were formed. The whole analysis depends on it and no reader can reconstruct it.

Give the number of subgroups the limits were computed from. Limits from fewer than about twenty subgroups are unstable, and from fewer than ten are little more than a guess.

Say which rules you applied. “Out of control” means something different under one rule than under eight.

And say whether the limits were recomputed. Removing an assignable-cause subgroup and refitting is standard practice and has to be stated, because the limits after the removal are not the limits before it.

Sources and methodology

References for the charts and their constants.

Method. Every Shewhart constant is computed from its definition rather than taken from a table. d₂ comes from Simpson’s rule on the integral of 1 − Φ(x)ⁿ − (1 − Φ(x))ⁿ; d₃ from a two-dimensional Simpson rule over the joint density of the smallest and largest order statistics, which reaches more precision than any published table carries and, unlike a simulation, returns the same value every time; c₄ in closed form. The suite checks all of them against the published values — d₂ at seven subgroup sizes, d₃ at twelve, c₄ at seven, and A₂, A₃, B₃, B₄, D₃ and D₄ too — and checks the closed forms where they exist: d₂(2) is 2/√π, d₃(2) is √(2 − 4/π) and c₄(2) is √(2/π). It also asserts the cross-engine identity that ties c₄ to the Hedges correction in the effect-size engine: c₄(n) = J(n)·√(n/(n−1)), to machine precision at nine sizes. Sigma for the limits always comes from within-subgroup variation, never from the pooled standard deviation, and both are printed so the gap is visible. That engine is verified on every change against 139 assertions. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

Individuals Control ChartIndividuals and moving range charts with sigma from the average moving range, both sigma estimates shown, and all eight Nelson rules counted.
p Chartp and np charts with limits computed per point when the sample sizes differ, and the cost of flat limits measured on your own chart.
c Chartc and u charts for defect counts, with the exact Poisson probability of exceeding the three-sigma limit computed rather than assumed.
EWMA ChartEWMA and CUSUM computed on the same readings with a Shewhart chart beside them, a lambda sensitivity table and both statistics per reading.
CpkCp, Cpk, Pp and Ppk with the defect rates they predict and the rate actually observed — including the built-in case where Cp is 2.05, Cpk is 0.57 and a quarter of the sample is already out of spec.
Gauge R&RANOVA gauge repeatability and reproducibility with both acceptance criteria, the operator-by-part interaction tested, and the full variance decomposition.

More in Math, or browse all calculators.

Educational use disclaimer

An educational tool. Control limits describe what a process does and specification limits describe what a customer accepts; they are unrelated, and drawing one on a chart of the other invites adjusting a stable process, which adds variation. The analysis also assumes each subgroup contains only common-cause variation — a sampling decision no calculation can check.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (5 updates)

Published 13 September 2026

  1. Launched X-bar with R and S charts on one page, switchable on the same data.
  2. Computed every Shewhart constant from its definition rather than a table — d2 by Simpson on its integral, d3 by two-dimensional Simpson over the extreme order statistics, c4 in closed form — so the chart works at any subgroup size from 2 to 25.
  3. Checked those constants against the published tables at up to twelve sizes each, and against three exact closed forms at n = 2.
  4. Printed within-subgroup and pooled sigma side by side: a step change makes the second 17.8% larger, and a slow drift 24.0%.
  5. Applied all eight Nelson rules and stated their cost — the false-alarm rate rises from about one point in 370 to one in 91.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.