# LinuxCNC G99

Instructions · `G99` · verification: source checked

G99 is a LinuxCNC G-code that sets the retract level used by canned cycles. With G99 active, the tool retracts to the position given by the R word of the canned cycle rather than to the Z position that was in effect before the cycle started. G98 and G99 can be switched between during a series of cycles.

## Specification

| Property | Value |
|---|---|
| Language | gcode |
| Code | G99 |
| Group | canned cycle return level |
| Syntax | G99 |
| Dialect | LinuxCNC |

## Safety

- In a canned cycle with the XY plane active, it is an error if the R number is less than the Z number.
- It is an error if a canned cycle is run with inverse time feed rate active or with cutter compensation active.

## Study notes

- G98 is the alternative: it retracts to the position the axis was in just before the series of contiguous canned cycles started, provided that position is higher than the R value; otherwise the R value is used.
- The meaning of the R word differs between absolute distance mode and incremental distance mode.
- The initial (G98) plane is reset any time cycle motion mode is abandoned, either explicitly with G80 or implicitly by any motion code that is not a cycle.
- Switching among cycle modes (for example G81 to G83) does not reset the initial plane.
- G99 is part of the canned cycle group G80-G89 described in the LinuxCNC G-code reference.

## Sources

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

---

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