CNC mill · G-code
G41 / G42: cutter radius compensation
G41 offsets the tool to the left of the programmed path and G42 to the right, by the tool radius, looking in the direction of travel. G40 cancels it. Left with a right-hand tool is climb milling. Haas lists it in modal group 07. Formats below from Haas, LinuxCNC, Mach4 and Fanuc, each from its maker.
Worked example
Climb-mill a profile with comp on a lead-in. Written for this page in the Haas format.
G00 X-0.75 Y-0.75G01 Z-0.25 F20.G41 D01 X0 Y-0.25 (comp on during a linear lead-in)Y2.X3.G40 G01 X3.5 Y2.5 (comp off on the lead-out)How each control writes it
Haas G41 D- / G42 D- (G40 cancels)
One source: Haas Automation, the control's maker
- D
- Diameter/radius offset number from the offsets page
- Left or right is judged looking at the tool as it moves away.
LinuxCNC G41 <D-> / G42 <D-> (G40 cancels)
One source: the LinuxCNC project, the control's maker
- D
- Tool number whose radius is used; without it, the loaded tool (optional)
- D is a tool number, not an offset register.
- D0 behaves differently on random and non-random tool changers.
Source: LinuxCNC documentation, "G41, G42 Cutter Compensation" (archived Oct 29, 2026)
Mach4 G01 G41 D- X- Y- F- / G01 G42 D- X- Y- F- (G40 cancels)
One source: Artsoft (Newfangled Solutions), the control's maker
- D
- Offset number holding the cutter radius
- X, Y
- End of the lead-in move (optional)
- Turn comp on during a linear lead-in: an arc in that block is an error.
- The lead-in must be longer than the offset, or it alarms; any path segment shorter than the offset is likely to gouge.
- G40 goes on a linear lead-out, under the same rules.
- Climbing outside a part, G41 with a positive offset makes the part bigger.
Source: Mach4 Mill Programming Guide v1.1 (Artsoft), "G41/G42 Cutter Compensation; chapter 4, Cutter Compensation" (archived Jul 1, 2024)
Fanuc G00 (or G01) G41 (or G42) IP_ D_ ;
One source: FANUC, the control's maker
- G41 / G42
- Cutter on the left / on the right of the path
- IP
- The start-up move (optional)
- D
- Offset number holding the cutter radius (1 to 3 digits)
- FANUC 0i-MF (machining centre), from its operator’s manual. On another FANUC model, check that control’s manual.
- Start it on a G00 or G01 move. G40, or D0, cancels.
Source: FANUC B-64604EN-2/01, Operator's Manual, 0i-MF (machining centre), §6.5
How the controls differ
- Only Mach4 takes X, Y.
- Only Fanuc takes G41 / G42, IP.
- A word two controls share can still mean different things: read each control's list above.
Haas follows Fanuc's numbering, but options and parameters differ between controls: check your control's manual.