GaugeMath

Tolerance stack-up calculator

Enter the chain of dimensions that makes up a gap, with their tolerances, and whether each one adds to the gap or takes it away. You get the gap limits by worst case, root sum square (RSS) and Monte Carlo, the expected fraction of assemblies outside your limits, and which dimensions matter most. Everything runs in your browser.

Gap and requirement

Dimensions in the loop

Walk around the loop from one side of the gap to the other. A dimension that makes the gap larger when it grows is +; one that makes it smaller is −. Use ±½ for a diameter when only the radius is in the loop. Deviations are signed: 25 +0.1/−0.05 is upper 0.1, lower −0.05. Leave the lower deviation empty for a symmetric ± tolerance.

Paste rows from Excel

Columns: name, nominal, upper deviation, lower deviation, direction (+, −, +0.5, −0.5), distribution (normal or uniform). Tab, semicolon or comma separated; a header row is skipped.

Gap by method

Gap limits against the requirement

Monte Carlo distribution of the gap

Contribution of each dimension

Share of the variance (statistical)   Share of the worst-case tolerance. Tighten the top bars first.

Dimension loop

Each arrow is one dimension at its mid-limit value, in the order entered. Adds to the gap (points right)   Subtracts (points left)   Resulting gap. A small gap between long parts shows as a thin bar.

Dimensions

What a tolerance stack-up tells you

A gap in an assembly, such as the end play of a shaft, the clearance under a cover or the overhang of a pin, is not a dimension on any one drawing. It is the sum and difference of several part dimensions. Each of them varies within its tolerance, so the gap varies too. A stack-up computes how much, and whether the gap stays inside the limits the design needs.

To set it up, start at one face of the gap and walk to the other face through the parts that touch each other. Every dimension you cross in the direction of the walk adds to the gap (+); every dimension you cross against it subtracts (−). The signed sum of the nominal values must give the nominal gap. If it does not, the loop is wrong.

The methods and their formulas

For each dimension with nominal d, upper deviation es and lower deviation ei, the calculator uses the mid-limit value m = d + (es + ei)/2 and the half tolerance h = (es − ei)/2. With direction aᵢ (+1, −1 or ±0.5):

Mean gap μ = Σ aᵢ mᵢ     Worst case: μ ± Σ |aᵢ| hᵢ     RSS: μ ± √Σ (aᵢ hᵢ)²

Which result should I use?

SituationUsual choice
2 to 4 dimensions, or a fit that must never failWorst case
Many dimensions from capable, centred processes in productionRSS or statistical, with the expected ppm
Processes unknown, or parts sorted at the limitsStatistical with uniform rows, or worst case
Mixed distributions, or a decision near the limitCheck with Monte Carlo and 1 000 000 samples

The verdict on top says “meets at worst case” when every assembly fits, “fails at worst case, meets statistically” when the statistical ±3σ range is inside the limits but the worst case is not, and “fails statistically” otherwise. A statistical pass is only as good as its assumptions: it relies on processes that are centred and in control. Check them with the capability calculator.

Worked example: shaft end play

This is the shaft and housing assembly from K. W. Chase’s chapter on tolerance allocation in the Dimensioning and Tolerancing Handbook (section 14.3). The end play of the shaft must be 0.020 ± 0.015 in, so the minimum gap is 0.005 in and the maximum 0.035 in. Press Load worked example to see it.

