Size a nut trap across the flats: the nut’s wrench size plus 0.2 mm in total for a nut that drops in, or plus 0 to 0.1 mm for one you press in. Make the pocket 0.1 mm deeper than the nut, rounded up to whole layers. For an M3 nut, that is 5.7 mm across the flats and 2.6 mm deep.
What size nut trap does an M3 nut need?
An M3 nut trap is a hexagonal pocket 5.7 mm across the flats and 2.6 mm deep, for an ISO 4032 M3 nut (5.5 mm across the flats, 2.4 mm tall) that drops in by hand. For a press-in fit, model 5.5 to 5.6 mm across the flats. Pair the pocket with a 3.4 mm screw clearance hole.
| M3 nut trap | Size | Where it comes from |
|---|---|---|
| Across flats, slide-in | 5.70 mm | 5.5 mm + 0.10 mm per side |
| Across corners, slide-in | 6.58 mm | 5.70 × 1.1547 |
| Across flats, press-in | 5.50 to 5.60 mm | 5.5 mm + 0 to 0.05 mm per side |
| Depth, regular nut (ISO 4032) | 2.6 mm | 2.4 mm + 0.1 mm, rounded up to 0.2 mm layers |
| Depth, thin nut (ISO 4035) | 2.0 mm | 1.8 mm + 0.1 mm, rounded up |
| Depth, nylon-insert nut (DIN 985) | 4.2 mm | 4.0 mm + 0.1 mm, rounded up |
| Screw clearance hole | 3.4 mm | ISO 273 and ASME B18.2.8 normal fit |
Hubs gives 0.1 mm per side as its starting point for a nut pocket: “a 0.2 mm offset around the nut (0.1 mm on each side) should give a loose fit.” The OpenFlexure microscope project settled on the same 5.7 mm trap for M3 nuts in 2024. Its tight option is 5.6 mm, and it notes that “3D printers slightly undersize small holes.” On the tolerance calculator, 0.10 mm per side is the snug fit.
The pocket also has a maximum. It has to stay narrower across the flats than the nut is across its corners, or the nut turns with the screw. ISO 4032 lets an M3 nut’s corners measure as little as 6.01 mm, so a 5.7 mm pocket still blocks it by 0.31 mm.
QIDI’s fit table for filament (FDM) printers lists a captive hex nut pocket at +0.20 to 0.30 mm across flats and +0.10 mm on depth, under a column headed per side. Read per side, an M3 pocket would be 5.9 to 6.1 mm wide and reach the nut’s 6.01 mm corners. Read it as a total, which agrees with Hubs and OpenFlexure. QIDI assumes a 0.4 mm nozzle, 0.2 mm layers and PLA or PETG.
Across flats or across corners: which do you model?
Model the pocket across the flats, the wrench size the nut standards list. CAD tools that draw a hexagon from a circle through its corners need the across-corners size instead:
pocket across flats S = s + C
pocket across corners E = S ÷ cos 30° = 1.1547 × S
M3, slide-in: S = 5.5 + 0.2 = 5.7 mm E = 1.1547 × 5.7 = 6.58 mm
- s is the nut’s width across the flats, the maximum the standard allows.
- C is the total clearance, twice the per-side value: 0.2 mm for slide-in, 0 to 0.1 mm for press-in.
OpenSCAD: a cylinder() with $fn = 6 is a hexagon whose corners touch the circle. In the manual’s words, “the points of the polygon are on the circle, but straight lines between are inside.” So d is the across-corners size:
cylinder(d = 5.7 / cos(30), h = 2.6, $fn = 6); // 6.58 mm corners, 5.7 mm flats
If you type d = 5.7, the hexagon comes out 4.94 mm across the flats, too small for the nut.
Autodesk Fusion: the Circumscribed Polygon tool puts the midpoint of each edge on its circle, so that circle is the across-flats size. The Inscribed Polygon tool puts the corners on the circle, so its circle is the across-corners size. For the M3 pocket, draw a six-sided circumscribed polygon whose circle is 5.7 mm across.
Nut trap sizes for M2 to M8 nuts
| Nut | Across flats | Height | Slide-in pocket (corners) | Press-in pocket | Depth | Screw hole |
|---|---|---|---|---|---|---|
| M2 | 4.00 mm | 1.60 mm | 4.20 mm (4.85) | 4.00 to 4.10 mm | 1.8 mm | 2.4 mm |
| M2.5 | 5.00 mm | 2.00 mm | 5.20 mm (6.00) | 5.00 to 5.10 mm | 2.2 mm | 2.9 mm |
| M3 | 5.50 mm | 2.40 mm | 5.70 mm (6.58) | 5.50 to 5.60 mm | 2.6 mm | 3.4 mm |
| M4 | 7.00 mm | 3.20 mm | 7.20 mm (8.31) | 7.00 to 7.10 mm | 3.4 mm | 4.5 mm |
| M5 | 8.00 mm | 4.70 mm | 8.20 mm (9.47) | 8.00 to 8.10 mm | 4.8 mm | 5.5 mm |
| M6 | 10.00 mm | 5.20 mm | 10.20 mm (11.78) | 10.00 to 10.10 mm | 5.4 mm | 6.6 mm |
| M8 | 13.00 mm | 6.80 mm | 13.20 mm (15.24) | 13.00 to 13.10 mm | 7.0 mm | 9.0 mm |
- Nut: an ISO 4032 regular hex nut, with the standard’s maximum width and height as reproduced by AmesWeb.
- Slide-in: 0.10 mm per side, 0.20 mm total. Press-in: 0 to 0.05 mm per side, 0 to 0.10 mm total. The corners figure is the one to enter as OpenSCAD’s
d. - Depth: nut height plus QIDI’s 0.10 mm, rounded up to whole 0.2 mm layers. QIDI notes that the slicer can only place whole layers, so at 0.12 mm layers, round to a multiple of 0.12 mm instead.
- Screw hole: the ISO 273 medium (normal) clearance hole, the default in the screw hole size calculator.
M2 has the least margin. Its 4.20 mm slide-in pocket sits only 0.12 mm under the nut’s 4.32 mm minimum across corners, so don’t open an M2 pocket any wider. By M8 the margin is 1.18 mm.
Thin nuts, nylon-insert nuts and DIN 934 nuts
Thin nuts and nylon-insert nuts have the same width across the flats as the ISO 4032 nut, so only the depth changes:
| Nut | ISO 4035 thin nut | Depth | DIN 985 nylon-insert nut | Depth |
|---|---|---|---|---|
| M2 | 1.20 mm | 1.4 mm | not in DIN 985 | |
| M2.5 | 1.60 mm | 1.8 mm | not in DIN 985 | |
| M3 | 1.80 mm | 2.0 mm | 4.0 mm | 4.2 mm |
| M4 | 2.20 mm | 2.4 mm | 5.0 mm | 5.2 mm |
| M5 | 2.70 mm | 2.8 mm | 5.0 mm | 5.2 mm |
| M6 | 3.20 mm | 3.4 mm | 6.0 mm | 6.2 mm |
| M8 | 4.00 mm | 4.2 mm | 8.0 mm | 8.2 mm |
DIN 985 is the thin type of nylon-insert lock nut. A regular-height ISO 7040 nylon-insert nut is taller: 4.5 mm at M3 and 9.5 mm at M8.
Nuts labeled DIN 934 follow the German standard that ISO 4032 replaced. According to the fastener distributor Dresselhaus, ISO 4032 changed the wrench size of four nuts (M10, M12, M14 and M22) and made nuts from M5 up taller. From M2 to M8, a DIN 934 nut has the same width across the flats and is no taller, so it fits the ISO pocket.
Nut trap sizes for US nuts
| Nut | Across flats | Height | Slide-in pocket | Press-in pocket | Depth | Screw hole |
|---|---|---|---|---|---|---|
| #4-40 | 1/4 in (6.35 mm) | 0.098 in (2.49 mm) | 6.55 mm (0.258 in) | 6.35 to 6.45 mm | 2.6 mm (0.102 in) | 0.128 in (3.25 mm) |
| #6-32 | 5/16 in (7.92 mm) | 0.114 in (2.90 mm) | 8.12 mm (0.320 in) | 7.92 to 8.02 mm | 3.0 mm (0.118 in) | 0.170 in (4.32 mm) |
| #8-32 | 11/32 in (8.74 mm) | 0.130 in (3.30 mm) | 8.94 mm (0.352 in) | 8.74 to 8.84 mm | 3.6 mm (0.142 in) | 0.196 in (4.98 mm) |
| 1/4-20 | 7/16 in (11.13 mm) | 0.226 in (5.74 mm) | 11.33 mm (0.446 in) | 11.13 to 11.23 mm | 6.0 mm (0.236 in) | 0.281 in (7.14 mm) |
- Nut: #4 to #8 are hex machine screw nuts under ASME B18.6.3. The 1/4-20 is a hex nut under ASME B18.2.2. Width and height are each standard’s maximum (0.312 in for the 5/16 in nut), from AmesWeb’s tables.
- Pocket and depth: the same rules as the metric table, 0.20 mm wider in total and 0.1 mm deeper, rounded up to 0.2 mm layers.
- Screw hole: the ASME B18.2.8 normal fit, the minimum hole size.
Small-pattern machine screw nuts are narrower. Albany County Fasteners sells a #4-40 small-pattern nut at 3/16 in (4.76 mm) across the flats and 1/16 in thick, against 1/4 in for the standard nut. Measure your nut with calipers before you model the pocket, as Hubs advises.
Side-entry slot or vertical pocket?
Use a vertical pocket when a face of the part is free, and a side-entry slot when the nut has to sit inside the part, away from every face. A vertical pocket is a hexagon cut into a face on the screw’s axis, and the nut drops in along the screw. A side-entry slot runs in from an edge of the part, and the nut slides in at right angles to the screw.
- Vertical pocket: open it on the face away from the screw head. Tightening then seats the nut against the pocket floor.
- Side-entry slot: make it as wide as the slide-in pocket and as tall as the depth column: 5.7 mm by 2.6 mm for M3. Two flats ride on the slot walls, and those walls stop the nut from turning. Run the slot past the screw axis by half the pocket’s width across corners (3.3 mm for M3), or end it in half a hexagon, so the nut stops centered on the screw.
- A slot that binds: QIDI says friction “rises sharply below 0.20 mm” per side, because layer ridges act as interference. Widen the slot to 0.20 mm per side (5.9 mm for M3), and no further. A slot wider than the nut’s 6.01 mm minimum across corners lets the nut turn.
- A nut that falls out before the screw goes in: Prusa’s assembly guide holds it with a piece of tape until the screw catches. It advises against glue, which “can partly reach into the thread”. Hubs suggests a drop of superglue on the back of a nut that stays in for good.
How do you print a nut trap without supports?
Print the pocket opening upward and it needs no support. A pocket that opens onto the bed has a ceiling the printer must bridge, and so does a closed slot. The screw hole runs through that ceiling, and Hackaday points out that a hole in a bridge makes the printer draw circles in mid-air. A sacrificial layer fixes it.
- Sacrificial layer in the model: start the screw hole one layer above the pocket’s ceiling. The printer first lays a thin solid bridge across the pocket, then prints the round hole on top. Afterward, drill or poke through the thin layer. Hackaday described the trick in 2017 for a hex nut captive under a bridge.
- Sacrificial layer in OrcaSlicer: the Bridge counterbore holes setting (Advanced mode, bridging quality settings) has three modes: None, Partially bridged and Sacrificial layer. Sacrificial layer closes the hole, and it “must be broken through after printing.” The default is None. In OrcaSlicer’s source, the setting acts on any bridged layer with a hole through it, which includes the ceiling of a nut pocket.
- Nut on edge, screw horizontal: put a flat of the hexagon on top. The top becomes a short bridge, one side of the hexagon long: 3.3 mm in a 5.7 mm M3 pocket. The two faces below it lean 30° from vertical. Prusa says overhangs of 45 to 60 degrees print cleanly, and short bridges print without supports. With a corner on top, both roof faces lean 60° from vertical, the edge of that range.
- Nut sealed inside the part: pause the print before the layer that closes the pocket, drop the nut in and resume. In PrusaSlicer, right-click the plus icon on the layer slider and pick “Insert pause print (M601).” The pause comes before the selected layer. The extra 0.1 mm of depth keeps the nut clear of the layer printed over the pocket.
Can you press fit a nut into a 3D print?
Yes. Model the pocket at the nut’s width across the flats or up to 0.1 mm over it (0 to 0.05 mm per side): 5.5 to 5.6 mm for an M3 nut. Press the nut in with a vise, or pull it in with a screw. Unlike a slide-in nut, it stays in when the part is turned upside down.
To pull a nut in, use Prusa’s “screw pulling technique.” Take a screw threaded along its whole length (M3x10 or M3x18 in Prusa’s kits) and drive it in from the side opposite the pocket’s opening. Tightening the screw draws the nut into the pocket. Then remove the screw.
The tolerance calculator’s press fit is 0.05 mm of interference per side, but that value is for a printed pin. A steel nut doesn’t compress. As QIDI puts it, “all the allowance has to live in the plastic.” QIDI adds that beyond about 0.20 mm of interference, the boss splits along a layer line instead of gripping.
Your printer shifts the numbers too. The Creative Computing Institute lab at University of the Arts London publishes a press fit of 0 to 0.05 mm per side on its Bambu H2D Pro and 0.2 mm per side on its UltiMaker S7. On a printer that behaves like the lab’s S7, even the slide-in pocket from the tables needs pressing. Print one test pocket before the part.
When the nut still doesn’t fit
- Too tight: measure the printed pocket across its flats. Add the shortfall to the model, or turn it into the slicer’s X-Y hole compensation with the hole compensation calculator. For a press-in pocket, pull the nut in with a screw first.
- The nut spins: the pocket is wider than the nut’s corners. Reprint 0.1 mm narrower, or glue the nut.
- The nut stands proud: check its height against the tables. A DIN 985 M3 nut is 1.6 mm taller than an ISO 4032 one. Take the depth from the matching row, and if the nut still sits high, deepen the pocket by one layer.
- Two printed parts instead of a nut: a pin in a hole or a lid on a box follows the tolerance calculator.
Written by 3D Calculators Team· Published · Figures last checked
Sources
- AmesWeb, Metric hex nut dimensions chart (ISO 4032:1999) (accessed 2026-10-26)
- AmesWeb, Hex jam nut (hex thin nut) dimensions, ISO 4035 and ISO 4036 (accessed 2026-10-26)
- Global Fastener, DIN 985-1987 prevailing torque type hexagon thin nuts with non-metallic insert (dimension table) (accessed 2026-10-26)
- AmesWeb, Nylon insert locknut dimensions (ISO 7040 and ISO 7041) (accessed 2026-10-26)
- Dresselhaus, Standardisation overview: DIN 934 > DIN EN ISO 4032 (accessed 2026-10-26)
- AmesWeb, Machine screw nut dimensions (ASME B18.6.3-2003) (accessed 2026-10-26)
- AmesWeb, Hex nut, hex jam nut and heavy hex nut dimensions (ASME B18.2.2-1987) (accessed 2026-10-26)
- Albany County Fasteners, Hex machine screw nuts, small pattern, #4-40 (accessed 2026-10-26)
- AmesWeb, Metric clearance hole chart per ASME B18.2.8 (accessed 2026-10-26)
- AmesWeb, Clearance hole chart for inch fasteners per ASME B18.2.8 (accessed 2026-10-26)
- Hubs, How to assemble 3D printed parts with threaded fasteners (accessed 2026-10-26)
- QIDI, 3D Printed Interlocking Parts: Clearance & Fit Guide (accessed 2026-10-26)
- OpenFlexure Microscope, merge request !371: Basing all m3 nut trap sizes off ISO 4032 (2024) (accessed 2026-10-26)
- UAL Creative Computing Institute wiki, Design the clearance and tolerance (accessed 2026-10-26)
- Prusa Knowledge Base, Modeling with 3D printing in mind (accessed 2026-10-26)
- Prusa Knowledge Base, Original Prusa i3 MK3S+ kit assembly, 1. Introduction (Pro tip: inserting the nuts) (accessed 2026-10-26)
- Prusa Knowledge Base, Insert pause or custom G-code at layer (accessed 2026-10-26)
- OpenSCAD User Manual, Primitive Solids (cylinder and undersized holes) (accessed 2026-10-26)
- Autodesk Fusion Help, Create polygons (accessed 2026-10-26)
- Hackaday, Donald Papp, Sacrificial bridge avoids 3D printed supports (2017) (accessed 2026-10-26)
- OrcaSlicer Wiki, Bridging settings (Bridge counterbore hole) (accessed 2026-10-26)
- OrcaSlicer source, PerimeterGenerator.cpp (process_no_bridge, sacrificial bridge layer) (accessed 2026-10-26)