G-code reference

G40 G-Code: Cutter Radius Compensation Cancel

Cutter Radius Compensation Cancel — Cancels G41/G42 cutter (or tool nose radius) compensation. Cancel on a linear move away from the part, not on an arc.

By cnccode · Updated
PropertyValue
CodeG40
FunctionCutter Radius Compensation Cancel
Modal group07
TypeModal — stays active until replaced by another code of the same group
Used onMills and lathes
SyntaxG40 G01 X_ Y_

What does G40 do?

Cancels G41/G42 cutter (or tool nose radius) compensation. Cancel on a linear move away from the part, not on an arc.

G40 is modal: once programmed it remains in effect for the following blocks until another code from modal group 07 replaces it or the control is reset.

Syntax and parameters

Format
G40 G01 X_ Y_

G40 example program

Example
G01 X-10.0 Y-10.0 G40 (lead-out with cancel)

▶ Open this example in the G-code viewer

Tips and common mistakes

  • Cancelling on an arc or with no move causes alarms or gouges.
  • Keep G40 in your safe start line.

Controller compatibility

G40 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 G40 modal?
Yes. G40 belongs to modal group 07 and stays active until another code of that group is programmed.
What does G40 mean in CNC?
G40 means Cutter Radius Compensation Cancel. Cancels G41/G42 cutter (or tool nose radius) compensation. Cancel on a linear move away from the part, not on an arc.
What is the difference between G40 and G41?
G40 is Cutter Radius Compensation Cancel, while G41 is Cutter Radius Compensation Left. See the G41 page for its syntax and examples.
Can I use G40 on a lathe?
Yes, G40 is used on both mills and lathes, although some parameters differ between them.