Skip to content

G43 / G49: turning tool length compensation on and off

G43 adds the tool length stored in the H offset you specify to the programmed Z coordinate, and G49 cancels that addition. Without G43 the Z in the program does not refer to the tip of the loaded tool but to the spindle nose, so until the G43 block runs, the control does not know where the cutting edge really is. This is the code that lets the same program run with a 60 mm drill or a 140 mm drill without changing a single coordinate.

For reference only: syntax changes with the control, the post-processor and the machine parameters. Check the official manual and run a simulation before cutting. Legal notice.

The brands and control names mentioned belong to their owners and are used only to identify the equipment. GetGCode is not affiliated with or endorsed by any manufacturer, ISO or ASME: this is our own content, not official documentation. Legal notice.

Family
Compensation
Machine
Milling, Mill-turn
Risk
High
Example
G43 H01 Z50

Syntax by control

Fanuc (milling)
G43 H01 Z50. M03 S3000
H calls the length offset number, which by convention is matched to the tool number. The G43 block must include a Z move: that move is where the offset gets applied.
Haas (milling)
G43 H01 Z50. M03 S3000
Same syntax. On Haas the length may be entered as a large negative value or as a deviation from a reference, depending on the machine setting and how the shop measures: check the tool geometry setting before you key in numbers.
Fanuc G44 (rarely used)
G44 H01 Z50.
G44 subtracts the length instead of adding it. Hardly anyone uses it, and seeing it in a program usually means a typo or a leftover from an old machine; with a positive length, G44 drives the tool toward the part.
Siemens 840D / 828D
T="FRESA10" M6 D1 G0 Z50
Siemens does not use G43: the offset is activated by the cutting edge number D of the called tool (D1, D2...) and cancelled with D0. Each D carries its own length and radius in the tool table.
Heidenhain TNC (Klartext)
TOOL CALL 5 Z S3000
In Klartext the length is applied by the TOOL CALL, which takes L and R from the tool table. There is no separate code: calling the tool already activates its geometry, which is why forgetting it is a different failure from the Fanuc one.

Address letters used with it

LetterWhat it setsUnit
HLength offset number in the table. H00 is equivalent to zero length, in other words it cancels compensation, the same as G49.integer offset number
ZCoordinate the already compensated tool moves to. The block must include a Z move; without one, many controls store the offset but do not apply it until the next move.mm / in
DOn Siemens, the cutting edge number that activates the length and radius of the called tool. D0 cancels. Do not confuse it with the Fanuc radius D, which is something else.integer cutting edge number
G49Cancels the active length compensation. It goes in the safety header and before machine coordinate moves with G53, where you do not want any offset in the way.modal, no units

Worked example

A tool change and a through hole drilled in a 20 mm plate clamped in a vise, with part zero on the top face. The example shows exactly where G43 goes and why the first move down in Z cannot come before that block.

O0500 (TALADRO CON G43)
( Program header. )
G21 G17 G40 G49 G80
( Millimeters, XY plane and a clean state. G49 here is preventive: the program starts with no length applied. )
G91 G28 Z0.
( Z to the reference point in incremental before the tool change. )
T4 M06
( Loads the Ø8 drill. From here on the machine has a tool whose length the program does not know yet. )
G90 G54 G00 X40. Y30.
( Absolute, work offset and positioning in the plane. Z has not been touched yet. )
G43 H04 Z50. M03 S2400
( The key block: applies the length in offset 04 and rapids down to Z50 already compensated. Offset 04 matches T4 by shop convention, not because the control requires it. )
G00 Z3. M08
( Approach to 3 mm above the face and coolant on. This coordinate is now the real distance from the cutting edge to the part. )
G01 Z-23. F150
( Through hole: 20 mm of plate plus 3 mm for the point to break through. )
G00 Z50.
( Rapid retract with compensation still active. )
G49 G91 G28 Z0. M09
( Cancels the length and goes up to the reference point. Cancelling before a G28 avoids surprises on machines where the reference point and the offset step on each other. )
G90 M05
( Back to absolute and spindle stop. )
M30
( End of program. )
Open the simulator to check the example

Practical keys to using G43/G49 in the workshop

What the H offset really stores

The H offset stores the distance between the tool tip and whatever reference your shop uses, and there are two common approaches. In the first, you measure the real tool length from the spindle nose to the tip, a large positive number. In the second, you touch the tool off on the part face and record the distance from machine zero, a large negative number. Both work, but you cannot mix them on the same machine: enter a length measured one way into a table set up the other way and the tool heads for the part, or for thin air, with an error of hundreds of millimeters.

Why H does not always match T

The control does not force the offset number to be the tool number: you could call T4 and apply H12 with no alarm at all. They are matched out of discipline, because that is the only thing that keeps a program readable, and most modern machines have a setting that alarms when H and T are not equal. Where they do part ways is on machines with several lengths per tool or when separate wear offsets are used. If your program comes from a post processor, check which approach it uses before you change anything by hand.

When you need to cancel with G49

G49 goes at the start of the program as a safeguard, before sending the axes to machine coordinates with G53 or G28, and at the end if the machine is about to be handed over to someone else. Beyond that, cancelling in the middle of a program is unusual and dangerous: if you cancel and keep moving in Z, the program coordinate goes back to referring to the spindle nose. Many controls apply the cancellation on the next Z move, so a stray G49 in a block with no motion can stay latent and take effect when you least expect it.

Mistakes that cost you a part (or a tool)

  • Moving down in Z before the G43 block: until that point the program coordinate is not the tip of the tool that is loaded.
  • Calling T4 and applying H03 because of a typo: the control gives no warning unless the check setting is on, and the difference in length goes straight into the part.
  • Mixing measuring approaches in the same table, with some offsets as a real positive length and others as a negative distance to machine zero.
  • Entering the length in the wear field instead of the geometry field, or the other way around: the resulting dimension is neither the right one nor the previous one.
  • Putting G43 in a block with no Z move and assuming it is already applied: on many controls it does not take effect until the next move.
  • Using G44 thinking it is equivalent to G43: it subtracts the length instead of adding it and rams the tool into the part.
  • Forgetting that a -0.5 mm wear offset left over from the previous part is still there for the next batch.

Frequently asked questions

What happens if I forget G43?

The machine reads Z coordinates as if the tool had no length, that is, referenced to the spindle nose. If the tool is long, the first Z move drives it into the part or the vise at the speed of that block. It is one of the most common crashes on a mill, which is why G43 always goes in the same place: the first Z block after the tool change.

Do H and T have to be the same number?

The control does not require it, but the shop should. Matching them is the only practical way to read a program without checking offsets one by one. Many modern machines have a setting that alarms when H and T do not match; if yours has it, leave it on.

Are G49 and H00 the same thing?

In practice, yes: both leave length compensation at zero. G49 is more explicit and is the one used in safety headers. H00 shows up mostly in old programs and in post processors that prefer to cancel without changing the G code.

How is length applied on Siemens and Heidenhain?

On Siemens there is no G43: the offset comes in with the cutting edge number D of the called tool and is cancelled with D0. On Heidenhain, the TOOL CALL itself applies the length and radius from the tool table. That is why a program converted from Fanuc to either one has no G43, and it is not an oversight.

Can I change the offset with the tool in the part?

Do not do it. The change takes effect on the next Z move, so the tool corrects its position with the cutting edge inside the material. Retract to the safe height first, adjust the offset and go back in.

Related codes

M06G54-G59G53G28/G30G41.2/G42.2

Detailed data sheet for each code

Syntax by control, address letters, a commented program and the typical mistakes for each one.

Other codes in Compensation

See the full list of G and M codes

Related apps