{"id":"word-t","model_id":"T","name":"LinuxCNC T","summary":"T is the LinuxCNC G-code word that prepares the machine to change to tool x. It does not change the tool by itself; the change occurs when M6 is programmed, either on the same line or a later line. Only the most recent T word applies at the next tool change.","study_notes":["The T word may appear on the same line as M6 or on a previous line; T words may also appear on several lines with no tool change occurring.","Only the most recent T word takes effect at the next tool change.","On machines whose carousel moves when a T word is programmed, placing the T word several lines before the tool change saves time; a common practice is to put the next tool's T word on the line after a tool change.","Rapid moves after T<n> are not shown in the AXIS preview until after a feed move; this applies to machines that travel long distances to change tools, such as a lathe.","To turn off that preview behaviour for the current program, program a G1 without any move after the T<n>.","With a nonrandom toolchanger (RANDOM_TOOLCHANGER setting in EMCIO), T0 gets special handling and no tool is selected, which can leave the spindle empty after a tool change.","With a random toolchanger, T0 has no special treatment and is a valid tool like any other; using T0 to track an empty pocket makes the machine behave like a nonrandom toolchanger and unloads the spindle."],"safety_notes":["It is an error to use a negative T number.","It is an error to use a T number that does not appear in the tool table file, with the exception that T0 on nonrandom toolchangers is accepted."],"sources":[{"url":"https://linuxcnc.org/docs/html/gcode/other-code.html#sec:select-tool","title":"Other Codes","accessed":"2026-10-26"}],"verification":{"status":"source_checked","checked_at":"2026-10-26","values":5,"method":"llm_source_check"},"updated_at":"2026-10-26","type":"instruction","spec":{"language":"gcode","code":"T","group":"tool","syntax":"Tx","parameters":[{"name":"x","description":"Tool number to prepare for the next tool change; the change itself occurs at M6."}],"dialect":"LinuxCNC","related":["mcode-m06","gcode-g01"],"standards":[]},"url":"https://machineschema.com/instruction/word-t","license":"https://creativecommons.org/licenses/by/4.0/"}