Embedded magnets might be my favorite trick in the entire 3D printing toolbox. I've used them for snap-close project boxes, tool holders that cling to steel shelving, and cable management clips that attach and detach without tools. Once you learn how to embed magnets properly, you'll start seeing applications everywhere.
The technique itself isn't complicated, but there are enough subtle gotchas — particularly around polarity — that I've seen plenty of people end up with beautiful prints where the magnets repel each other instead of attracting. After doing this many times and making most of the mistakes myself, here's the complete process for doing it right from the start.
Choosing the Right Magnets
Not all magnets are created equal for 3D printing applications. You want neodymium (rare earth) magnets — specifically the disc or cylinder-shaped variety. They're small, incredibly strong for their size, affordable in bulk, and easy to source online.
The two most common sizes you'll encounter in hobbyist applications are 6x2mm discs and 10x3mm discs. The first number is diameter, the second is thickness. 6x2mm discs are perfect for small enclosures, lids, and lightweight attachments. 10x3mm are better for anything load-bearing or where you want a more confident snap.
Grade matters too. N35 and N52 are the most common grades you'll find. N52 is stronger per size, but for most hobby applications either works fine. I keep a large pack of 6x2mm N35 and a pack of 10x3mm N52 on hand and that covers probably 90% of what I need.
Avoid ceramic or ferrite magnets — they're orders of magnitude weaker than neodymium and typically not worth using unless you have a specific reason. Also avoid the tiny super-thin decorative magnets you find at hobby stores — they're weak and inconsistent in size.
A 50-pack of quality neodymium disc magnets runs a few dollars on Amazon. Buy in bulk. You'll use more than you expect.
Designing Magnet Pockets in Your Model
The cleanest, most professional method of embedding magnets is designing the pocket directly into your model from the start. This gives you a precise, intentional void that holds the magnet exactly where you want it, at the right depth, with clean edges.
The key dimension is tolerance. If you design the pocket to exactly match the magnet's dimensions, the print's slight dimensional variation will likely make it too tight to insert — or the magnet will be loose and wobbly. I design pockets to be 0.2–0.3mm larger in diameter than the magnet, and exactly the magnet's thickness in depth. This gives a firm press-fit in most cases — the magnet snaps in snugly with finger pressure and friction holds it without any glue required.
If your printer runs dimensionally accurate, press-fit works beautifully. If yours runs slightly large or small, you may need to adjust that tolerance offset. Print a small calibration piece with two or three pockets at slightly different tolerances and find what gives you the best fit for your printer.
In TinkerCAD, create the pocket by making a cylinder with the pocket dimensions and using it as a hole subtracted from your model. In Fusion 360, sketch a circle at the pocket location and extrude-cut to the pocket depth. Both approaches give you a clean, precise result.
One design tip I've learned from experience: always make the pocket at least 1–2mm from any external wall or edge. Too close to an edge and the thin remaining wall may not print reliably, or the magnet pocket may distort the outer surface of your model.
The Pause-Mid-Print Method
For magnets that you want completely sealed inside a model — invisible, with no visible pocket opening — the pause-mid-print method is the technique to use. This is where you print most of the model, pause the print at a specific layer height, insert the magnet into a partially-printed cavity, then resume printing. The printer continues and covers the magnet, sealing it permanently inside.
Most slicers support this via filament change commands at a specific layer height. In OrcaSlicer and Cura, you can insert a pause command at any layer in the layer view. Set the pause to occur one layer above the bottom of the magnet cavity.
When the printer pauses, it should move the printhead away from the model — most printers do this automatically during filament change routines. You have a window of time to insert the magnet into the cavity. Drop it in and make sure it's seated flat. Then resume the print and watch as the printer closes over it.
Two important things to get right: First, make sure there are at least 2–3 solid layers below the magnet cavity before the pause. If the cavity bottom is just infill, the magnet may sink or shift. Second, make sure the cavity is slightly undersized laterally so the magnet sits snugly and doesn't slide around before the top layers seal it in.
This method works beautifully for completely hidden magnets — internal closures, embedded alignment features, magnets inside decorative objects where you don't want the pocket to be visible.
Gluing vs. Press-Fitting
There are three ways to secure a magnet in a pocket: press-fit (friction alone), glue, or a combination of both. Each has its place.
Press-fit works when your tolerance is right — the magnet goes in with firm finger pressure and stays put without assistance. This is clean, reversible if you need to replace a magnet, and requires no consumables. Test every pocket before committing to a glued solution, because press-fit is preferable when achievable.
When the press-fit is too loose — the magnet slides in too easily or wiggles — a small drop of super glue (cyanoacrylate) in the bottom of the pocket before inserting the magnet creates a permanent, rigid bond. Apply the smallest amount possible: a tiny drop, not a puddle. Too much glue will squeeze out when you insert the magnet, making a mess and potentially gluing adjacent surfaces. Apply glue, insert magnet immediately, hold for 30 seconds.
Epoxy is better than super glue for high-stress applications where the magnet will experience repeated removal force. It cures slower (giving you working time) but bonds extremely strongly. I use epoxy for magnets in cosplay armor and similar applications where pieces will be put on and taken off repeatedly.
Avoid hot glue. It's tempting because it's easy, but it doesn't bond well to PLA, and the slight flexibility of hot glue means magnets shift over time. It's also heat-sensitive — if your print ever gets warm, the hot glue softens and your magnets migrate.
Getting Polarity Right — The Step People Skip
I saved polarity for its own section because it's the detail that trips up even people who've embedded magnets before. It's easy to rush past, and the consequence of getting it wrong is a finished print where the magnets repel instead of attract — and depending on how they're embedded, that might mean the whole print is useless.
Here's the deal: two disc magnets will attract each other when opposite faces touch (north to south), and repel each other when same faces touch (north to north or south to south). When you embed magnets into two mating parts — like a box and a lid — you need the faces that will touch each other when the parts come together to be opposite poles. If both pieces have their north face pointing outward, they'll repel.
The fix is simple but requires consistency: before you use any batch of magnets, mark every single one. I put a dot on the north face with a black permanent marker. Now I can see orientation at a glance. When embedding pairs, I make sure one piece always receives a magnet with the dot facing toward me, and the mating piece receives a magnet with the dot facing away. The two dots face each other through the print, meaning opposite poles face outward on each piece, meaning they attract.
Test every pair before they go into your print. Stack a magnet from piece A and a magnet from piece B together in their intended orientation. Do they attract? Yes? Good. If they repel, flip one magnet over. Mark your arrangement before you insert them. Never trust your memory.
If you're using the pause-mid-print method for buried magnets, this testing becomes even more critical — you can't retrieve a sealed magnet if the polarity is wrong. Test your orientation setup with loose magnets before the print even starts, then be systematic and careful when inserting during the pause.
Applications Worth Trying
If you're looking for projects to practice on, here are the embedded magnet applications I come back to most often: snap-close storage boxes with lids (start here — it's simple and immediately useful), magnetic cable clips that attach to steel surfaces, wall-mounted tool holders for steel-panel workspaces, articulated models with magnetic joints, and hinged display boxes where you want a satisfying click-closed feeling.
The snap of two correctly embedded magnets coming together is weirdly satisfying every single time. Once you've printed your first magnetic box and felt that snap, you'll be looking for excuses to add magnets to everything you design.
Good luck — and check your polarity.
— Mark your magnets. Every time. Learn from my mistakes.