Captive nuts and bolt clearances

4 min readUpdated Jun 2026

The cheapest reliable thread in a printed part is the one you don't print: trap a real steel nut inside the model and let the bolt thread into that. A nut trap is a hex pocket sized to swallow a standard nut, positioned so the nut can't spin once a bolt pulls against it. Pair it with a correctly sized clearance hole on the other side and you have a joint as strong as the hardware, made from parts you already own. This article covers the pocket, the clearance hole, the counterbore, and — the part people botch — which way to orient the pocket so it prints.

The hex pocket

Model the pocket as a hexagonal prism matching the nut's across-flats dimension, plus about 0.2 mm clearance so the nut drops in without forcing. Set the pocket depth equal to the nut's thickness so the nut sits flush and the bolt's threads engage fully past it.

Too tight and you'll be filing every nut in; too loose and the nut rattles and spins instead of catching the wrenching faces. 0.2 mm across flats is the sweet spot for a 0.4 mm nozzle — print one and adjust by tenths if your machine runs tight.

Metric nut traps and clearance holes (0.4 mm nozzle)
Bolt Nut across-flats Hex pocket (flats + 0.2) Clearance hole Ø
M3 5.5 mm ~5.7 mm ~3.4 mm
M4 7.0 mm ~7.2 mm ~4.5 mm
M5 8.0 mm ~8.2 mm ~5.5 mm
3D
A hex nut captured in a pocket, with the bolt threading in from the far side.

Clearance holes and counterbores

The bolt shaft must pass freely through the part it clamps, not thread into it. Make that clearance hole ≈ bolt Ø + 0.4–0.5 mm — an M3 gets ~3.4 mm, an M4 ~4.5 mm. Anything tighter and the bolt binds on the rough printed wall and you lose clamping force fighting friction.

For a socket-head cap screw sitting flush or recessed, add a counterbore: a wider, flat-bottomed pocket above the clearance hole, sized to the bolt head's diameter plus a little, deep enough to bury the head. Now the head pulls against a flat printed floor instead of standing proud — clean on an enclosure lid, and it lets two panels sit face to face.

Orient the pocket so it prints

A nut trap is a pocket, and a pocket has a roof — the layers that close over the top of the cavity once the nut is in. That roof is an overhang, and how you orient the part decides whether it prints clean or sags into the nut.

Two good options:

  • Roof bridges across the top. If the pocket opening faces down or sideways relative to the build, the closing layers bridge the hex opening. A nut pocket is small — well within a clean bridge span — so this prints fine. See Supports and bridging for the span limits.
  • Pocket opens out a side wall. Even simpler: put the hex opening on a vertical face so you slide the nut in horizontally. No roof to bridge at all, and you can drop the nut in after printing.

Where to use which

Nut traps win when the part is too thin or too soft for a heat-set insert, or when you simply have a drawer of M3 nuts and want a fastener tonight. For a cleaner, reusable thread that takes repeated assembly — and no loose nut to drop during build — reach for Designing for heat-set inserts instead. Both beat a printed thread for anything under M6.