Email us

PCB enclosure tolerance stack: how to check fit

Calculate PCB edge clearance and mounting-hole alignment separately using worst-case drawing limits and shared datums. An undefined enclosure tolerance cannot guarantee fit; you need minimum cavity dimensions, maximum board dimensions, and the relative position limits of the mounting features.

NEMA4 Enclosure engineering team · Published October 30, 2026 · 7 min read

Check PCB fit with two separate calculations: board-edge clearance and mounting-hole alignment. Use the smallest permitted cavity, the largest permitted board, and the greatest relative position error. A positive nominal gap does not guarantee assembly. An undefined tolerance of 0.0315 in [0.8 mm] cannot establish fit because it identifies neither the controlled feature nor the permitted variation.

The calculations below use hypothetical drawing values, not catalog dimensions or offered manufacturing tolerances. They show how to turn dimensioned drawings into an assembly decision.

Gather the dimensions that control assembly

You need the enclosure drawing, PCB fabrication drawing, mounting hardware dimensions, and intended assembly position. Obtain tolerances from the manufacturers rather than estimating them from a model or sample.

If you are still deciding the mechanical arrangement, start with choosing an enclosure before PCB layout. This procedure starts after you have a proposed board outline and mounting arrangement.

Request these details before calculating:

  • Minimum internal width and length at the actual PCB mounting height.
  • Internal corner radii, ribs, bosses, wall draft, and other local obstructions.
  • Boss-axis locations relative to identified enclosure datums.
  • Boss height, mounting-surface variation, and the specified screw or insert.
  • PCB outline dimensions, routing tolerances, corner geometry, and permitted bow or twist.
  • Finished mounting-hole diameters and their locations relative to PCB datums.
  • The relationship between the PCB outline and mounting-hole pattern.
  • Component, connector, screw-head, and tool-access envelopes.

A datum is the reference used to locate another feature. The enclosure and PCB need a defined relationship between their reference systems in the assembled condition.

Ask whether an advertised tolerance applies to an outside dimension, an inside dimension, a hole location, or a general drawing requirement. Also establish whether it means plus-or-minus variation, a total tolerance band, or a geometric tolerance zone.

An outside width tolerance alone does not establish the minimum cavity width. Wall thickness, internal features, and their tolerances also matter.

Calculate the minimum board-edge clearance

  1. Choose the actual interference section. Use the cavity at board height, not simply the opening at the lid. Check the insertion path separately if the board must pass ribs or retaining features.

  2. Calculate the smallest cavity and largest board. Apply each drawing tolerance in the direction that reduces clearance. Keep width and length calculations separate.

  3. Calculate the greatest board-position error. Include the relationship between mounting features, board outline, and cavity walls. Account for permitted assembly movement rather than assuming the board stays centered.

  4. Calculate each edge gap and compare it with your required assembly margin. Repeat the check at corners, notches, and nearby components.

For a symmetric rectangular arrangement, use:

Minimum edge gap = (minimum cavity width − maximum board width) / 2 − maximum center offset

The center-offset term is essential. Half the remaining width is available on each side only when the board is centered.

Consider this illustrative width stack. Inches govern this example; bracketed dimensions are metric equivalents.

Drawing input Nominal value and tolerance Value used for worst-case fit
Usable cavity width 4.000 ± 0.020 in [101.600 ± 0.508 mm] 3.980 in [101.092 mm] minimum
Routed PCB width 3.900 ± 0.010 in [99.060 ± 0.254 mm] 3.910 in [99.314 mm] maximum
Board-center offset from cavity center ±0.015 in [±0.381 mm] 0.015 in [0.381 mm] toward either wall

The nominal centered clearance is 0.050 in [1.270 mm] per side. That is not the guaranteed clearance.

The minimum total width difference is:

3.980 − 3.910 = 0.070 in [1.778 mm]

The minimum clearance at the more crowded edge is:

0.070 / 2 − 0.015 = 0.020 in [0.508 mm]

In this example, the center-offset allowance already includes mounting-pattern location, outline registration, and permitted assembly movement. Do not add those same contributions again.

The result establishes geometric clearance under the stated assumptions. It does not establish whether that clearance is sufficient for insertion, vibration, electrical spacing, or service access.

For an asymmetric board, calculate each edge location directly from its datum. Do not divide the total gap equally. Use the same approach for PCB edge-notch clearances and retention, where a local feature can interfere despite adequate overall width.