Dim.PartNominal (in)Tolerance (in)Direction
ARetaining ring0.0505± 0.0015−
BShaft8.000± 0.008+
CBearing0.5093± 0.0025−
DBearing sleeve0.400± 0.002+
EHousing7.711± 0.006−
FBearing sleeve0.400± 0.002+
GBearing0.5093± 0.0025−
  1. Nominal gap: −0.0505 + 8.000 − 0.5093 + 0.400 − 7.711 + 0.400 − 0.5093 = 0.0199 in (the handbook rounds it to 0.020).
  2. Worst case: 0.0015 + 0.008 + 0.0025 + 0.002 + 0.006 + 0.002 + 0.0025 = ± 0.0245 in. The gap ranges from −0.0046 to 0.0444 in, so it can fail on both sides: at worst, the parts interfere.
  3. RSS: √(0.0015² + 0.008² + 0.0025² + 0.002² + 0.006² + 0.002² + 0.0025²) = √0.00012275 = ± 0.01108 in. The gap ranges from 0.00882 to 0.03098 in, inside the requirement.
  4. Statistical (normal, ±3σ): σ = 0.01108/3 = 0.003693 in. Cpk = (0.0199 − 0.005)/(3 × 0.003693) = 1.34. About 27 ppm are expected below the minimum and 22 ppm above the maximum, about 49 ppm in total.
  5. Contributions: the shaft B carries 52 % of the variance and the housing E 29 %. These two long dimensions are where a tighter tolerance pays; tightening the bearings or the ring changes almost nothing.

The handbook gives the same worst case (0.0245) and RSS (0.0111) and goes on to reallocate the tolerances by cost. The verdict here is “fails at worst case, meets statistically”: fine for a production line with capable processes, not for a one-off build from parts at their limits.

Common mistakes

Wrong signs in the loop

If the signed nominal values do not add up to the nominal gap shown on the assembly drawing, a direction is wrong. Check the loop before you look at any tolerance.

Mixing a diameter into a radial stack

When the loop runs through the centre of a hole or pin, only half of the diameter and half of its tolerance belong in the loop. Use the ±½ direction for those rows.

Using RSS for a handful of parts

With two or three dimensions the statistical advantage is small, and the result depends heavily on each dimension really being normal and centred. A uniform distribution or worst case is safer.

Assuming centred processes

RSS assumes each process is centred on the middle of its tolerance. A process that runs near one limit shifts the gap, and the RSS limits no longer hold. Asymmetric tolerances are handled here by centring on the mid-limit value; a real process shift is not.

Forgetting the parts that are not dimensions

Clearances in bolt holes, form errors, thermal expansion and wear also move the gap. Add them as rows when they matter.

Questions

What does “±3σ (Cp = 1)” mean?

It is the assumption about how much of each tolerance the process uses. ±3σ means the tolerance is just wide enough for 99.73 % of the parts, a capability Cp of 1, which is the classic RSS assumption. If your suppliers run at Cp = 1.33, choose ±4σ and the statistical gap gets narrower. Worst case and RSS do not depend on this setting.

Why do the statistical ppm and the Monte Carlo count differ?

The statistical ppm uses the normal distribution for the gap; Monte Carlo counts simulated assemblies. With uniform rows the true distribution has shorter tails than a normal one, so Monte Carlo usually finds fewer failures. With very small fractions, Monte Carlo needs many samples: 49 ppm means about 5 assemblies in 100 000, so the count is rough. Use 1 000 000 samples for a better estimate.

Can I enter a tolerance like +0.1/0?

Yes. Enter 0.1 as upper and 0 as lower deviation. The calculator works with the mid-limit value, so a unilateral tolerance shifts the mean gap. A note tells you when the mean gap differs from the nominal gap.

Does it handle geometric tolerances (GD&T)?

Only if you convert them to an equivalent ± contribution along the loop yourself, for example a position tolerance of a hole as ± half the tolerance zone diameter in the loop direction. Bonus tolerance and datum shift are not modelled.

How do I know the calculations are right?

The calculator reproduces the worst-case and RSS results of the handbook example above. Every closed-form result was also checked against an independent implementation in Python (NumPy and SciPy) on ten random stacks with asymmetric tolerances, ±½ directions and uniform rows, with differences below one part in ten billion, and the Monte Carlo results were checked against a separate 4-million-sample simulation.

Is my data uploaded?

No. Everything is calculated in your browser. The stack is kept only in this browser’s local storage, and a share link carries the data inside the link itself.

Related tools: the process capability calculator tells you which ±σ assumption your processes support; the uncertainty budget uses the same root-sum-square idea for measurement errors; and a Gage R&R study checks that the gauge can measure the gap at all.

References