Tool Length Compensation — G43, G44, and G49 on CNC Mills

Every tool loaded into a CNC machining center has a different length. A 100mm end mill and a 50mm drill positioned at the same Z coordinate would be at completely different heights relative to the workpiece. Tool length compensation solves this: it adjusts the Z-axis position by the measured tool length so that Z0 always means the same thing — the part surface — regardless of which tool is in the spindle.

G43 activates positive tool length compensation. G49 cancels it.

How Tool Length Compensation Works

The controller stores a length value in the tool offset table, referenced by an H number. When G43 H_ is active, the controller adds that value to every Z position in the program.

If H1 stores a value of 85.320mm (the length of tool 1), programming:

G43 H1 Z50.

moves the Z axis to a position that places the tool tip at 50mm above the part surface — not 50mm from the machine reference. The 85.320mm length offset is automatically applied.

Without G43, the machine has no knowledge of tool length and Z positions are meaningless relative to the part.

Setting Tool Length Offsets

Tool length offsets are measured and stored in the offset table before running. Common methods:

Touch-off method: Lower each tool to the part surface (or a reference gauge block), note the machine Z coordinate, and enter it (or the difference from a reference tool) into the H register.

Tool presetter: Measure tool length off-machine with a presetter, enter the value directly into the H register. Faster for shops running many tools.

On-machine probing: A tool length probe (like Renishaw) automatically measures each tool and updates the H register via a macro. Most accurate and eliminates human error.

G43 Syntax

G43 H_ Z_

G43 must be activated on a move block — typically the first Z move after a tool change. The H number matches the tool number by convention (H1 for T1, H2 for T2), though they can be independent.

T3 M6                  (load tool 3)
G0 G90 G54 X0. Y0. S4000 M3
G43 H3 Z50.            (activate TLC for tool 3, move to Z50 above part)
M8
G1 Z-5. F200           (plunge 5mm into part — Z is now relative to part surface)

G44 — Negative Tool Length Compensation

G44 subtracts the offset value instead of adding it. It is rarely used in standard milling — G43 with positive offset values is the universal practice. G44 exists for specific setups where the offset is stored as a negative value or where the compensation direction is inverted.

In practice: if you see G44 in a program, verify the sign convention of the offset table. Most post-processors never output G44.

G49 — Cancel Tool Length Compensation

G49 deactivates tool length compensation. After G49, Z positions are measured from the machine reference again, not from the part surface.

Always cancel TLC before or at the end of each tool section:

G0 Z50.          (retract while TLC still active)
G49              (cancel TLC)
G91 G28 Z0.      (return Z to home)

Some controllers cancel TLC automatically when G28 executes or when M06 is called. Others do not. Including G49 explicitly is the safe practice regardless of controller.

H00 — Zero Offset

On Fanuc and Haas, G43 H0 (or G43 H00) activates tool length compensation with a zero offset — effectively no compensation. This is sometimes used as a safe intermediate state when switching between tools before the actual H number is called.

G43 H0 Z100.    (TLC active but no offset applied — safe retract height)
T2 M6
G43 H2 Z50.     (now apply actual offset for tool 2)

The Most Dangerous G43 Error

The most common and dangerous G43 mistake is calling the wrong H number — typically H0 when H1 was intended, or H1 when H2 should be active after a tool change.

If H0 is active (zero offset) and the program commands Z-5, the machine moves to 5mm below the machine reference point — potentially into the table, fixture, or part.

If the wrong tool's H offset is active, Z depths are off by the difference between the two tool lengths — which can be 50mm or more.

T2 M6
G43 H1 Z50.    (WRONG — H1 is tool 1's length, tool 2 is now in the spindle)
G1 Z-10. F200  (cuts at the wrong depth)

The fix: always match the H number to the T number, and verify before running any new program.

Simulate Z Positions Before Cutting

Tool length compensation errors produce Z depth mistakes that are invisible in the G-code listing — H1 and H2 look identical in the program. Eureka3X applies the actual tool lengths stored in the simulation's tool table, so Z position errors caused by wrong H numbers show up immediately in the 3D view.

Try Eureka3X free for 30 days →

Related Articles

Start verifying your real G-code today.

Ensure your programs are safe and accurate with Eureka 3X Pro.

Start 30-Day Free Trial