Check mounting-hole alignment separately

  1. Find the minimum radial fastener clearance. Use the smallest finished PCB hole and largest screw section that must pass through it. Use finished-hole dimensions, not an assumed drill diameter.

  2. Calculate the greatest relative axis displacement. Combine boss-location and PCB-hole-location errors through the assembled datum relationship. Include any additional locator error that is not already accounted for.

  3. Check the complete mounting pattern. Confirm that every fastener can enter at one permitted board position. Passing each hole independently is insufficient if different holes require conflicting board positions.

For a round screw passing through a round clearance hole:

Available radial clearance = (minimum hole diameter − maximum screw diameter) / 2

Suppose the minimum finished hole is 0.140 in [3.556 mm]. The maximum screw diameter passing through it is 0.120 in [3.048 mm]. Available radial clearance is therefore 0.010 in [0.254 mm].

For a conservative check, assume the board cannot shift or rotate from its nominal assembly position. Suppose the boss axis can vary by ±0.006 in [±0.1524 mm] in each coordinate. The corresponding PCB-hole center can vary by ±0.003 in [±0.0762 mm] in each coordinate.

Those limits give a maximum relative displacement of 0.009 in [0.2286 mm] along either axis. If both coordinate extremes can occur together, the diagonal displacement is:

Maximum axis displacement = √(0.009² + 0.009²) = 0.0127 in [approximately 0.323 mm]

That exceeds the available radial clearance. The design does not guarantee screw insertion under these assumptions, even though many individual assemblies might fit.

Do not compare each coordinate error with radial clearance separately. A circular hole must accommodate the resultant displacement.

A diametrical position tolerance requires different interpretation. For a simple circular position zone, the radial limit is half the stated diameter. Material-condition modifiers and datum mobility can change the available allowance; use the drawing's actual rules.

Possible corrections include tighter location tolerances, larger clearance holes, a revised mounting pattern, or a deliberately designed round-hole-and-slot arrangement. Check screw-head bearing area, copper keepouts, retention, and electrical spacing before changing holes.

For the mounting arrangement itself, use mounting a PCB inside an outdoor enclosure. Hole clearance should support that arrangement, not compensate for an undefined fastener or boss.

Extend the stack to the installed assembly

  1. Check height and insertion clearance. Stack the maximum component height, board thickness, mounting height, solder protrusion, and relevant flatness limits. Compare that envelope with the minimum available space beneath the closed cover and above the enclosure floor.

  2. Check connected and operating conditions. Add connector mating space, cable bends, strain relief, thermal movement, and any specified vibration allowance. These are separate requirements, not hidden reserves inside the manufacturing tolerance.

A board that clears the walls can still fail assembly because a connector must enter sideways. Likewise, a screw may align but remain inaccessible to its installation tool.

Include the cover's internal features and fasteners in the height check. Do not assume the entire external enclosure depth is usable internal space.

For mixed materials or wide temperature ranges, calculate differential expansion from verified material properties and the distance from the locating datum. PCB laminate can behave differently along different directions. Check both hot and cold conditions when either can reduce clearance.

The broader circuit board and battery enclosure layout also covers space occupied by wiring, batteries, and service access. Keep those occupied volumes visible in the assembly model.

If mounting hardware forms an intended electrical connection, treat that separately from mechanical fit. Follow the principles in grounding a PCB inside an outdoor metal enclosure; an accidentally touching screw is not a controlled bonding design.

Verify the result before releasing drawings

Review the calculations against the drawing revisions that will actually be manufactured. Record the required minimum clearance beside each calculated result.

Use these acceptance checks:

  • Every board edge and corner clears the minimum permitted cavity.
  • All mounting screws fit simultaneously at an allowed board position.
  • The cover closes without loading components or deflecting the PCB.
  • Connectors mate fully, and cables meet their specified bend requirements.
  • Screw heads and washers remain within their keepouts.
  • Assembly does not require forcing, bending, or loosening unrelated parts.

A physical trial assembly is useful for checking access, insertion sequence, and missed obstructions. One successful sample does not prove that every permitted tolerance combination will fit.

Worst-case analysis is the appropriate starting point when you need guaranteed interchangeability within drawing limits. Statistical methods require justified distributions, process data, and an agreed acceptance risk. Do not use a statistical calculation merely to make an unfavorable worst-case result disappear.

