Model a magnet hole 0.10 to 0.15 mm wider than the magnet for a press fit and 0.20 to 0.30 mm wider for glue, and make the pocket 0.1 to 0.2 mm deeper than the magnet so it sits flush. Those widths are totals across the diameter, so 0.05 to 0.075 mm and 0.10 to 0.15 mm per side. They are the magnet seller totalELEMENT’s starting values for filament (FDM) printers, which print most holes a little small.
What size hole do you need for a magnet in a 3D print?
In an FDM print, a press-fit magnet hole is 0.10 to 0.15 mm wider than the magnet and a glue-in hole 0.20 to 0.30 mm wider, both on the diameter. The pocket is 0.1 to 0.2 mm deeper than the magnet. A 6 × 2 mm magnet takes a 6.10 to 6.15 mm press-fit hole.
press-fit hole = magnet diameter + 0.10 to 0.15 mm
glue-in hole = magnet diameter + 0.20 to 0.30 mm
pocket depth = magnet thickness + 0.1 to 0.2 mm
sealed-in pocket = magnet + 0.2 mm wide and deep, rounded up to whole layers
The width figures are on the diameter. Halve them for the gap per side.
Magnet hole sizes for common disc magnets
| Magnet | Press-fit hole | Glue-in hole | Pocket depth | Sealed-in pocket, 0.2 mm layers |
|---|---|---|---|---|
| 3 × 2 mm | 3.10 to 3.15 mm | 3.20 to 3.30 mm | 2.1 to 2.2 mm | 3.2 mm wide, 2.2 mm deep (11 layers) |
| 5 × 2 mm | 5.10 to 5.15 mm | 5.20 to 5.30 mm | 2.1 to 2.2 mm | 5.2 mm wide, 2.2 mm deep (11 layers) |
| 6 × 2 mm | 6.10 to 6.15 mm | 6.20 to 6.30 mm | 2.1 to 2.2 mm | 6.2 mm wide, 2.2 mm deep (11 layers) |
| 6 × 3 mm | 6.10 to 6.15 mm | 6.20 to 6.30 mm | 3.1 to 3.2 mm | 6.2 mm wide, 3.2 mm deep (16 layers) |
| 8 × 3 mm | 8.10 to 8.15 mm | 8.20 to 8.30 mm | 3.1 to 3.2 mm | 8.2 mm wide, 3.2 mm deep (16 layers) |
| 10 × 2 mm | 10.10 to 10.15 mm | 10.20 to 10.30 mm | 2.1 to 2.2 mm | 10.2 mm wide, 2.2 mm deep (11 layers) |
| 10 × 3 mm | 10.10 to 10.15 mm | 10.20 to 10.30 mm | 3.1 to 3.2 mm | 10.2 mm wide, 3.2 mm deep (16 layers) |
| 1/4 × 1/8 in (6.35 × 3.175 mm) | 6.45 to 6.50 mm (0.254 to 0.256 in) | 6.55 to 6.65 mm (0.258 to 0.262 in) | 3.28 to 3.38 mm (0.129 to 0.133 in) | 6.55 mm wide, 3.4 mm deep (17 layers) |
A 1/4 in magnet is 6.35 mm across, not 6 mm, so it won’t go into a hole drawn for a 6 mm magnet.
totalELEMENT doesn’t split its figures by filament. QIDI’s fit guide treats PLA as the baseline and adds clearance per side for the others. Doubled onto the diameter, that moves a 6 mm magnet’s press-fit hole like this:
| Filament | QIDI adds, per side | 6 mm magnet, press-fit hole |
|---|---|---|
| PLA | 0 mm | 6.10 to 6.15 mm |
| PETG | 0 to 0.05 mm | 6.10 to 6.25 mm |
| ABS, ASA, polycarbonate (PC) | 0.05 to 0.10 mm | 6.20 to 6.35 mm |
| Unfilled nylon | 0.10 to 0.20 mm | 6.30 to 6.55 mm |
The tolerance calculator agrees once printer error is counted. Its press fit is 0.10 mm of interference on the diameter (0.05 mm per side), plus whatever your holes print small. The hole compensation calculator works an example of holes printing 0.20 mm small. On that printer a 6 mm magnet gets 6 - 0.10 + 0.20 = 6.10 mm, the table’s press-fit value.
If hole compensation already makes your holes print at their drawn size, the table runs loose. Start the test strip below at the magnet’s own diameter instead.
How to add a magnet hole to a 3D print
- Measure the magnets with calipers, diameter and thickness. Use the largest reading from the batch.
- Sketch a circle at the hole size from the table and cut it to the pocket depth. Point the hole’s axis straight up: totalELEMENT notes that upright pockets print round, while holes lying on their side print oval and need about 0.1 mm more or a teardrop shape.
- Add a 0.3 to 0.5 mm chamfer at the opening to guide the magnet in.
- Leave at least two or three perimeters of wall around the pocket so a press fit doesn’t crack the part. QIDI warns that past about 0.20 mm of interference, a printed press fit splits along a layer line instead of gripping.
- Print a test strip with five pockets: the magnet’s size plus 0, 0.1, 0.2, 0.3 and 0.4 mm. Use the real part’s filament, orientation and settings. The tightest pocket you can press the magnet into by hand is your press fit; the one with a little play is your glue fit.
No CAD file, only an STL? In PrusaSlicer, right-click the model and add a cylinder as a negative volume. Prusa’s Knowledge Base describes negative volumes as a way to “create easily resizable holes directly in PrusaSlicer.”
Press the magnet in with a flat tool or a bench vise, never a hammer. K&J Magnetics describes neodymium magnet material as “very hard and brittle,” and totalELEMENT warns that it chips.
How much does the magnet’s own tolerance matter?
A neodymium magnet’s own tolerance is as large as the fit. K&J Magnetics, First4Magnets and supermagnete each list ±0.1 mm (±0.004 in) on their disc magnets, so a 6 mm magnet can measure 5.9 to 6.1 mm. That 0.2 mm spread equals the whole glue gap and is wider than the press-fit allowance.
What that means for the hole:
- Measure, don’t trust the label. Read several magnets from the batch with calipers. A hole sized for a 6.1 mm magnet takes every magnet in the batch, and glue fills the extra around the small ones.
- Thickness varies too. K&J lists a single ±0.004 in tolerance for its discs, not separate ones for diameter and thickness. The 0.1 to 0.2 mm of extra depth covers a magnet at the thick end.
- A new batch can change the fit. A press fit tuned on one bag of magnets can bind or fall loose with the next. Re-test with a magnet from the new bag.
Why are my 3D printed magnet holes too small?
Magnet holes come out small because FDM printers print every hole undersize, with about four times the error of outside dimensions (QIDI). A coarse mesh, a squashed first layer and an oversize magnet each add to the shortfall.
Check them in this order:
- Every hole prints small. Print a test hole, measure it, and set your slicer’s hole offset with the hole compensation calculator. The per-wall value is half the shortfall: a 6.00 mm hole that measures 5.80 mm needs +0.10 mm of X-Y hole compensation in OrcaSlicer or Bambu Studio. QIDI suggests +0.10 to +0.20 mm. Or add the shortfall to the hole in CAD. QIDI also notes that no model change can make up for a profile that over-extrudes, so check flow first.
- The mesh cuts the circle short. An STL stores a circle as a polygon whose flat sides sit inside the true circle. nophead’s polyholes article gives the size across the flats as
d × cos(π / n)for n segments. A 6.10 mm press-fit hole exported with 16 segments measures 6.10 × cos(π / 16) = 5.98 mm across the flats, smaller than the magnet. Export at a finer resolution, or use a hexagon (next section). - It’s tight only at the opening. That is elephant’s foot: the first layer squashes wider than the rest, so a pocket that opens on the bottom face is tightest at the mouth. Add the 0.3 to 0.5 mm lead-in chamfer, or set the slicer’s elephant-foot compensation to QIDI’s 0.15 to 0.25 mm.
- The hole lies on its side. Add about 0.1 mm or draw a teardrop, as above.
- The magnet is oversize. A magnet at +0.1 mm takes up the whole press-fit allowance. Measure the batch.
Already printed the part? totalELEMENT suggests opening the pocket slightly with a drill bit turned by hand. For the full story on why holes print small, read how to calibrate dimensional accuracy per material.
Should a magnet hole be a hexagon?
A hexagon works around round holes printing small. nophead found that polygons with few sides don’t shrink, because “the inside of the hole is defined by straight lines and they get extruded in the correct place.” A round magnet in a hexagonal pocket bears on the six flats, and the six corners leave room for glue and displaced plastic.
Size the hexagon across the flats, not across the corners:
across flats = magnet diameter + clearance
across corners = across flats ÷ cos 30° = across flats × 1.1547
For a 6 mm magnet with 0.10 mm of clearance, that is 6.10 mm across the flats and 7.04 mm across the corners. CAD polygon tools size a polygon either by the circle through its corners or by the circle touching its flats. The magnet needs the second one. A hexagon also has no curve for the mesh export to cut short.
No magnet maker publishes a clearance for hexagonal pockets. Because the flats print closer to their drawn size than a round hole does, run the five-pocket test strip with hexagons and keep the tightest one the magnet presses into by hand.
Crush ribs
Crush ribs are the other fix. Draw the hole at the glue-in size and add narrow ribs along the wall. Only the rib tips touch the magnet, and they deform as it slides home.
Protolabs specifies “three or more” ribs for molded holes, and Hackaday covered the same technique adapted for 3D printing. Neither gives FDM rib sizes, so put the rib tips on a circle at the press-fit size and test.
How do you embed a magnet inside a 3D print?
To embed a magnet inside a 3D print, model a closed pocket 0.2 mm wider and deeper than the magnet, capped by 2 to 4 layers. Round the depth up to whole layers. Pause at the first layer covering the pocket, drop in the magnet with the correct pole up and resume printing.
The extra depth keeps the first covering layer, and the nozzle, clear of the magnet. Keep the cover thin. totalELEMENT estimates that a 6 × 2 mm N52-grade magnet keeps about 45% of its pull on steel through a 0.4 mm skin and about 21% through 1 mm. Prusa’s blog says 2 to 3 covering layers are enough to hide an inserted part.
Where to put the pause in each slicer
| Slicer (version checked) | How to add the pause | Layer to pick |
|---|---|---|
| PrusaSlicer 2.9.6 | Preview, layer slider: right-click the + icon, Add Pause | The first layer that covers the pocket. Prusa: the pause “will be inserted before the selected layer is printed.” |
| OrcaSlicer 2.4.2 | Preview, layer slider: right-click the slider handle, Add Pause | The first covering layer. The tooltip reads “Insert a pause command at the beginning of this layer.” |
| Bambu Studio 02.08.02.61 | Preview, layer slider: right-click the slider handle, Add Pause | The first covering layer, same tooltip as OrcaSlicer |
| UltiMaker Cura 5.13 | Extensions > Post Processing > Modify G-Code > Add a script > Pause at height, Pause at: Layer Number | The last layer of the open pocket, as numbered in the preview |
- OrcaSlicer and Bambu Studio grey out Add Pause when the print sequence is by object. Switch the sequence to by layer.
- Cura’s script describes its layer number as “the LAST layer you want to finish prior to the pause.” The preview numbers layers from 1, and the script pauses after that many layers, so type the preview number. The script’s Method setting picks the pause command (M0 for Marlin, M25, M226 or @pause) from your printer’s G-code flavor. Check that it matches your firmware.
- Prusa’s blog notes that users often set the change one layer too high or too low. Step through the preview around the pause before you print.
Worked example: a 6 × 2 mm magnet at 0.2 mm layers
- Pocket: 6.2 mm wide and 2.2 mm deep (11 layers), floor at 1.0 mm, so it runs from 1.0 to 3.2 mm. Put at least three layers above it, so the part is at least 3.8 mm tall there.
- The first covering layer prints from 3.2 to 3.4 mm. That is layer 17 when every layer is 0.2 mm, the first layer included.
- In PrusaSlicer, OrcaSlicer or Bambu Studio, move the slider to the 3.40 mm layer and add the pause there. In Cura, the last pocket layer is 16, so type 16.
- When the printer stops, put a dab of super glue in the pocket and press the magnet in, marked face up. Resume, and the printer bridges over the pocket to seal the magnet inside.
If your first layer is a different height from the rest, the layer numbers shift. Go by the height the slider shows rather than counting.
Getting the polarity right
Magnets in two mating parts must face each other with opposite poles, and a sealed-in magnet can’t be flipped afterward. totalELEMENT’s method: keep the magnets in one stack and mark the top face of each as you slide it off. Every marked face is the same pole.
Put marked faces out on one part and unmarked faces out on the other, and write the rule on your drawing. To check an unknown magnet, K&J notes that the north pole of a marked magnet attracts the south pole of an unmarked one.
Stopping the magnet from jumping to the nozzle
Prusa’s Knowledge Base: “When inserting magnets, they need to be firmly in their slots. Otherwise, they’ll get stuck to the print head as it passes over them.” Hardened steel nozzles and steel screws in the print head attract magnets (totalELEMENT). Use a tight pocket or a drop of super glue, as Prusa suggests.
The bed is the other risk. Magnets in the first few layers cling to a spring-steel build sheet and can pop out when you flex it to remove the part. totalELEMENT also warns that strong magnets can damage the magnetic base of a removable build plate. Set the pocket floor a few layers up.
Should you use super glue or epoxy for magnets?
Both work. Model the glue-in size, 0.20 to 0.30 mm over the magnet, so the glue has room. For epoxy, add a little depth under the magnet as well.
- Super glue (cyanoacrylate) sets fast. Prusa uses a drop to hold magnets in place during a pause, and K&J lists it as an option. supermagnete disagrees: “Superglue is also not suitable since it may damage the coating of neodymium magnets.”
- Two-part epoxy fills the gap as it cures. K&J reports “great results using many kinds of epoxy, often sold as ‘5-minute’ epoxy.” Mind the cure time before you load the part.
- Roughen the magnet first. K&J recommends lightly sanding the nickel plating before gluing.
- Skip hot glue. K&J and supermagnete both warn that its heat can demagnetize neodymium magnets. K&J adds that even “low temperature” hot melts run well above most neodymium magnets’ maximum operating temperature.
- Watch steel-filled epoxy. K&J notes that the steel in an epoxy such as JB Weld gets pulled around the magnet while the glue is wet.
- Polypropylene and polyethylene parts barely bond. K&J calls them “practically impossible to get a strong bond with,” so press-fit the magnet or seal it inside the part.
Can 3D printer heat damage the magnet?
Standard N-grade neodymium magnets are rated to 80 °C (176 °F). K&J Magnetics, First4Magnets and supermagnete all list that figure. Higher grades go further: M to 100 °C, H to 120 °C and SH to 150 °C. Strength lost to overheating does not come back when the magnet cools (totalELEMENT).
| Situation | What totalELEMENT and K&J say |
|---|---|
| Sealed in mid-print, PLA or PETG | Usually safe: the thin plastic over the magnet cools in seconds. With PETG on an 80 to 85 °C bed, set the pocket a few layers up. |
| ABS or ASA on a 95 to 110 °C bed | Above the N-grade rating near the bed: add magnets after printing, or use an SH grade |
| Pushed in with a soldering iron, or heat-set inserts nearby | The tip runs 200 to 250 °C, and K&J warns that soldering heat demagnetizes a magnet. Install inserts first and keep the iron away from magnets. |
| Annealing the finished part | Remove the magnets first, or use an SH grade |
The ratings are guides. First4Magnets says size and shape change how a magnet copes with heat, and totalELEMENT adds that thin magnets lose strength at lower temperatures than thick ones of the same grade. Give 1 mm and 2 mm discs extra margin.
Written by 3D Calculators Team· Published · Figures last checked
Sources
- totalELEMENT (Element Magnets Inc.), How much clearance should I leave for magnets in a 3D printed hole or pocket? (accessed 2026-10-26)
- totalELEMENT (Element Magnets Inc.), How to embed magnets in 3D prints (accessed 2026-10-26)
- totalELEMENT (Element Magnets Inc.), Can the heat from a 3D printer damage neodymium magnets? (accessed 2026-10-26)
- K&J Magnetics, Neodymium magnet specifications (dimensional tolerance, maximum operating temperature by grade) (accessed 2026-10-26)
- K&J Magnetics, D42: 1/4 x 1/8 inch N42 neodymium disc magnet (accessed 2026-10-26)
- K&J Magnetics, Sticky business: how to glue neodymium magnets (accessed 2026-10-26)
- K&J Magnetics, Magnet FAQ (accessed 2026-10-26)
- First4Magnets, 6mm dia x 2mm thick N42 neodymium magnet (F362) (accessed 2026-10-26)
- First4Magnets, Grades of neodymium magnets (maximum operating temperatures) (accessed 2026-10-26)
- supermagnete, Disc magnet 6 mm x 3 mm, S-06-03-N (technical data) (accessed 2026-10-26)
- supermagnete, FAQ: How can I glue magnets? (accessed 2026-10-26)
- QIDI, 3D Printed Interlocking Parts: Clearance & Fit Guide (accessed 2026-10-26)
- nophead, HydraRaptor: Polyholes (accessed 2026-10-26)
- Protolabs, Adding crush ribs to molded parts (accessed 2026-10-26)
- Hackaday, Adding crush ribs to 3D printed parts for a better press fit (2020) (accessed 2026-10-26)
- Prusa Knowledge Base, Insert pause or custom G-code at layer (accessed 2026-10-26)
- Prusa Research blog, The surprising practical uses of color change in PrusaSlicer (2021) (accessed 2026-10-26)
- Prusa Knowledge Base, Negative volume (accessed 2026-10-26)
- PrusaSlicer 2.9.6 source, DoubleSliderForLayers.cpp (Add Pause on the layer slider) (accessed 2026-10-26)
- OrcaSlicer v2.4.2 source, IMSlider.cpp (Add Pause, disabled for sequential printing) (accessed 2026-10-26)
- Bambu Studio v02.08.02.61 source, IMSlider.cpp (Add Pause tooltip) (accessed 2026-10-26)
- UltiMaker Cura 5.13.0 source, PauseAtHeight.py (Pause at height post-processing script) (accessed 2026-10-26)
- UltiMaker Cura 5.13.0 source, PostProcessingPlugin.py (Modify G-Code menu item) (accessed 2026-10-26)
- UltiMaker Cura 5.13.0 source, SimulationSliderLabel.qml (preview layer numbers start at 1) (accessed 2026-10-26)