keepcalculator

06 Numbers and Powers

Embedding Magnets in 3D Prints: Easier Than You Think

Card No. 06·50677 · Updated · Standard formula, shown below

Pocket outer diameter 8.40 mm
Pocket outer height
5.40 mm
Result
Magnet diameter
6 mm
You entered
Magnet height
3 mm
You entered
You enter
Magnet diameter, Magnet height, Wall thickness around magnet
You get
Pocket outer diameter, Pocket outer height
Rounding
2 dp

Yes, embedding magnets in 3D prints is easier than most people expect, and you can do it with basic tools and a little planning. You insert the magnet during a pause in the print or press it into a designed pocket after printing—both methods take minutes and need no special equipment.

Formula

The calculator works out the minimum outer dimensions of a cylindrical pocket that fully surrounds a magnet of a given size, with a chosen wall thickness on all sides. The formulas are simple additions:

Outer diameter = magnet diameter + 2 × wall thickness

Outer height = magnet height + 2 × wall thickness

Where:

  • Magnet diameter (d) – the width of the cylindrical magnet, in millimeters.
  • Magnet height (h) – the length of the magnet along its axis, in millimeters.
  • Wall thickness (t) – the amount of plastic you want between the magnet and the outside surface, in millimeters. This is the same on the sides, top, and bottom.

The result gives you the minimum size of the pocket you need to design in your CAD software so the magnet is fully enclosed and the surrounding plastic is at least as thick as your chosen wall.

Worked Example

Using the default values from the calculator:

  • Magnet diameter = 6 mm
  • Magnet height = 3 mm
  • Wall thickness = 1.2 mm

Calculate the outer diameter:

6 + 2 × 1.2 = 6 + 2.4 = 8.4 mm

Calculate the outer height:

3 + 2 × 1.2 = 3 + 2.4 = 5.4 mm

So a 6 mm × 3 mm magnet needs a cylindrical pocket at least 8.4 mm in diameter and 5.4 mm tall to be fully enclosed with a 1.2 mm plastic wall. The calculator rounds to two decimals, giving the same values.

Why Embed Magnets at All?

Magnets turn static prints into functional parts: snap-fit closures for boxes, removable lids, mounting brackets for tools, door catches, and modular toys that connect without glue. Instead of designing a complex mechanical latch or using screws that wear out, a magnet gives a clean, invisible connection that works for thousands of cycles.

The two main approaches are:

  • Pause-and-insert – you pause the print at a specific layer, drop the magnet into a cavity, and let the printer continue. The magnet becomes fully trapped inside the part.
  • Press-fit pocket – you print a pocket slightly smaller than the magnet and push the magnet in afterward. This is simpler and lets you swap magnets later.

Both methods are reliable, but they require different design considerations.

How to Pause and Insert a Magnet

This method gives the strongest result because the magnet is completely encapsulated. Here is the general workflow:

  1. Design a cavity in your model that exactly matches the magnet’s dimensions plus a small clearance (0.2–0.4 mm) so the magnet drops in freely.
  2. Add a roof over the cavity – at least 2–3 layers of plastic – so the printer can bridge or print over the magnet.
  3. In your slicer, set a pause at the layer just before the roof starts. Most slicers have a “Pause at height” or “Change filament” script.
  4. When the printer pauses, remove any oozed filament, place the magnet in the cavity with the correct polarity, and resume.
  5. Let the printer finish. The magnet is now permanently sealed inside.

Common pitfalls: if the cavity is too tight, the magnet may not sit flat; if the pause is too late, the nozzle may collide with the magnet. Always test with a small print first.

Press-Fit Pockets: The Simpler Alternative

Press-fitting avoids pausing and is easier for beginners. You print a pocket with a diameter about 0.2–0.4 mm smaller than the magnet. Then you push the magnet in with your fingers or a small tool. The plastic flexes slightly and grips the magnet.

This works best with:

  • PLA and PETG – they have enough give.
  • Magnet diameters of 6 mm or larger.
  • Pockets with a small chamfer or bevel at the opening to guide the magnet in.

If the fit is too tight, the plastic may crack. If it is too loose, the magnet will fall out. A tiny drop of superglue or epoxy can secure a loose magnet, but a well-sized pocket rarely needs it.

