G-code reference

G40: Cutter compensation cancel

G40 is cutter compensation cancel. Turns off cutter radius (or tool nose) compensation. It is modal, so it stays active on the following lines until another code from the same group replaces it.

What G40 does

G40 cancels G41 or G42 so the tool centre follows the programmed path again. Cancel it on a move away from the part, never while cutting, or the tool can step sideways into the finished wall.

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

G40 example

G40 G01 X-10. Y-10.

Cancel compensation while leaving the part.

WordWhat it means here
G40Cutter compensation cancel
G01Linear interpolation (feed move)
X-10.X axis target (on a lathe, the diameter)
Y-10.Y axis target

Codes people confuse with G40

CodeWhat it does instead
G49 Tool length compensation cancel. Cancels G43 or G44.
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 G40.

  • G41 Cutter compensation left
  • G42 Cutter compensation right

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: G40

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

  2. Which code: Turns off cutter radius (or tool nose) compensation.(Mill and lathe)

  3. What does G49 do? (Mill)

Show the answers
  1. Turns off cutter radius (or tool nose) compensation.
  2. G40
  3. Cancels G43 or G44.

Drill this code with the rest of the core set

More practice hubs

Frequently asked questions

What does G40 mean in CNC programming?
Cutter compensation cancel. Turns off cutter radius (or tool nose) compensation.
Is G40 modal?
Yes. G40 belongs to the cutter compensation group and stays active until another code from that group is programmed.
What is the difference between G40 and G49?
G40 (cutter compensation cancel): turns off cutter radius (or tool nose) compensation. G49 (tool length compensation cancel): cancels G43 or G44.
What is the difference between G40 and G41?
G40 (cutter compensation cancel): turns off cutter radius (or tool nose) compensation. 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