The G43 code turns on tool length compensation (TLC) on a CNC machining center. When G43 is active, the machine adjusts all Z-axis movements to account for the length of the cutting tool loaded in the spindle.

Without G43, the machine has no idea how long your tool is. It just moves the spindle nose to wherever the program tells it to go — which means your tool tip ends up somewhere you didn’t intend.
Key Takeaways
- G43 activates positive tool length compensation
- It works with an H offset value that stores the tool’s length in the machine’s memory
- Best practice: match your tool number to your H offset number (Tool 1 → H1)
- G43 is a modal command — it stays active until you cancel it with G49 or change tools
- Always activate G43 while the tool is still a safe distance above the part
| G43 – At A Glance | |
|---|---|
| Function | Tool Length Compensation (Positive) |
| Format | G43 H__ Z__ |
| Type | Modal (Group 8) |
| Cancelled by | G49, G49 H0 |
What Are H Offsets?
The G43 code turns compensation on, but the H code tells the machine how much to compensate.
Each tool gets measured and its length gets stored in the machine’s offset table — a list of values saved in the controller’s memory. The H number in your program points to that stored value.

For example, G43 H02 tells the machine: “turn on tool length compensation using the length stored in offset #2.”
The standard practice is to match your tool number to your H number. Tool 1 uses H1, Tool 2 uses H2, and so on. It keeps things simple and reduces the chance of calling the wrong offset.
How G43 Works in Your Program
There are three parts to a G43 command: the G43 code itself, the H offset number, and a Z-axis move.
A typical G43 line looks like this:
G43 H02 Z1.0
This line does three things at once. It activates tool length compensation, loads the length value stored in H2, and moves the tool to Z1.0. The machine applies the offset on that first Z move.
After that line runs, every Z move in the program accounts for the tool length automatically — until you cancel it or change the offset.
When to Use G43 in Your Program
G43 should appear at the start of every tool’s section in your program.
Put it on the same line as your first Z move for that tool, while you’re still well above the part. A safe retract position or R-plane height is the right time to call it out.
Don’t wait until you’re close to the work. If G43 isn’t active yet and you’re already near the part, the offset gets applied mid-approach — that’s how crashes happen.
G43 is a modal command, meaning it stays on until you cancel it or change it. Even so, don’t assume it’s already active when you need it. Call it out explicitly in every tool section. This is part of good safety line practice.
COMMON MISTAKE – Turning on G43 Too Close to the Part
Activating G43 after the tool has already moved close to the part is a an accident waiting to happen. The offset kicks in on the next Z move — if you’re already near the work surface, that sudden position shift can crash the tool into the part.
Always call G43 while you’re still at a safe height.
How to Cancel G43
G49 cancels tool length compensation. It clears any active G43 or G44 mode.
You’ll usually see G49 in the safety block at the top of the program, before any tools load. This makes sure compensation from a previous run isn’t accidentally carried over.
Some shops also program G43 H0 instead of G49 — calling G43 with offset zero effectively zeroes out the compensation. Either approach works, but check what your shop or post processor prefers.
G43 vs G44
G43 and G44 are opposites. G43 applies positive length compensation — the offset value gets added to the machine’s position. G44 applies negative compensation — the value gets subtracted.
In practice, almost every shop uses G43. Tool length offsets are measured as positive values and stored that way. G44 exists for situations where a negative offset is intentional, but you’ll rarely encounter it.
If you’re just getting started, stick with G43 and don’t worry about G44 yet.
Related Cutter Compensation Codes
G43 handles the tool’s length — but there are also codes that handle the tool’s diameter.
G41 and G42 are cutter compensation codes. G41 offsets the tool path to the left of the programmed path (used in conventional milling). G42 offsets it to the right (used in climb milling). These adjust for the cutter’s radius, so your programmed path doesn’t need to account for it manually.
Where G43 compensates in Z, G41 and G42 compensate in X and Y. On most programs, you’ll use all three.
Like G43, both G41 and G42 are modal commands. They stay active until you cancel them with G40.
G43 Code Example
N100 T02 M6 (Select and load Tool 2)
N105 G00 G43 H02 Z1.0 (Rapid to Z1.0, activate tool length comp with H2)
N110 X1.5 Y2.0 (Rapid to XY start position)
N115 G01 Z-0.5 F10.0 (Feed down to depth)
N120 G00 Z1.0 (Retract to safe height)
N125 G49 (Cancel tool length compensation)
N130 M30 (End program)
Line N105 is where G43 does its work. The machine loads the length stored in H2 and applies it as the tool moves to Z1.0. Every Z move after that automatically accounts for the tool’s length — until G49 cancels it on line N125.
FAQS
What happens if I forget to program G43?
The machine will move the spindle nose to the Z locations in the program — not the tool tip. This will almost always mean a crash.
Do I need a new G43 line for every tool change?
Yes. Each tool has its own H offset, so you need a new G43 command with the correct H number after every tool change. Don’t assume the previous tool’s offset carries over correctly.
What’s the difference between G43 and G44?
G43 applies positive tool length compensation — the offset value is added to the Z position. G44 applies negative compensation — the value is subtracted. Nearly all shops use G43 with positive offset values stored in the tool table.
Can I use G43 H0 instead of G49 to cancel compensation?
Yes. Programming G43 H0 loads a zero offset, which effectively cancels any active compensation. Many post processors use this method. Either G49 or G43 H0 will work — check what your machine and shop standard prefer.