Choosing the Right Magnet Size

Magnet size affects both holding force and printability. Common sizes for 3D printing projects are:

  • 6 mm × 3 mm – good for small boxes and light closures.
  • 8 mm × 3 mm – a bit stronger, still easy to embed.
  • 10 mm × 3 mm – for larger lids and moderate loads.
  • 12 mm × 3 mm – strong hold, but you need a thicker wall to avoid cracking.

Larger magnets (over 10 mm) can be hard to press-fit because the force is high. For those, the pause method is better. Also, neodymium magnets are brittle – they can chip or shatter if you drop them or force them into a tight hole.

Common Problems and Fixes

Even with careful planning, issues arise. Here are the most frequent ones:

  • Magnet falls out of a press-fit pocket – the pocket is too large. Redesign with a smaller diameter or add a drop of glue.
  • Plastic cracks when inserting – the pocket is too small or the wall is too thin. Increase the pocket diameter by 0.1–0.2 mm or add more wall thickness.
  • Magnet not flush with surface – the cavity depth is off. Measure the actual magnet height; they vary slightly.
  • Nozzle hits the magnet during pause-and-insert – the magnet is too tall or the pause is too late. Ensure the magnet sits below the print surface and the pause happens before the roof layers.
  • Magnet polarity wrong – mark the north side of your magnets with a permanent marker before embedding so you can orient them consistently.

Most problems are solved by adjusting clearances by 0.1 mm increments.

Safety and Practical Tips

Neodymium magnets are strong and brittle. Keep them away from children and pets – if swallowed, they can cause serious internal injuries. Also:

  • Do not let magnets snap together from a distance; they can shatter and send fragments flying.
  • Keep magnets away from credit cards, pacemakers, and electronic devices.
  • When embedding, use a plastic or brass tool to push the magnet – a steel screwdriver can scratch the coating.
  • If you pause the print, keep the hotend away from the magnet. High heat can demagnetize neodymium magnets permanently. The print bed is usually fine, but avoid direct contact with the nozzle.

For most hobby prints, standard neodymium magnets work well. If you need a stronger hold, use a larger magnet rather than a thicker one – the diameter matters more than the height for pull force.

Frequently Asked Questions

Can I embed magnets in any 3D printing material?

Yes, but some materials are easier than others. PLA and PETG are the most forgiving for press-fit pockets because they flex slightly. ABS is also workable but may need more clearance. Flexible filaments like TPU are tricky because they deform too much – the magnet may just push through. For pause-and-insert, any material works as long as the cavity is designed correctly.

How much clearance should I leave for a press-fit magnet?

Start with 0.2 mm less than the magnet diameter for the pocket. For example, a 6 mm magnet goes into a 5.8 mm hole. If that is too tight, increase the hole by 0.1 mm. If the magnet falls out, decrease it. The exact value depends on your printer’s accuracy and the material, so test on a small piece first.

Will the magnet lose strength if embedded in plastic?

No, plastic does not block magnetic fields. The holding force will be nearly the same as if the magnet were exposed, as long as the plastic wall is thin (under 2 mm). Thicker walls reduce the effective pull slightly, but for most applications the difference is negligible.

Can I remove a magnet after embedding?

It depends on the method. Press-fit magnets can usually be pushed out with a small screwdriver or by heating the plastic slightly. Pause-and-insert magnets are permanently sealed – you would have to cut or break the part to remove them. If you think you might need to swap magnets, use press-fit.

Why do my magnets crack when I press them in?

Neodymium magnets are brittle and can crack if you apply uneven pressure. Always push straight in, and use a tool that covers the whole face of the magnet. Also, make sure the pocket has a chamfered edge – a sharp 90° edge makes it much harder to insert. If the magnet is still cracking, enlarge the hole by 0.1 mm.

Related

Formula used
in d | Magnet diameter | mm | 6 | 1 | 50
in h | Magnet height | mm | 3 | 1 | 50
in t | Wall thickness around magnet | mm | 1.2 | 0.4 | 10
out od | Pocket outer diameter | mm | d + 2 * t | 2
out oh | Pocket outer height | mm | h + 2 * t | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →