CNC machining magnesium alloy: process basics for engineers
Magnesium cuts fast and holds tight tolerances, but the chip comes off hot and the fines can ignite. This page explains how magnesium behaves on a CNC, which alloys we machine, and where the process stops making sense. Written for design engineers and sourcing teams comparing AZ31B, AZ91D and aluminum.

In this article
- 1
- 2
- 3
- 4
- 5
- 6
What makes CNC machining magnesium alloy different
Magnesium is the lightest structural metal we cut. Density sits around 1.74 g/cm³ for AZ31B, roughly two-thirds that of aluminum and a quarter that of steel. On a part where mass drives the design, that gap shows up immediately: a housing that weighs 300 g in 6061-T6 lands near 190 g in AZ31B with the same wall thickness.
The cutting mechanics are friendlier than the numbers suggest. Magnesium has a low shear strength and a hexagonal close-packed lattice, so it forms short, discontinuous chips instead of the long stringy swarf you fight with 304 stainless. Cutting forces drop, spindle load drops, and surface finish often comes off the tool at Ra 0.8–1.6 μm without a finishing pass.
The catch is heat concentration. Magnesium has high thermal conductivity, so heat leaves the shear zone quickly and flows into the chip and the workpiece. That sounds good until you look at ignition temperature. Fine magnesium dust can ignite from a single spark, and the powder burns hot enough to be difficult to extinguish.
So the process question is not whether magnesium machines well. It does. The question is whether your shop controls chips, coolant choice, and tool geometry tightly enough to keep the risk bounded. That is where most magnesium work succeeds or fails.
Chip control and fire risk in CNC machining magnesium alloy
The rule is simple: never let fines accumulate. Magnesium chips that stay in a pile can trap heat, and a pile of fines plus a spark is the failure mode you are designing against. We run high-volume coolant or a correctly rated minimum-quantity lubrication setup so chips are flushed away from the cut immediately.
Coolant choice matters more than people expect. Water-based coolants work for many magnesium operations, but they can react with fine swarf to release hydrogen, and wet magnesium fines are harder to handle than dry ones. Mineral-oil-based coolant is the conservative pick for heavy removal, and it keeps chips coated and cool.
Tool geometry drives chip size. A high positive rake angle, typically 10–15°, produces a thin chip that exits cleanly. Zero or negative rake tools rub, generate heat, and produce dust instead of chips. We also keep depth of cut moderate and feed per tooth high enough that the tool cuts rather than polishes.
Housekeeping is a process step, not an afterthought. Chips are removed at the machine, stored in covered metal containers, and never mixed with steel or aluminum swarf. A dedicated area for magnesium keeps the whole shop out of the risk zone.
- 1No fines pilesFlush chips at the cut and clear the tray between operations.
- 2Oil-based coolant for roughingReduces hydrogen risk and keeps chip temperature down.
- 3Positive rake, sharp edges10–15° rake produces chips, not dust.
AZ31B vs AZ91D for machined parts
Two magnesium alloys cover most of the work we see. AZ31B is the wrought grade, supplied as plate, bar and extrusion. It has better ductility and formability, machines cleanly, and welds reasonably well. If your part is a bracket, panel, or housing that needs some toughness, AZ31B is usually the starting point.
AZ91D is the die-casting grade, high in aluminum and zinc, with excellent castability and good corrosion resistance. It is harder and stronger in the as-cast state but less ductile. When you machine AZ91D, you are often finishing a casting rather than cutting from solid, so you inherit casting porosity and may need to plan around it.
For high-temperature service, neither alloy is a hero. Magnesium alloys lose strength above roughly 100–125 °C, and creep becomes a design concern. If the part sits near an exhaust manifold or a hot motor, aluminum or a different alloy may be the better call even at a weight penalty.
Corrosion is the other decision point. Magnesium sits low on the galvanic series and will sacrifice itself to protect steel fasteners. Isolate dissimilar metals with coatings, plated fasteners, or a proper conversion coating, and the part holds up. Skip that step and you get white corrosion product at the joint.
Tolerances, finish and tooling on magnesium
Magnesium holds tolerance well because it does not spring back like titanium and does not work-harden like stainless. We routinely hold ±0.005 mm (±0.0002 in) on critical features, and the material's stiffness-to-weight ratio helps on thin walls where aluminum would deflect under clamping.
Thermal expansion is the trap. Magnesium expands about 26 × 10⁻⁶ per °C, higher than aluminum. A part machined at 25 °C and inspected at 20 °C moves. On long features or tight bores, we let the part stabilize and measure at a controlled temperature rather than trusting the in-process reading.
Surface finish depends on alloy and tool path. Sharp tooling and light finishing passes get you to Ra 0.8–1.6 μm on AZ31B; Ra 0.2–0.8 μm is reachable on sealing faces with a dedicated finishing pass. AZ91D tends to leave a slightly more open surface because of its cast structure.
Tooling is ordinary carbide. No exotic substrate is required, though we keep coated carbide for longer runs and polish the flutes to reduce built-up edge. Feeds and speeds run faster than aluminum, often 500–1,000 m/min surface speed, which is why cycle times on magnesium parts are short.
- 1Clamp gentlyThin magnesium walls mark easily; use soft jaws and distributed pressure.
- 2Control measuring temperatureLet parts stabilize before final inspection on tight bores.
- 3Finishing pass for sealsRa 0.2–0.8 μm on faces that carry gaskets or O-rings.
Boundaries: when magnesium is the wrong call
Magnesium is not a general replacement for aluminum. If the part sees salt spray, road splash, or humid marine air without a coating system you control, corrosion will find the weak points. Aluminum behaves better in those environments and costs less to protect.
High-temperature service is a second boundary. Above roughly 125 °C, magnesium alloys creep and lose strength. Exhaust-adjacent brackets, motor mounts near heat sources, and engine components in continuous hot zones usually belong in aluminum or steel.
Cost is not automatically lower. Raw magnesium plate often costs more per kilogram than 6061, and the safety controls add processing time. You win on weight and cycle time, not on material price. If weight is not a driver, the business case is thin.
Finally, abrasive or high-wear surfaces are a poor fit. Magnesium is soft. Threads, bearing bores, and sliding surfaces need inserts, bushings, or a hardcoat anodize. We flag those features during DFM review so they are designed in from the start.
Magnesium alloys compared with aluminum for CNC work
Values are typical ranges for the grades we machine, not specification limits.
| Property | AZ31B | AZ91D | 6061-T6 aluminum |
|---|---|---|---|
| Density | 1.74 g/cm³ | 1.81 g/cm³ | 2.70 g/cm³ |
| Form supplied | Plate, bar, extrusion | Die casting | Plate, bar, extrusion |
| Machinability | Excellent, short chips | Good, more brittle | Very good |
| Corrosion resistance | Moderate, needs coating | Better, still needs coating | Good, natural oxide |
| Max service temp | About 120 °C | About 125 °C | About 150 °C |
| Best fit | Lightweight structural parts | Cast housings, covers | General machined parts |
The short version
If weight drives the design and the part stays dry and below about 120 °C, CNC machining magnesium alloy in AZ31B is a strong choice. If it sees salt, heat, or heavy wear, use aluminum instead and accept the extra grams.
Magnesium machining questions we get
Can you machine magnesium without a dedicated fire-suppression system?
Yes, with the right controls. The risk comes from accumulated fines, not from the cut itself. We flush chips continuously, keep them in covered metal containers, and never let magnesium swarf mix with other metals.
Class D extinguishers and dry sand are staged at the machine. Water is not the first response for a magnesium chip fire.
What is the maximum part size you can run in magnesium?
Our largest travel is 4,000 × 400 × 150 mm on the big mills, with additional envelopes at 750 × 1,150 × 550 mm and 600 × 600 × 600 mm. Five-axis work uses a Ø400 mm rotary table.
Magnesium's low density helps here. A large plate that would sag under its own weight in steel stays rigid on the table.
Do magnesium parts need a surface finish?
Almost always, yes. Bare magnesium forms a gray oxide that offers limited protection. Conversion coating, anodizing, or a painted system is standard practice.
We offer anodizing, electroless nickel, plating, powder coating, and bead blasting. The right choice depends on whether the part needs corrosion resistance, wear resistance, or a cosmetic look.
How does magnesium compare to aluminum on cost per part?
Cycle time is usually shorter because magnesium cuts faster, and tool life is long. Raw material cost per kilogram is often higher than 6061.
The net result depends on part geometry. Thin-wall, high-removal parts tend to favor magnesium once you count machine hours.
Can you hold ±0.005 mm on magnesium?
Yes, on critical features. The material is stable under cut and does not work-harden, so the tool path behaves predictably.
The variable is temperature. We let parts stabilize and measure at a controlled temperature before final inspection, especially on long dimensions.
Do you sign an NDA for magnesium projects?
We do. Uploads are handled as confidential, and a non-disclosure agreement is available on request. Drawing files, models, and process details stay inside the project team.
Send your magnesium part for a DFM review
Upload a STEP file and we return a quotation with free DFM analysis within 12 hours, including a note on any feature that should be redesigned for magnesium.
12-hour quoteNo minimum order quantityNDA on request