G-code reference

G43 G-Code: Tool Length Compensation (+)

Tool Length Compensation (+) — Activates tool length offset by adding the value in H register to Z. The control can then position the tool tip correctly regardless of tool length.

By cnccode · Updated
PropertyValue
CodeG43
FunctionTool Length Compensation (+)
Modal group08
TypeModal — stays active until replaced by another code of the same group
Used onMilling machines
SyntaxG43 H_ Z_

What does G43 do?

Activates tool length offset by adding the value in H register to Z. The control can then position the tool tip correctly regardless of tool length.

G43 is modal: once programmed it remains in effect for the following blocks until another code from modal group 08 replaces it or the control is reset.

Syntax and parameters

Format
G43 H_ Z_
AddressMeaning
HLength offset register — normally equals the tool number
ZFirst Z position (applies the offset with the move)

G43 example program

Example
T5 M06
G90 G54 G00 X0 Y0 S8000 M03
G43 H05 Z50.0 M08

▶ Open this example in the G-code viewer

Tips and common mistakes

  • H must match the tool in the spindle — the #1 cause of Z crashes.
  • Program G43 with a Z move so the offset is picked up safely above the part.
  • Haas lets you set H to the tool number automatically (setting 15 warns on mismatch).

Controller compatibility

G43 follows the ISO/Fanuc dialect used by Fanuc, Haas, Brother, Doosan, Hurco (ISO mode), Mazak (EIA/ISO mode), Okuma (G-code mode) and Siemens in ISO dialect mode. Parameters, option packages and builder-specific behaviour can differ, so confirm the details in your machine's programming manual before running a new program.

Frequently asked questions

Is G43 modal?
Yes. G43 belongs to modal group 08 and stays active until another code of that group is programmed.
What does G43 mean in CNC?
G43 means Tool Length Compensation (+). Activates tool length offset by adding the value in H register to Z. The control can then position the tool tip correctly regardless of tool length.
What is the difference between G43 and G44?
G43 is Tool Length Compensation (+), while G44 is Tool Length Compensation (−). See the G44 page for its syntax and examples.
Can I use G43 on a lathe?
Usually not with the same meaning: G43 is documented here for milling machines. Check your control manual for the equivalent.