M-code reference

M06 M-Code: Tool Change

Tool Change — Performs an automatic tool change to the tool selected with T. Many machines pre-stage the next tool with a T word right after M06 to save time.

By cnccode · Updated
PropertyValue
CodeM06
FunctionTool Change
Used onMilling machines

What does M06 do?

Performs an automatic tool change to the tool selected with T. Many machines pre-stage the next tool with a T word right after M06 to save time.

M06 example

Example
T5 M06
T6 (pre-stage next tool)
G90 G54 G00 X0 Y0 S6000 M03
G43 H05 Z50.0

Tips

  • Move to a safe Z (G28/G53) before M06 if the machine does not do it automatically.
  • On lathes, the T word alone (T0101) indexes the turret; no M06 is used.

M-codes vary between machine builders. Codes from M00 to M09, M30 and M98/M99 are nearly universal; most others are defined by the machine builder. Always check the M-code list in your machine manual.

Most-used M-codes

CodeFunction
M00Program Stop
M01Optional Stop
M03Spindle On Clockwise
M04Spindle On Counter-Clockwise
M05Spindle Stop
M08Flood Coolant On
M09Coolant Off
M30Program End and Rewind
M98Subprogram Call
M99Subprogram Return / Loop

Frequently asked questions

What does M06 mean on a CNC machine?
M06 is Tool Change. Performs an automatic tool change to the tool selected with T. Many machines pre-stage the next tool with a T word right after M06 to save time.