← How-Tos
3d-printing 1 hr ago ◯ 5 min read

Designing and Embedding Magnets in 3D Printed Parts: Pocket Tolerances, Polarity, and Retention

magnetsneodymium3d printingdesignsnap fitenclosuresgridfinity

This site's Gridfinity coverage mentions magnet-bottomed bins in passing, and the general design-rules guide covers tolerances and snap fits broadly, but embedding magnets specifically โ€” sizing the pocket, keeping polarity consistent across a batch of parts, and actually retaining the magnet long-term โ€” is its own small design discipline with its own failure modes. Done well, embedded magnets turn a 3D printed part into something that snaps together, mounts to a steel panel, or self-aligns without screws or clips. Done without attention to tolerance and retention, they're the first thing that falls out of the part within a week.

Press-In vs. Printed-In-Place

MethodHow it worksBest for Press-fit pocketPrint a slightly undersized pocket, press the magnet in after printing, often with a drop of CA glue or epoxyMost designs โ€” simplest to get right, easy to replace a magnet if it's ever damaged Print-in-place (pause and insert)Pause the print at a specific layer, drop the magnet into an open pocket, resume printing to cap it with more plasticFully sealed, tamper-resistant parts (no visible pocket or glue line); requires per-print manual intervention, not practical for batches Slot-and-cap (print two parts, insert, glue a cap)Print the main body with an open-sided pocket, insert the magnet, print or press-fit a separate thin cap piece over itBatch production without pausing every single print; slightly more design and assembly work per part

Pocket Sizing

Neodymium magnets are manufactured to tight tolerances, but FDM printers are not, and the pocket's final size depends heavily on wall count, line width, and whether the pocket is a "hole" (two walls, likely to shrink more) or an open-sided pocket (likely to print closer to nominal). As a starting point for a round neodymium disc magnet on a well-tuned printer:

Keeping Polarity Consistent

A single wrongly-flipped magnet in a batch of parts meant to snap together is a frustrating thing to discover after printing twenty of them. A few practical habits prevent it:

Retention: Why Magnets Fall Out

A magnet held purely by an interference fit in FDM plastic is relying on friction against a material that creeps (slowly deforms) under sustained stress, especially in PLA at anything above room temperature โ€” a part that fit snugly on day one can loosen over weeks, especially if it lives somewhere warm like a car dashboard mount or near a sunny window. For anything beyond a low-stakes fridge magnet, back up the press fit with a small drop of cyanoacrylate (CA) glue or a two-part epoxy around the magnet's edge before it's fully seated. Avoid super glue directly on bare neodymium in high-humidity environments long-term; the glue bond to the metal is the weak point, not the plastic pocket, when parts eventually do fail.

Material and Strength Considerations

PETG and ABS hold a press-fit magnet noticeably better than PLA over time, specifically because they resist creep better at room temperature and above โ€” a meaningful consideration for anything that'll sit in a hot car, near a window, or anywhere else that gets warm. For parts that need to resist being pulled apart with real force (a magnetic latch holding a lid shut, a tool-holder meant to survive being bumped), size the magnet for the actual holding force needed rather than defaulting to whatever disc magnet is on hand โ€” neodymium magnet strength scales with volume, and a magnet twice the diameter can hold dramatically more than double the force of a thin one.

Embedded magnets are a small design detail that make a 3D printed part feel considerably more finished โ€” self-aligning lids, modular storage that actually stays put, tool mounts that snap on and off cleanly. The difference between a magnet that stays embedded for years and one that works its way loose within a month almost always comes down to the handful of tolerance and retention details above, not the magnet itself.