How to Use Magnets in 3D Printed Models
This guide covers magnets in 3D printed models for parts that snap together and stay together: pocket sizing, polarity control, glue selection, and heat-set inserts. Written for design engineers and makers who need the joint to survive real handling, not just one demo.

In this article
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
Key takeaways
Pick the magnet before you pick the pocket
Most failed magnet joints are decided at the CAD stage, not at the printer. A neodymium disc rated N35 to N42 gives the strongest pull for its size, but it is also brittle and chips if the pocket fights it. Nickel plating is standard and fine indoors; for humid or outdoor parts, look for epoxy-coated or stainless-housed versions.
Pull force falls off fast with distance. A N35 disc of Ø10 × 3 mm might hold 1.5 kg at zero gap and less than 300 g at 1 mm. Two magnets stacked in series double the thickness but do not double the pull. In most snap-fit covers, a pair of Ø6 × 2 mm discs is enough.
Temperature matters more than people expect. Standard N grades lose strength above roughly 80 °C, and a heated chamber or a hot-melt insert can push a pocket that far. Keep magnets at least 15 mm away from any hot end, heated bed edge, or insert you plan to melt in later.
- 1N35 to N42Good pull per millimeter; brittle, so pocket walls must not squeeze.
- 2Epoxy coatedBetter for humidity and wash-down parts than plain nickel.
- 3Ø6 × 2 mm pairTypical size for small lids, trays and modular tiles.
Pocket geometry and the clearances that hold
Print a round pocket 0.2 mm larger than the magnet diameter and 0.2 mm deeper than its thickness. A Ø10 × 3 mm disc goes into a Ø10.2 × 3.2 mm pocket. That gap absorbs the usual FDM tolerance of ±0.1 to ±0.2 mm and still leaves the magnet sitting below the surface for a clean joint.
If you want a flush face, print the pocket 0.1 mm deeper and cover the magnet with a 0.4 mm printed skin. Two perimeters at 0.2 mm layer height is enough. The skin costs you roughly 0.4 mm of gap, so size the magnet up if holding force is tight.
Wall thickness around the pocket should be at least 1.2 mm on FDM and 0.8 mm on resin. Thinner than that and the layer lines split when the magnet snaps in. Add a small chamfer at the pocket mouth if you are pressing magnets in by hand; it stops the corner of the magnet from shaving the wall.
- 1+0.2 mm on diameterCovers printer tolerance without letting the magnet rattle.
- 2+0.2 mm on depthLeaves room for adhesive under the magnet.
- 31.2 mm minimum wallThinner walls crack on press-in assembly.
Polarity: the mistake that wastes a print
Magnets in 3D printed models fail most often because one pocket got the wrong pole. Before anything else, stack your magnets on a steel screw so they self-align, then mark the outward face of every magnet with a paint pen. Keep the stack together until each magnet is in its pocket.
A simpler rule works for two-part assemblies: all magnets on part A face the same way, all magnets on part B face the opposite way. If you flip one, the halves repel and no amount of glue fixes it. Test the pair outside the print before you commit to adhesive.
When you pause the print to insert magnets, drop them in with tweezers and check seating with a straight edge. A magnet sitting 0.3 mm proud will hit the nozzle on the next layer. If it does not sit flat, stop the print; a reprint costs less than a scrapped assembly.
- 1Mark before you separateOne paint dot per outward face, applied while the stack is intact.
- 2Mirror the patternPart A and part B use opposite outward poles.
Gluing and heat-set methods compared
Cyanoacrylate gel is the default for PLA, PETG and ABS pockets. It fills the 0.2 mm gap, sets in under a minute, and does not need clamping. Epoxy gives a stronger bond on resin and on parts that see heat, but it needs 24 hours to reach full strength.
Heat-set inserts and press fits are a different approach: print the pocket slightly undersized, then warm the magnet and push it in with a soldering iron at 200 to 250 °C. This works well in thick resin walls, but it can crack thin FDM walls and it exposes the magnet to heat. Use it only when the surrounding material is at least 2.5 mm thick.
For parts that must stay clean, seal the pocket opening with a drop of epoxy after insertion. This keeps moisture out and stops the magnet from creeping toward the surface over hundreds of cycles. Do not use hot glue; it creeps under load and softens in a car interior.
- 1CA gelFast, no clamp, good for most desktop prints.
- 2Two-part epoxyStronger and heat resistant; 24 hours to cure.
- 3Heat-setOnly in walls of 2.5 mm or more.
Checking holding force before you print ten of them
Print one test coupon with the exact pocket and magnet you plan to use. Measure the pull with a spring scale or a luggage scale hooked to the mating half. Record the number, then cycle the joint 50 times and measure again. A drop of more than 20 percent means the pocket is loose or the adhesive did not wet the floor.
Air gap is the biggest lever. Every 0.1 mm of printed skin or paint between the two magnets costs measurable force. If the joint feels weak, remove the cover skin before you change the magnet grade.
When the part is a functional assembly rather than a display model, plan a mechanical backup: a small lip, a screw, or a snap tab. Magnets should locate and hold, not carry the whole load. That single design habit removes most field failures.
- 1Test coupon firstOne print tells you more than a pull-force table.
- 2Cycle 50 timesHolding force should stay within 20 percent.
- 3Add a backupA lip or tab takes shock loads off the magnet.
Step by step: embedding magnets in a print
Work through these in order. Skipping the polarity step is the most common cause of a wasted print.
- 11. Measure the magnetUse calipers, not the catalog. Nickel plating adds 0.02 to 0.05 mm. Record diameter and thickness to 0.01 mm.
- 22. Size the pocketAdd 0.2 mm to diameter and 0.2 mm to depth. Keep walls at 1.2 mm minimum on FDM.
- 33. Add the pauseIn the slicer, insert a pause at the layer where the pocket roof begins. Confirm the height in the preview before exporting.
- 44. Mark polarityStack magnets on a steel screw, mark the outward faces with a paint pen, and keep the stack together.
- 55. Insert at the pausePlace magnets with tweezers, check they sit flush with a straight edge, then resume. Never let one sit proud.
- 66. Glue open pocketsFor print-then-insert designs, apply CA gel or epoxy to the pocket floor and press the magnet in. Wipe squeeze-out immediately.
- 77. Seal and cureAdd a thin epoxy cap over the opening and let it cure 24 hours before the part sees load.
- 88. Pull-test the pairCheck holding force, cycle the joint 50 times, and recheck. Adjust the pocket, not the magnet, if it drifts.
Which embedding method fits your part
Pick the row that matches your wall thickness and production quantity.
| Method | Best for | Wall thickness | Watch out for |
|---|---|---|---|
| Pause and insert | Closed pockets, clean faces | 1.2 mm or more | Nozzle hits a proud magnet |
| Print then glue | Open pockets, one-off parts | 1.0 mm or more | Glue squeeze-out on the face |
| Press fit | Resin parts, tight tolerance | 1.0 mm or more | Cracks in brittle resin |
| Heat-set insert | Thick walls, repair work | 2.5 mm or more | Heat weakens N-grade magnets |
| Captive in resin | SLA parts with smooth skins | 0.8 mm or more | Magnet shifts before cure |
Common questions
Do I need to pause the print to add magnets?
Only if you want a fully closed pocket. A pause at the roof layer lets you drop the magnet in and print over it, which hides the magnet completely.
Open pockets are easier: print the pocket, then glue the magnet in afterward. The joint is slightly less clean but far more forgiving on a first attempt.
How much clearance should a magnet pocket have?
Start with 0.2 mm over the magnet diameter and 0.2 mm over its thickness. That covers typical FDM tolerance of ±0.1 to ±0.2 mm.
If the magnet drops in loose enough to rattle, tighten to 0.1 mm. If it will not seat by hand, open the pocket rather than forcing it; forcing chips the nickel plating.
Will glue hold a magnet in a 3D printed part?
Yes, if the pocket floor is flat and clean. Cyanoacrylate gel bonds well to PLA, PETG and ABS and sets in under a minute.
Epoxy is stronger and more heat resistant but needs 24 hours. Avoid hot glue; it creeps under load and softens in a warm enclosure.
How do I stop magnets from going in the wrong way?
Stack the magnets on a steel screw so they self-align, then mark the outward face of each with a paint pen before you separate them.
For two-part assemblies, use the rule that all magnets in part A face one way and all magnets in part B face the other. Test the pair outside the print first.
Do magnets lose strength during printing?
Standard N-grade neodymium magnets lose strength above roughly 80 °C, so keep them away from the hot end and heated bed edge.
A normal FDM chamber at 40 to 60 °C is fine. If you heat-set a magnet with a soldering iron, expect some loss and size the magnet accordingly.
How many magnets does a snap-fit cover need?
Two magnets per corner pair is usually enough for a small lid or tray. A pair of Ø6 × 2 mm discs holds most desktop-size covers.
Larger panels need more pairs or bigger discs. Add a locating lip so the magnets only carry the closing force, not the shear load.
Need the housing machined instead of printed?
Send us your model and we will return a quotation with free DFM analysis within 12 hours.
12-hour quote100% inspectionNo minimum order quantity