Put the controlling requirements on the drawing

Specify functional limits rather than requesting that every dimension be made tighter. A minimum cavity envelope and a controlled mounting pattern are more useful than a blanket precision statement.

Drawing or quote item What to define
Board envelope Maximum routed outline, corner radii, notches, and component overhang
Usable cavity Minimum clear envelope at PCB height and along the insertion path
Mounting pattern Datum references, hole or boss locations, and position tolerances
Hardware Fastener specification, clearance-hole limits, engagement, and bearing requirements
Vertical stack Board mounting height, underside clearance, and maximum installed component height
Acceptance Required minimum edge clearance and simultaneous fastener-fit condition

For custom enclosures, send the PCB fabrication drawing, assembly model, mounting arrangement, and calculated clearance requirements. Identify which dimensions are functional acceptance limits and which are reference dimensions.

The enclosure builder can establish the proposed size and layout. Include the tolerance requirements with the quote request, then verify the returned drawing before approval. A visual model alone does not define manufacturing acceptance.

Avoid fixes that hide an incomplete stack

Do not treat a nominal gap of 0.0394 in [1 mm] as a universal fit rule. Its adequacy depends on the complete dimensional chain and the assembly method.

Do not infer screw size from the apparent diameter of a molded boss. Use the specified fastener, engagement, and installation requirements.

Do not enlarge holes in an assembled PCB without an approved engineering change. Internal copper layers, nearby conductors, debris, and reduced mounting strength can create failures that are invisible from the surface.

Finally, do not make every mounting hole a tight locating feature. Unnecessary constraint can turn modest pattern variation into forced assembly or board stress. Define how the board is located, where variation is accommodated, and which clearances must remain after assembly.

Enclosures for this job

Catalog sizes that suit the job this article answers, picked from its subject; open one for its full specifications.

EnclosureMaterialOutside H x W x D / displayRating
12 × 10 × 6 in304 stainless12 x 10 x 6 inRated NEMA 4X / IP66 by the manufacturer; not UL listed
16 × 14 × 8 in304 stainless16 x 14 x 8 inRated NEMA 4X / IP66 by the manufacturer; not UL listed
20 × 16 × 8 in304 stainless20 x 16 x 8 inRated NEMA 4X / IP66 by the manufacturer; not UL listed

Questions

Does an unspecified enclosure tolerance establish PCB fit?

No. The tolerance must identify a feature, reference, and permitted variation. Establish whether it controls cavity size, outside dimensions, boss position, or another characteristic. You also need PCB outline and hole-location tolerances before calculating guaranteed edge clearance or fastener alignment.

Is 1 mm clearance around a PCB enough?

Not automatically. A nominal edge clearance of 0.0394 in [1 mm] can be consumed by cavity variation, PCB routing variation, and mounting-position error. Calculate the minimum remaining gap at each edge, then compare it with the clearance required for assembly and operation.

Can larger PCB mounting holes solve alignment problems?

Larger clearance holes can accommodate greater axis displacement, but they also change board movement and screw-head bearing area. Verify copper keepouts, electrical spacing, retention, and the complete mounting pattern. Make the change on approved fabrication drawings rather than drilling an assembled board.

Should PCB enclosure fit use worst-case or statistical tolerances?

Start with worst-case limits when all conforming parts must assemble interchangeably. Statistical analysis can estimate assembly yield when supported by process data and justified distributions. It does not establish guaranteed fit, and one successful sample does not validate an entire tolerance range.

Checklist before you order

Specify it once, built to your drawing

  • Environment and NEMA type: Type 1, Type 3R, Type 4, Type 4X, Type 6P, Type 12, Type 13 (manufacturer ratings, not UL listed)
  • Material: 304 stainless steel, 316L stainless steel, Powder-coated carbon steel, Aluminum, Polycarbonate, Fiberglass (FRP)
  • Size: inside or outside height, width and depth, with the depth your deepest component needs
  • Cutouts, glands and windows, dimensioned from one datum on each face
  • Mounting and access: wall, pole or stand, hinge side, mounting panel
  • Quantity: from one piece

Delivered in 10 business days, anywhere in the world. Counted from your order; for custom work, from your approval of the drawing.

Build it from 12 × 10 × 6 inRequest a custom quote

NEMA 4X enclosures: sizes for this job

Keep reading

More on layout and installation

All articles

Buying guides

The guides behind this answer

All guides