Tolerance Stack-Up Calculator: Worst Case, RSS & Monte Carlo
Analyze a signed 1D dimension chain with worst-case limits, RSS and seeded Monte Carlo. Compare assembly yield and identify the tolerances that dominate variation.
A tolerance stack-up calculator predicts how manufacturing variation accumulates along an assembly. Use it to check an axial gap, spacer stack, enclosure clearance, shoulder location, or total length before releasing a drawing. It is intended for engineers checking a design, students learning tolerance analysis, and anyone comparing the fit of several dimensioned parts.
Build the dimension chain
Choose between one and eight contributors. Enter each nominal dimension with its sign: positive dimensions increase the result, and negative dimensions decrease it. For a housing containing three components, enter the housing depth as positive and each component thickness as negative. The schematic follows those signed dimensions from a common starting point; horizontal distances are proportional to the entered lengths.
Enter each bilateral tolerance as a positive half-width. A drawing callout of 12 ±0.05 mm means a signed nominal of −12 mm for a subtracting component and a tolerance of 0.05 mm. The tolerance sign does not change when the nominal is negative. The default example leaves a nominal gap of 0.5 mm. Use the unit selector to enter or read lengths in metric or US units; the schematic explicitly labels its dimensions in millimetres.
Compare the three methods
Worst case tolerance analysis adds the tolerance half-widths. Its minimum and maximum cover every combination of dimensions within the entered limits. The fit verdict compares those bounds with your lower and upper requirements. A negative worst-case margin tells you how far a bound extends beyond a requirement.
RSS tolerance analysis combines independent standard deviations by the root sum of squares. The calculator reports the classic geometric RSS half-width and the distribution-aware ±3σ interval separately. They coincide when every contributor is Normal and its tolerance equals three standard deviations. Choose Uniform when every value inside the limits is equally likely, or Triangular when values near the middle are more likely. The Normal option is unbounded: its tolerance defines a multiple of sigma and does not clip samples at drawing limits.
Monte Carlo generates assemblies from those distributions using a repeatable seed. Read its mean, standard deviation, central 95% interval, observed yield, and 95% Wilson confidence interval. The histogram shows how the results spread; the variance chart identifies the largest contributors. Increase the trial count or change the seed to assess sampling variability. Zero observed rejects still leaves uncertainty, which the confidence interval displays.
Use the result in a design review
Tighten the largest variance contributors first, then reconsider the nominal clearance and requirement window. The tolerance scale provides a quick way to compare a uniformly tighter or looser manufacturing budget.
This tool covers a linear, one-dimensional chain with symmetric tolerances and independent, centered variation. It does not resolve angular errors, geometric tolerance zones, shared dimensions, correlated machining errors, process drift, selective assembly, thermal expansion, or deformation. Convert asymmetric limits to a midpoint and half-width before entering them. Choose statistical assumptions from process measurements; a drawing tolerance alone does not establish a probability distribution.
How it is calculated
Let be each signed nominal contribution and its scaled bilateral half-width. These equations are derived for a linear sum and implement the arithmetic and RSS methods in Scholz (1995), printed pp. 12–15 (attached pp. 20–23).
The classic geometric RSS half-width is . For the selected distributions, use for Normal, for Uniform, and for symmetric Triangular variation (NIST §2.5.4.1). Independence gives
Thus when all varying contributors are Normal with . A ±3σ interval has 99.73% coverage for an all-Normal chain; this coverage is not assigned to bounded or mixed distributions. Normal-model yield is the difference of Normal CDFs at the requirement limits, using and . Zero spread is evaluated as a point mass.
The worst-case margin is the smaller of the lower and upper clearance to the functional limits. A nonnegative margin means all in-tolerance combinations meet the requirements.
Monte Carlo uses the Park–Miller recurrence (multiplier 16807, modulus 2147483647) with exact modular block products and the chosen seed. Box–Muller transforms two uniforms to a Normal variate; gives Uniform variation and gives symmetric Triangular variation. Add the independent sampled contributions to . Sample standard deviation uses the denominator. The central interval uses the 2.5th and 97.5th percentiles from a sorted copy of the samples. For probability , R7 interpolation uses rank and linearly interpolates between the observations at and (NIST §7.2.6.2). The interpolation is explicit so browser and server runtimes follow the same algorithm. Histogram bins report percentages of all assemblies, including their out-of-spec subset.
The 95% Wilson score interval quantifies sampling uncertainty in the simulated yield (NIST §7.2.4.1). Its width remains nonzero when no rejects are observed. It concerns the simulation model, not confidence in the manufacturing assumptions.
For unit verification, simulation runs on dimensionless deviations normalized by the worst-case half-width (a 1 mm reference is used only when all tolerances are zero). Named steps restore mean, standard deviation, percentiles and sample extremes to physical units. The function returns compact statistics and histogram counts; full sample vectors remain local.
Assumptions
- One linear, one-dimensional chain of one to eight contributors; coefficients +1 and −1 are encoded in the signed nominals. Symmetric tolerances affect spread equally for either sign.
- Each contributor has a symmetric distribution centered on its signed nominal. The shared Normal factor maps tolerance to standard deviation; Uniform and Triangular endpoints are the entered limits.
- Contributors vary independently. Parts from the same drifting process, or a dimension reused twice in a loop, can violate independence.
- Normal distributions are untruncated. Their samples can exceed drawing limits and fall outside the worst-case interval. Worst-case bounds apply only when every actual dimension is within tolerance; they are not absolute support limits of a Normal model.
- Functional limits are inclusive, and the upper limit must exceed the lower limit. A negative result represents overlap or interference; it is acceptable only if the requirements allow it.
- Lengths remain in mm internally. The viewer converts physical inputs, cards, chart axes and table columns to metric or US units. The schematic explicitly retains mm labels; its vertical row spacing is illustrative.
Where it applies
Use for axial lengths, gaps and clearances that are algebraic sums. This model does not include angular errors, 2D/3D geometry, GD&T, contact, compliance, thermal expansion or deformation. It does not model mean shifts, covariance, truncation, sorting or selective assembly. For asymmetric bounds, enter their midpoint as the signed nominal and half their width as the symmetric tolerance; this changes the assumed center and should be justified.
Choose distributions and the Normal tolerance/σ factor from process evidence. RSS variance propagation is exact for independent contributors. Normal-model yield is exact for an all-Normal chain (or zero spread), and an approximation otherwise. Use Monte Carlo for the selected bounded or mixed distributions.
The central 95% Monte Carlo interval differs from a ±3σ interval and from observed sample extremes. Counts of 1,000–50,000 trials produce estimates, not reliable parts-per-million certification. Wilson limits cover sampling uncertainty only, not model or process uncertainty. Change the seed and increase trials when a decision is close.
NASA RP-1253's three-dimension example (printed p.69, attached p.74) reports 0.172 mil RSS after rounding each intermediate σ to 0.033 mil. Full-precision propagation gives 0.1732050808 mil. The reference check discloses and allows that rounding difference; the calculator retains full precision.
References
- Fritz Scholz, Tolerance Stack Analysis Methods, Boeing, December 1995, printed pp. 4–15 (attached pp. 12–23): https://faculty.washington.edu/fscholz/Reports/babytol.pdf
- NASA RP-1253, Reliability Training, June 1992, printed pp. 68–69 (attached pp. 73–74): https://ntrs.nasa.gov/citations/19920023212
- Tom Petrini, OpenSpindle, Tolerance Stack-Up Analysis, 25 August 2026, four-spacer example: https://openspindle.com/blog/tolerance-stack-up
- NIST/SEMATECH e-Handbook §2.5.4.1, Standard deviations from assumed distributions: https://www.itl.nist.gov/div898/handbook/mpc/section5/mpc541.htm
- NIST/SEMATECH e-Handbook §7.2.4.1, Confidence intervals for proportions (Wilson score): https://www.itl.nist.gov/div898/handbook/prc/section2/prc241.htm
- Park and Miller (1988), Random Number Generators: Good Ones Are Hard to Find, doi:10.1145/63039.63042. Algorithm and test vector: RFC 5170 §5.7, https://www.rfc-editor.org/rfc/rfc5170#section-5.7
- Box and Muller (1958), A Note on the Generation of Random Normal Deviates, Annals of Mathematical Statistics 29, 610–611. Transformation also given in OECD NEA/MBDAV/R(2019)1 §1.2, equation 1.69: https://www.oecd-nea.org/science/docs/2019/mbdav-r2019-1.pdf
- Chris Barton, Drafter, The tolerance stack-up tool you asked for is here, 14 May 2026; application context: https://drafterinc.beehiiv.com/p/the-tolerance-stack-up-tool-you-asked-for-is-here
- NIST/SEMATECH e-Handbook §7.2.6.2, Percentiles: ordered observations, linear interpolation and the published R7 wafer-measurement example: https://www.itl.nist.gov/div898/handbook/prc/section2/prc262.htm
Inputs
| Input | Symbol | Unit | Default |
|---|---|---|---|
| Dimensions in the chain Use one to eight independent contributors. A shared dimension must not be entered twice as though independent. | n_dim | dimensions | 4 |
| Tolerance scale Multiplies every entered tolerance. Use 0.8 to compare a 20% tighter tolerance budget. | tol_factor | 1 | |
| Monte Carlo assemblies More trials reduce sampling uncertainty. This trial count cannot resolve very rare defects reliably. | n_mc | trials | 10000 |
| Random seed The same inputs, trial count and seed reproduce the same simulation. Change the seed to assess sampling variability. | seed_mc | 2026 | |
| Minimum acceptable result Inclusive lower functional limit for the signed result. Negative values may represent interference. | LSL | mm | 0.4 |
| Maximum acceptable result Inclusive upper functional limit. It must exceed the minimum acceptable result. | USL | mm | 0.6 |
| D1 signed nominal Positive adds length; negative subtracts it. For example, enter −12 for a 12 mm component that reduces the gap. | d_1 | mm | 50 |
| D1 ± tolerance Enter the nonnegative half-width of a symmetric bilateral tolerance. Zero means an exact contributor. | t_1 | mm | 0.1 |
| D1 distribution All are centered on the signed nominal. Uniform and Triangular stay within ±tolerance; Normal uses the shared tolerance / σ factor. | dist_1 | Normal (unbounded) | |
| D2 signed nominal Positive adds length; negative subtracts it. For example, enter −12 for a 12 mm component that reduces the gap. | d_2 | mm | -12 |
| D2 ± tolerance Enter the nonnegative half-width of a symmetric bilateral tolerance. Zero means an exact contributor. | t_2 | mm | 0.05 |
| D2 distribution All are centered on the signed nominal. Uniform and Triangular stay within ±tolerance; Normal uses the shared tolerance / σ factor. | dist_2 | Normal (unbounded) | |
| D3 signed nominal Positive adds length; negative subtracts it. For example, enter −12 for a 12 mm component that reduces the gap. | d_3 | mm | -20 |
| D3 ± tolerance Enter the nonnegative half-width of a symmetric bilateral tolerance. Zero means an exact contributor. | t_3 | mm | 0.08 |
| D3 distribution All are centered on the signed nominal. Uniform and Triangular stay within ±tolerance; Normal uses the shared tolerance / σ factor. | dist_3 | Normal (unbounded) | |
| D4 signed nominal Positive adds length; negative subtracts it. For example, enter −12 for a 12 mm component that reduces the gap. | d_4 | mm | -17.5 |
| D4 ± tolerance Enter the nonnegative half-width of a symmetric bilateral tolerance. Zero means an exact contributor. | t_4 | mm | 0.07 |
| D4 distribution All are centered on the signed nominal. Uniform and Triangular stay within ±tolerance; Normal uses the shared tolerance / σ factor. | dist_4 | Normal (unbounded) | |
| D5 signed nominal Positive adds length; negative subtracts it. For example, enter −12 for a 12 mm component that reduces the gap. | d_5 | mm | 0 |
| D5 ± tolerance Enter the nonnegative half-width of a symmetric bilateral tolerance. Zero means an exact contributor. | t_5 | mm | 0 |
| D5 distribution All are centered on the signed nominal. Uniform and Triangular stay within ±tolerance; Normal uses the shared tolerance / σ factor. | dist_5 | Normal (unbounded) | |
| D6 signed nominal Positive adds length; negative subtracts it. For example, enter −12 for a 12 mm component that reduces the gap. | d_6 | mm | 0 |
| D6 ± tolerance Enter the nonnegative half-width of a symmetric bilateral tolerance. Zero means an exact contributor. | t_6 | mm | 0 |
| D6 distribution All are centered on the signed nominal. Uniform and Triangular stay within ±tolerance; Normal uses the shared tolerance / σ factor. | dist_6 | Normal (unbounded) | |
| D7 signed nominal Positive adds length; negative subtracts it. For example, enter −12 for a 12 mm component that reduces the gap. | d_7 | mm | 0 |
| D7 ± tolerance Enter the nonnegative half-width of a symmetric bilateral tolerance. Zero means an exact contributor. | t_7 | mm | 0 |
| D7 distribution All are centered on the signed nominal. Uniform and Triangular stay within ±tolerance; Normal uses the shared tolerance / σ factor. | dist_7 | Normal (unbounded) | |
| D8 signed nominal Positive adds length; negative subtracts it. For example, enter −12 for a 12 mm component that reduces the gap. | d_8 | mm | 0 |
| D8 ± tolerance Enter the nonnegative half-width of a symmetric bilateral tolerance. Zero means an exact contributor. | t_8 | mm | 0 |
| D8 distribution All are centered on the signed nominal. Uniform and Triangular stay within ±tolerance; Normal uses the shared tolerance / σ factor. | dist_8 | Normal (unbounded) | |
| Normal tolerance / standard deviation For Normal contributors only: ±tolerance = ±kσ. Three is the conventional RSS assumption; Normal samples are not truncated. | k_n | 3 |
Results
With the default inputs above, the calc gives:
| Result | Value |
|---|---|
| Nominal result | 0.5 mm |
| Worst-case fit | Fit is not guaranteed |
| Worst-case requirement margin | -0.2 mm |
| Classic RSS half-width | 0.154272 mm |
| Assembly standard deviation (RSS) | 0.051424 mm |
| Normal-model yield (approx. for non-Normal) | 94.81782 % |
| Monte Carlo yield | 94.94 % |
| Rejected simulated assemblies | 506 assemblies |
| Monte Carlo yield: 95% Wilson confidence | 94.493% to 95.353% |
| Monte Carlo mean | 0.500283 mm |
| Monte Carlo standard deviation | 0.051076 mm |
Checked against sources
Each case below was calculated by this calc and agrees with the value from its source (within the tolerance where one is shown).
NASA three-dimension stack: arithmetic bounds and rounded RSS
Source: NASA RP-1253 (1992), printed pp. 68–69, attached pp. 73–74: 1, 2 and 3 mil, each ±0.1 mil; worst-case total 6 ±0.3 mil. Its 0.172 mil RSS rounds σ_i to 0.033 mil before summing. Exact σ_i=0.1/3 gives 0.1732050808 mil; the tolerance on this published RSS value allows that disclosed intermediate-rounding error. No formula is adjusted. Conversion: 1 mil=0.0254 mm. https://ntrs.nasa.gov/citations/19920023212
Inputs: Dimensions in the chain = 3 dimensions; D1 signed nominal = 0.0254 mm; D2 signed nominal = 0.0508 mm; D3 signed nominal = 0.0762 mm; D1 ± tolerance = 0.00254 mm; D2 ± tolerance = 0.00254 mm; D3 ± tolerance = 0.00254 mm; Minimum acceptable result = 0.13 mm; Maximum acceptable result = 0.18 mm; the others as above.
| Result | Source | This calc |
|---|---|---|
| Nominal result | 0.1524 mm | 0.1524 mm |
| Worst-case tolerance half-width | 0.00762 mm | 0.00762 mm |
| Worst-case minimum | 0.1448 mm | 0.1448 mm |
| Worst-case maximum | 0.16 mm | 0.16 mm |
| Classic RSS half-width | 0.004369 ± 4 × 10⁻⁵ mm | 0.004399 mm |
OpenSpindle: four spacers and a housing
Source: Tom Petrini, OpenSpindle, Tolerance Stack-Up Analysis, 25 Aug 2026, 'The worked example': 40 ±0.15 mm housing minus four 10 ±0.10 mm spacers, clearance ±0.55 mm worst case and ±0.25 mm RSS. Simulation moments are compared to this centered normal reference with sampling tolerances, not to a chosen seed's output. https://openspindle.com/blog/tolerance-stack-up
Inputs: Dimensions in the chain = 5 dimensions; D1 signed nominal = 40 mm; D2 signed nominal = -10 mm; D3 signed nominal = -10 mm; D4 signed nominal = -10 mm; D5 signed nominal = -10 mm; D1 ± tolerance = 0.15 mm; D2 ± tolerance = 0.1 mm; D3 ± tolerance = 0.1 mm; D4 ± tolerance = 0.1 mm; D5 ± tolerance = 0.1 mm; Minimum acceptable result = -1 mm; Maximum acceptable result = 1 mm; Monte Carlo assemblies = 20,000 trials; the others as above.
| Result | Source | This calc |
|---|---|---|
| Nominal result | 0 mm | 0 mm |
| Worst-case tolerance half-width | 0.55 mm | 0.55 mm |
| Worst-case minimum | -0.55 mm | -0.55 mm |
| Worst-case maximum | 0.55 mm | 0.55 mm |
| Classic RSS half-width | 0.25 mm | 0.25 mm |
| Distribution-aware ±3σ half-width | 0.25 mm | 0.25 mm |
| Monte Carlo mean | 0 ± 0.0025 mm | 8.192 × 10⁻⁴ mm |
| Monte Carlo standard deviation | 0.08333 ± 0.002 mm | 0.08405 mm |
NIST uniform half-width: exact variance and simulated spread
Source: NIST/SEMATECH e-Handbook §2.5.4.1, uniform distribution: s_source=a/√3 for endpoints ±a. Here a=1 mm and the center is translated to 10 mm. Monte Carlo checks use statistical tolerances around these independently established distribution moments. https://www.itl.nist.gov/div898/handbook/mpc/section5/mpc541.htm
Inputs: Dimensions in the chain = 1 dimensions; D1 signed nominal = 10 mm; D1 ± tolerance = 1 mm; D1 distribution = Uniform (bounded); Minimum acceptable result = 9 mm; Maximum acceptable result = 11 mm; Monte Carlo assemblies = 20,000 trials; the others as above.
| Result | Source | This calc |
|---|---|---|
| Assembly standard deviation (RSS) | 0.5774 mm | 0.5774 mm |
| Monte Carlo standard deviation | 0.5774 ± 0.012 mm | 0.5778 mm |
| Monte Carlo yield | 100 % | 100 % |
| Monte Carlo mean | 10 ± 0.015 mm | 10 mm |
NIST symmetric triangular half-width: exact variance and simulation
Source: NIST/SEMATECH e-Handbook §2.5.4.1, symmetric triangular distribution: s_source=a/√6 for endpoints ±a and mode zero. Here a=1 mm and the center is translated to 10 mm. https://www.itl.nist.gov/div898/handbook/mpc/section5/mpc541.htm
Inputs: Dimensions in the chain = 1 dimensions; D1 signed nominal = 10 mm; D1 ± tolerance = 1 mm; D1 distribution = Triangular (bounded); Minimum acceptable result = 9 mm; Maximum acceptable result = 11 mm; Monte Carlo assemblies = 20,000 trials; the others as above.
| Result | Source | This calc |
|---|---|---|
| Assembly standard deviation (RSS) | 0.4082 mm | 0.4082 mm |
| Monte Carlo standard deviation | 0.4082 ± 0.01 mm | 0.4086 mm |
| Monte Carlo yield | 100 % | 100 % |
| Monte Carlo mean | 10 ± 0.015 mm | 10.004 mm |
NIST and Scholz: 99.73% inside ±3σ
Source: NIST TN 1297 §4 and Scholz (1995), printed p.15 / attached p.23: a normal ±3σ interval contains approximately 99.73% of values. Exact erf evaluation is 99.7300204%. https://www.nist.gov/pml/nist-technical-note-1297/nist-tn-1297-4-type-b-evaluation-standard-uncertainty ; https://faculty.washington.edu/fscholz/Reports/babytol.pdf
Inputs: Dimensions in the chain = 1 dimensions; D1 signed nominal = 0 mm; D1 ± tolerance = 3 mm; Minimum acceptable result = -3 mm; Maximum acceptable result = 3 mm; Monte Carlo assemblies = 20,000 trials; the others as above.
| Result | Source | This calc |
|---|---|---|
| Assembly standard deviation (RSS) | 1 mm | 1 mm |
| Normal-model yield (approx. for non-Normal) | 99.73 % | 99.73 % |
| Monte Carlo yield | 99.73 ± 0.2 % | 99.7 % |
Published Park–Miller 10,000th state
Source: RFC 5170 §5.7 (June 2008) specifies a=16807, m=2147483647 and the independent implementation test: seed 1 must return integer state 1043618065 on draw 10,000. https://www.rfc-editor.org/rfc/rfc5170#section-5.7
Inputs: Random seed = 1; Dimensions in the chain = 1 dimensions; Monte Carlo assemblies = 5,000 trials; the others as above.
| Result | Source | This calc |
|---|---|---|
| Last integer state of the seeded random stream | 1.044 × 10⁹ | 1.044 × 10⁹ |
Percentiles: unsorted, descending, constant and repeated samples
Source: NIST e-Handbook §7.2.6.2 describes R7 at rank 1+p(N−1), with linear interpolation between sorted observations. Independent hand calculations: sorted [0,10,20,30,40] has 2.5/97.5% quantiles 1 and 39; sorted 1…100 gives 3.475 and 97.525; constant [3,3,3,3] gives 3 and 3; the repeated sample has endpoint quantiles 2 and 8. This is an algorithm regression, separate from the physical worked examples. https://www.itl.nist.gov/div898/handbook/prc/section2/prc262.htm
Inputs: Monte Carlo assemblies = 1,000 trials; the others as above.
| Result | Source | This calc |
|---|---|---|
| Known sorted-interpolation fixture results [1] | 1 | 1 |
| Known sorted-interpolation fixture results [2] | 39 | 39 |
| Known sorted-interpolation fixture results [3] | 3.475 | 3.475 |
| Known sorted-interpolation fixture results [4] | 97.525 | 97.525 |
| Known sorted-interpolation fixture results [5] | 3 | 3 |
| Known sorted-interpolation fixture results [6] | 3 | 3 |
| Known sorted-interpolation fixture results [7] | 2 | 2 |
| Known sorted-interpolation fixture results [8] | 8 | 8 |
NIST wafer measurements: published R7 90th percentile
Source: NIST e-Handbook §7.2.6.2 provides twelve silicon-wafer resistivity measurements and reports the R7 90th percentile as 95.1957 ohm·cm (rounded). The fixture checks the numerical percentile algorithm on the published numbers; it is not a physical length result. https://www.itl.nist.gov/div898/handbook/prc/section2/prc262.htm
Inputs: Monte Carlo assemblies = 1,000 trials; the others as above.
| Result | Source | This calc |
|---|---|---|
| NIST published R7 90th percentile regression | 95.196 | 95.196 |
Independent review: seeded default Monte Carlo percentile interval
Source: Independent review of board subtask #773, supplied by the user, found a sorted-interpolation Monte Carlo interval of 0.399825–0.600570 mm for the default 10,000 assemblies, seed 2026. This pins browser/server reproducibility to the independent review result, not to the browser's previous erroneous output. R7 interpolation definition: https://www.itl.nist.gov/div898/handbook/prc/section2/prc262.htm
Inputs: the default inputs above.
| Result | Source | This calc |
|---|---|---|
| Monte Carlo 2.5th percentile | 0.3998 mm | 0.3998 mm |
| Monte Carlo 97.5th percentile | 0.6006 mm | 0.6006 mm |
Related Resources
Related articles
-
Radioactive Decay Chain Simulator Using Bateman Equations and Monte Carlo Methods in Matlab -
Modern Portfolio Risk Management, Implementing Correlated Monte Carlo Simulations in MATLAB -
Matlab’s Guide to Sensitivity Analysis and Monte Carlo Simulation in Multi-Criteria Decision Making: Making Decisions You Can Trust







Responses