# LinuxCNC G40 Compensation Off

Instructions · `G40` · verification: source checked

G40 is the LinuxCNC G-code that turns cutter compensation off. If cutter compensation was active, the next programmed move must be a linear move longer than the tool diameter. Programming G40 when compensation is already off is accepted.

## Specification

| Property | Value |
|---|---|
| Language | gcode |
| Code | G40 |
| Group | cutter compensation |
| Syntax | G40 |
| Dialect | LinuxCNC |

## Connected

- Related: [LinuxCNC G02](https://machineschema.com/instruction/gcode-g02.md)

## Study notes

- G40 cancels the cutter compensation started by G41 or G42.
- After a G40 that ends an active compensation, the following move must be linear and longer than the tool diameter.
- It is an error if a G2/G3 arc move is the next move after G40.
- It is an error if the linear move after turning compensation off is less than the tool diameter.
- The source example turns off compensation with G40 and then runs G0 X1.6, a linear move longer than the current cutter diameter.

## Sources

1. [G-Codes](https://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g40) (accessed 2026-10-26)

---

Source page: https://machineschema.com/instruction/gcode-g40  
JSON: https://machineschema.com/instruction/gcode-g40.json  
License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Cite Machine Schema and the original sources.
