M-code reference

M06: Tool change

M06 is tool change. Changes to the tool called by T. It is non-modal, so it acts only on the line it is written on.

What M06 does

M06 swaps the tool in the spindle for the one selected by the T word, usually written together as T05 M06. On most machining centres the axes must be at the tool change position first, and the new tool's length offset (G43 H) is turned on afterwards.

TypeM-code
MachineMill
GroupTool
ModalNo: acts only on its own line

M06 example

T05 M06

Load tool 5 into the spindle.

WordWhat it means here
T05tool number
M06Tool change

Codes people confuse with M06

CodeWhat it does instead
G43 Tool length compensation +. Applies the tool length offset H so Z positions are measured from the tool tip.
M05 Spindle stop. Stops the spindle.

Where controls differ

  • Lathes: Most lathes index the turret with the T word alone (T0101), no M06.

Meanings follow the common Fanuc-style standard that Haas, Okuma (EIA mode), Mitsubishi, LinuxCNC and most other controls share for this code. Options and parameters change details from machine to machine, so check the manual for your control.

Quick check: M06

  1. What does M06 do? (Mill)

  2. Which code: Changes to the tool called by T.(Mill)

  3. What does G43 do? (Mill)

Show the answers
  1. Changes to the tool called by T.
  2. M06
  3. Applies the tool length offset H so Z positions are measured from the tool tip.

Drill this code with the rest of the core set

More practice hubs

Frequently asked questions

What does M06 mean in CNC programming?
Tool change. Changes to the tool called by T.
Is M06 modal?
No. M06 acts only on the line where it is written; the next line goes back to whatever modal codes were already active.
What is the difference between M06 and G43?
M06 (tool change): changes to the tool called by T. G43 (tool length compensation +): applies the tool length offset H so Z positions are measured from the tool tip.
What is the difference between M06 and M05?
M06 (tool change): changes to the tool called by T. M05 (spindle stop): stops the spindle.

G-Code Sprint is an educational practice tool only. It is not a CNC simulator, machine controller, safety manual, or replacement for instruction. Always follow your instructor, employer, machine manual, and shop procedures.

Free preview · no card Try G-Code Sprint