---
title: "G43 Tool Length Offset in G-Code, Explained"
description: "G43 applies a tool's stored length so its tip reaches the programmed Z, no matter how long the tool is. Here is how G43, the H register, and G49 work."
url: https://gcodepractice.com/journal/g43-tool-length-offset-explained/
canonical: https://gcodepractice.com/journal/g43-tool-length-offset-explained/
author: "Lawrence Arya"
authorUrl: https://www.linkedin.com/in/vibecoding/
published: 2026-06-04
updated: 2026-06-04
category: "Code reference"
tags: ["g-code", "g43", "tool-offset", "tool-length", "beginner"]
lang: en
---

# G43 Tool Length Offset in G-Code, Explained

> **TL;DR** G43 turns on tool length compensation using the length stored in an H offset register, shifting the Z axis so the tool tip hits the programmed depth. Each tool has its own length, so each needs its own H value. G49 cancels it, and G44 applies it in the negative direction. The H number is separate from the tool number, though shops often match them.

Every tool in the carousel is a different length. A long drill sticks far out of the holder; a short face mill barely pokes past it. `G43` is how the control corrects for that difference so the same program cuts to the right depth no matter which tool is loaded.

## The problem G43 solves

The program asks the tool to feed to, say, `Z-5.` (5 mm below the top of the part). But the control measures position to the spindle nose, not the tool tip. A tool that hangs 100 mm out of the spindle reaches the part long before one that hangs 60 mm out. Without a correction, swapping tools would change every depth.

Tool length compensation fixes this by storing each tool's length and shifting the Z axis by that amount. The program keeps using the same `Z-5.`, and the control makes the tip land there. The mechanism is documented in the [LinuxCNC tool-length reference](https://linuxcnc.org/docs/html/gcode/g-code.html) and the standard [G43 compensation guides](https://www.helmancnc.com/cnc-g43-tool-length-compensation-g-code/).

## G43, the H register, G44, and G49

Four pieces make up the system:

| Code / word | What it does |
| --- | --- |
| `G43` | Turns on tool length compensation, positive direction |
| `H` | Points to the offset register holding the length (for example `H02`) |
| `G44` | Same as `G43` but negative direction (rarely used) |
| `G49` | Cancels tool length compensation |

A typical activation line looks like `G43 Z25. H02`: apply the length in register 02 and move to a safe Z of 25 with that correction active. The `H` number is independent of the tool number, but matching them (tool 2 uses `H02`) is the standard shop habit because it removes a whole class of mistakes.

## Where G43 sits in the program

`G43` almost always follows a tool change and the first move toward the part. The pattern is predictable:

| Block | What it does |
| --- | --- |
| `T2 M06` | Change to tool 2 |
| `G54` | Use the part's work offset |
| `S2000 M03` | Start the spindle |
| `G00 X10. Y10.` | Rapid to the start point |
| `G43 Z25. H02` | Apply tool 2 length, rapid to safe Z |
| `G49` | Cancel it later, before the next change |

That is why `G43` follows an [M06 tool change](/journal/m06-tool-change-explained/) and often a [G28 return to home](/journal/g28-return-to-home-position-explained/): the tool comes home, gets changed, then its length is applied on the way back down.

G43's place in the larger daily vocabulary of a vertical mill, alongside the cycles and M-codes it works with, is mapped in the [printable VMC code list](/journal/fanuc-vmc-g-codes-and-m-codes-list-pdf/).

## Tool length vs the other offsets

Beginners often blur three different corrections. They are separate tables doing separate jobs:

| Offset | Code | Locates |
| --- | --- | --- |
| Work offset | `G54` | The part on the table |
| Tool length offset | `G43` + `H` | Each tool's length |
| Cutter (diameter) comp | `G41` / `G42` + `D` | The tool's radius for sizing |

The [work offset (G54)](/journal/g54-work-offsets-explained/) locates the part, `G43` locates the tool tip in Z, and [cutter compensation (G41 vs G42)](/journal/g41-vs-g42-cutter-compensation/) handles the tool's radius in XY. Mixing them up is a common setup error, which is why `G43` belongs on every list of [common G-codes for CNC beginners](/journal/common-g-codes-for-cnc-beginners/) and is worth knowing when you [read a CNC program](/journal/how-to-read-a-cnc-program-for-beginners/). The full address grammar behind these codes is summarized on the [Wikipedia G-code page](https://en.wikipedia.org/wiki/G-code).

## How the length gets measured

The stored value comes from measuring each tool: touching the tip off a known surface, using a tool-length setter on the table, or measuring on a presetter outside the machine. However it is measured, the number lands in the H register, and `G43` does the rest. A wrong or missing length value is a classic crash cause, so it is verified before the first cut.

## Bottom line

`G43` applies a tool's stored length from an `H` register so the tip reaches the programmed Z, whatever the tool's length. `G49` cancels it, `G44` is the rare negative version, and the `H` number is separate from the tool number though shops match them. It is one of three offsets (work, tool length, cutter) that beginners must keep distinct.

## Sources

- [LinuxCNC G-code reference (G43, G49 tool length)](https://linuxcnc.org/docs/html/gcode/g-code.html)
- [HelmanCNC: G43 tool length compensation](https://www.helmancnc.com/cnc-g43-tool-length-compensation-g-code/)
- [Wikipedia: G-code](https://en.wikipedia.org/wiki/G-code)

## Frequently asked questions

### What is G43 in CNC?
`G43` activates tool length compensation in the positive direction, applying the length stored in an `H` register so the tip of that tool reaches the programmed Z. It is normally called right after a tool change.

### What does the H number in G43 mean?
`H` points to the offset register holding that tool's length, so `G43 H02` applies register 02. The `H` number is independent of the tool number, but many shops match them.

### What is the difference between G43 and G49?
`G43` turns tool length compensation on with an `H` value; `G49` cancels it. `G44` applies the offset in the negative direction and is rarely used.

### What is the best way to learn tool offsets and G43?
Drill the codes with active recall. A free app like G-Code Sprint quizzes `G43` and the rest of the everyday codes as quick timed questions and repeats whichever ones you miss.

*G-Code Sprint is a study and practice tool only. Always follow your instructor, employer, machine manual, and shop safety procedures.*

---

Source: https://gcodepractice.com/journal/g43-tool-length-offset-explained/
Author: Lawrence Arya — https://www.linkedin.com/in/vibecoding/
