Every tool sticks out of the spindle a different amount. Tool length
offset is how one program runs them all: G43 Hn tells the control
"add tool n's stored length to every Z coordinate," so Z0 means the
tool tip touching the part zero — whichever tool is loaded.
G43 Hn— length comp on, from tool-table register nG49— length comp offG44— negative-direction variant (FANUC-style setups; rare)G43.1— offset value in the block itself (LinuxCNC/GRBL probing)
T2 M6 ; load tool 2
G43 H2 ; apply its length — Z now means tool tip
G0 Z5 ; tip to 5 above part zero: safe for ANY tool length
G1 Z-2 F200 ; cut
The G43 line belongs immediately after every tool change, before the
first Z move. That pairing — Tn M6 then G43 Hn — is the most
safety-critical two lines a post processor emits.
#How the number gets into the table
Tool lengths are measured, not programmed: touch each tool to a reference
(the part top, a gauge block, a tool setter) and store the result. In
G-code, G10 L1 P<tool> R<value> writes a register directly, and GRBL
setups typically probe each tool and apply the measured value with
G43.1. However it gets there, the program only ever says G43 Hn — the
table owns the truth.
| Operation | LinuxCNC | GRBL | Centroid | FANUC | Mach3 | Mach4 | Notes |
|---|---|---|---|---|---|---|---|
| Tool length offset (positive) | G43 |
— | G43 |
G43 |
G43 |
G43 |
H word selects the TLO register. |
| Tool length offset (negative) | — | — | G44 |
G44 |
— | — | Rarely used; FANUC-style. Centroid documents G44 in CNC12. |
| Dynamic tool length offset (in source) | G43.1 |
G43.1 |
— | — | — | — | |
| Cancel tool length offset | G49 |
G49 |
G49 |
G49 |
G49 |
G49 |
|
| Set tool-table entry directly | G10 L1 |
— | G10 L1 |
G10 L1 |
G10 L1 |
G10 L1 |
P = tool number, R = value. Centroid documents this in CNC12. LinuxCNC: partial |
| Set tool length so current pos = value | G10 L10 |
— | G10 L10 |
G10 L10 |
G10 L10 |
G10 L10 |
LinuxCNC: partial |
— means the control has no equivalent code. Full cross-control tables: the complete G-code & M-code reference.
#Length offset + work offset: the Z stack
The Z position the machine actually moves to is a sum:
machine Z = work-offset Z + programmed Z + tool length (G43)
When a Z crash happens, one of those three terms is wrong. The usual suspects, in order: G43 missing entirely, the wrong H number (tool 5's length applied to tool 3), or a work offset touched off with a different tool than the one now loaded. A viewer that shows tool tip position and active offsets turns this from detective work into a glance.
#Common mistakes
- No G43 after M6. Everything runs a full tool length too low. Some controls can alarm when motion happens without length comp — turn that on if yours offers it.
- H doesn't match T.
T3 M6 G43 H5is legal on most controls and nearly always wrong. Posts emit matching numbers; hand edits break them. - Touching off G54 Z with one tool, cutting with another. Work-offset Z and tool lengths must come from the same reference scheme. Mixing "Z0 = spindle nose" and "Z0 = tool tip" conventions in one setup guarantees a crash.
- Stacking G43 on a G43.1 workflow. Probe-based setups apply the measured length dynamically; also pulling a stale table entry doubles the offset.