Mazak M-codes20 codes

Mazak M-code List

A Mazak runs M-codes in EIA/ISO programs, where the common numbers follow Fanuc; the table gives Mazak's own meaning where its machining-centre list differs from the reference. A Mazatrol program needs no M06, because each tool sequence names its tool, but it still carries M-codes: in the M-code unit, the tool sequence M-code items and the manual program unit.

Mazak M-code: 20 codes

Codes in colour link to a full page with a worked example and controller differences; the rest link to their row on the M-code list, except codes whose Mazak meaning differs from that list, which have no link.

CodeFunctionNotes
M00Program StopUnconditional program stop. Machine stops and waits for operator to press cycle start. Spindle, coolant, and feed are stopped.Use for mandatory operator intervention: part flip, inspection, manual deburr.
M01Optional StopConditional program stop. Machine stops only if Optional Stop switch is ON. Allows operator to skip stops during production runs.Controlled by Optional Stop switch on control panel. Ignored when switch is off.
M02Program EndEnds the program. Stops spindle, coolant, and feed. Cursor stays at M02 line. Does not rewind program.Use M30 instead for most applications - it rewinds to program start.
M03Spindle On CWStarts the spindle rotating clockwise (when viewed from above on a vertical mill, or from the tailstock on a lathe). Standard direction for right-hand tooling.Always verify S value is set before M03. Allow dwell (G04) after spindle start for heavy cuts.
M04Spindle On CCWStarts the spindle rotating counter-clockwise. Used for left-hand tooling, left-hand tapping, and specific operations.Used with left-hand taps (G74), left-hand helix end mills, and specific boring operations.
M05Spindle StopStops the spindle rotation. Should be called before tool changes and at program end.Spindle continues to coast - may need dwell for complete stop before tool change.
M06Tool ChangeExecutes automatic tool change. Swaps the current tool for the tool specified by the preceding T command. Machine goes through its tool change sequence.CRITICAL: Ensure safe Z position before M06. Many machines auto-retract, but always verify.
M07Mist Coolant OnActivates mist coolant (air/oil mixture). Provides lubrication with minimal coolant volume. Good for aluminum and where flood coolant is undesirable.Not all machines have mist coolant capability. Check machine configuration.
M08Flood Coolant OnActivates flood coolant. Standard coolant delivery for most machining operations. Provides cooling, lubrication, and chip evacuation.Turn on after spindle start, turn off before spindle stop to prevent splashing.
M09Coolant OffTurns off all coolant (both mist and flood). Should be called before tool changes and at program end.Always turn off coolant before spindle stop to prevent coolant spray.
M10Tool ClampClamps the tool on the spindle, not the workholding.
M11Tool UnclampUnclamps the tool on the spindle, not the workholding.
M19Spindle OrientationOrients the spindle to a specific angular position and locks it. Required for tool changes with orientation, some boring cycles, and live tooling operations.Required before G76 fine boring, some ATC machines, and B-axis live tooling on lathes.
M30Program End and RewindEnds the program and rewinds to the beginning. Stops spindle, coolant, and feed. Standard program ending code.Preferred over M02 for most applications. Program ready to run again after M30.
M33Tool Length Measurement Unit AdvanceNot lubrication off. The Mazak machining-centre list has no M32.
M42Indexing Table Reverse RotationNot a gear range. Mazak selects spindle speed range with M36 to M40.
M48Enable Feedrate OverrideEnables feedrate override. Allows operator to adjust feed rate percentage during cutting.
M49Disable Feedrate OverrideDisables feedrate override. Machine runs at exactly programmed feed rate, ignoring override knob.Use for critical feed rates like threading or tapping where override would cause problems.
M98Subprogram CallCalls a subprogram. Execution transfers to the subprogram and returns to the next line after M98 completes.Subprogram must end with M99. Useful for repeated patterns and tool paths.
M99Subprogram ReturnReturns from a subprogram to the calling program. Execution continues at the line after the M98 call.Must be at end of every subprogram. In main program, M99 loops back to start.

Where Mazak differs

  • Mazatrol conversational programs need no M06. Each tool sequence in a unit names the tool it needs. On a machining centre an EIA/ISO program uses T__ M06 as on Fanuc.
  • Coolant M-codes are not limited to EIA/ISO programs. A Mazatrol program carries them in an M-code unit or in the M-code items of a tool sequence. Mazak's EIA/ISO list gives M7 mist, M8 coolant, M9 all coolant and air off and M51 through-spindle coolant.
  • M-code numbers above the common set are model-specific. The Integrex lists differ from the mill lists, so a number from one machine's list does not carry to another without that machine's manual.
  • The reference marks M32 and M33 lubrication for Mazak, but Mazak's own EIA/ISO list for machining centres has no M32 and gives M33 as tool length measurement unit advance, so the table leaves M32 out and gives M33 the Mazak meaning.
  • The reference also marks M29 rigid tapping, M41 and M42 gear range and M60 pallet change for Mazak. The Mazak machining-centre list has no M29, M41 or M60, so the table leaves them out. It selects spindle speed range with M36 to M40, reverses the indexing table with M42, clamps and unclamps the pallet with M68 and M69, and clamps and unclamps the tool on the spindle with M10 and M11. M50 is air blast and M51 through-spindle coolant, not pallet clamp.
  • M13 and M14 spindle-plus-coolant, M21 to M23 mirror image and M36, M37 part counters are not on the Mazak list in the reference.

Frequently asked questions

Where do the M-codes go in a Mazatrol program?

In the M-code unit, which outputs the M-codes entered in it, and in the M-code items of each tool sequence. A manual program unit takes G and M codes in EIA/ISO form. Tool changes need no M06, because each tool sequence names its tool.

Are Mazak EIA/ISO M-codes the same as Fanuc?

For the common set on a machining centre, yes: Mazak's EIA/ISO list gives M0, M1, M2 and M30, M3 to M5, M6, M7 to M9, M98 and M99 the usual meanings. Above that the numbers are model-specific. On an Integrex e-series M3 to M5 drive the milling spindle and the turning spindle takes M203 to M205, so the machine's own list is the reference for anything unusual. See M-code list.

Does M06 do the same thing on a Mazak as on a Fanuc?

On a machining centre, yes: Mazak's EIA/ISO list gives M6 as the tool change, written T__ M06. In a Mazatrol conversational program there is no M06 block, because each tool sequence names its tool. See M06: tool change.

Other controller lists

Last updated 24 Oct 2026