CNC mill · M-code

M06: tool change

M06 puts the tool named by T into the spindle. Formats below from Haas and LinuxCNC, each from its maker.

Worked example

Change to tool 5 and pick up its length. Written for this page in the Haas format.

M05 M09 (optional: M06 stops both anyway)T5 M06G43 H05 Z1.

How each control writes it

Haas T- M06

One source: Haas Automation, the control's maker

T
Tool number
  • M06 stops the spindle and coolant (including through-spindle coolant), moves Z to the tool change position and orients the spindle by itself.

Source: Haas Automation, mill M06

LinuxCNC T- M6

One source: the LinuxCNC project, the control's maker

T
Tool to change to (on this or an earlier line)
  • With a manual tool changer configured, M6 stops and prompts the operator.

Source: LinuxCNC documentation, "M6 Tool Change" (archived Oct 24, 2026)

No Fanuc row yet: that chapter of the 0i manual has not been read.

Haas follows Fanuc's numbering, but options and parameters differ between controls: check your control's manual.