G-code reference

G42: Cutter compensation right

G42 is cutter compensation right. Offsets the tool to the right of the path. It is modal, so it stays active on the following lines until another code from the same group replaces it.

What G42 does

G42 shifts the tool path to the right by the stored radius. With a right-hand cutter it gives conventional milling on an outside profile. On a lathe with the turret in front, G42 is the usual choice for turning toward the chuck on an outside diameter.

TypeG-code
MachineMill and lathe
GroupCutter compensation
ModalYes: stays active until replaced by another code from the same group

G42 example

G42 D1 G01 X0. Y5. F300.

Turn on right compensation with offset D1.

WordWhat it means here
G42Cutter compensation right
D1tool radius offset number
G01Linear interpolation (feed move)
X0.X axis target (on a lathe, the diameter)
Y5.Y axis target
F300.feed rate (on threading codes, the lead)

Codes people confuse with G42

CodeWhat it does instead
G41 Cutter compensation left. Offsets the tool to the left of the path, looking in the direction of travel.

Other codes in the cutter compensation group

Only one code from a modal group is active at a time. Programming any of these replaces G42.

  • G40 Cutter compensation cancel
  • G41 Cutter compensation left

Meanings follow the common Fanuc-style standard that Haas, Okuma (EIA mode), Mitsubishi, LinuxCNC and most other controls share for this code. Options and parameters change details from machine to machine, so check the manual for your control.

Quick check: G42

  1. What does G42 do? (Mill and lathe)

  2. Which code: Offsets the tool to the right of the path.(Mill and lathe)

  3. What does G41 do? (Mill and lathe)

Show the answers
  1. Offsets the tool to the right of the path.
  2. G42
  3. Offsets the tool to the left of the path, looking in the direction of travel.

Drill this code with the rest of the core set

More practice hubs

Frequently asked questions

What does G42 mean in CNC programming?
Cutter compensation right. Offsets the tool to the right of the path.
Is G42 modal?
Yes. G42 belongs to the cutter compensation group and stays active until another code from that group is programmed.
What is the difference between G42 and G41?
G42 (cutter compensation right): offsets the tool to the right of the path. G41 (cutter compensation left): offsets the tool to the left of the path, looking in the direction of travel.

G-Code Sprint is an educational practice tool only. It is not a CNC simulator, machine controller, safety manual, or replacement for instruction. Always follow your instructor, employer, machine manual, and shop procedures.

Free preview · no card Try G-Code Sprint