G-code reference

G45 G-Code: Tool Position Offset (Increase)

Tool Position Offset (Increase) — Old Fanuc offset function: lengthens the programmed move by the offset value (G45 increase, G46 decrease, G47 double increase, G48 double decrease)…

By cnccode · Updated
PropertyValue
CodeG45
FunctionTool Position Offset (Increase)
Modal group00
TypeOne-shot (non-modal) — active only in its own block
Used onMilling machines
SyntaxG45 X_ D_

What does G45 do?

Old Fanuc offset function: lengthens the programmed move by the offset value (G45 increase, G46 decrease, G47 double increase, G48 double decrease). Superseded by G41/G42 cutter compensation.

G45 is a one-shot code: it only acts in the block where it is written, and the previously active modal codes take over again afterwards.

Syntax and parameters

Format
G45 X_ D_
AddressMeaning
DOffset number

G45 example program

Example
G91 G45 G00 X20.0 D01

▶ Open this example in the G-code viewer

Tips and common mistakes

  • Do not mix with G41/G42.

Controller compatibility

G45 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 G45 modal?
No. G45 is a one-shot (group 00) code and only acts in the block where it appears.
What does G45 mean in CNC?
G45 means Tool Position Offset (Increase). Old Fanuc offset function: lengthens the programmed move by the offset value (G45 increase, G46 decrease, G47 double increase, G48 double decrease). Superseded by G41/G42 cutter compensation.
What is the difference between G45 and G41?
G45 is Tool Position Offset (Increase), while G41 is Cutter Radius Compensation Left. See the G41 page for its syntax and examples.
Can I use G45 on a lathe?
Usually not with the same meaning: G45 is documented here for milling machines. Check your control manual for the equivalent.