CNC mill · G-code

G98 / G99: return level on a mill, feed mode on a lathe

Between holes, G98 retracts to the Z the tool started the cycle from (to clear clamps); G99 retracts only to the R plane (faster). Haas lists it in modal group 10. On a CNC lathe, G98 / G99 are the feed mode codes. G98 retracts to the starting Z, G99 only to the R plane. Formats below from Haas, LinuxCNC and Mach4, each from its maker.

Worked example

Hop a clamp between holes 1 and 2, then stay low. Written for this page in the Haas format.

G00 Z1. (above the clamp)G98 G81 X1. Y1. Z-0.5 R0.1 F15. (back to Z1. after this hole)G99 X2. (back to R from here on)X3.G80
The worked example’s toolpath, from the front (X, Z): feed moves solid, rapid moves dashed, from the start point.initial ZR planework surfacedepth Z-0.5rapidfeedstart pointXZ
The worked example’s toolpath. Drawn to the example’s own coordinates; the retracts drawn beside the plunges.

On a lathe: feed mode

On a Haas lathe, G98 makes F a feed per minute (inches, or mm with Setting 9 at MM) and G99 makes it a feed per revolution of the spindle. Both are modal group 10. The same F number is a very different feed in each mode.

The same feed in both modes at 1,000 RPM. Written for this page in the Haas lathe format.

G97 S1000 M03G99 G01 Z-1. F0.008 (0.008 in per rev)G98 G01 Z-2. F8. (8 in/min: the same feed at 1000 RPM)

On a lathe, G99 F0.008 at 1000 RPM feeds 1000 × 0.008 = 8 in/min, the same as G98 F8.

Source: Haas Automation, lathe G98, Haas Automation, lathe G99

How each control writes it

Haas G98 / G99 with a canned cycle

One source: Haas Automation, the control's maker

  • G98 returns to the Z position in the block before the cycle, so you can program up and over clamps.

Source: Haas Automation, mill G98

LinuxCNC G98 / G99 with a canned cycle

One source: the LinuxCNC project, the control's maker

  • G98 uses the starting Z only if it is above R; otherwise R.
  • Leaving cycle mode (G80 or any motion code) resets the starting plane; switching between cycles does not.

Source: LinuxCNC documentation, "G98, G99 Canned Cycle Return Level" (archived Oct 29, 2026)

Mach4 G98 / G99 with a canned cycle

One source: Artsoft (Newfangled Solutions), the control's maker

  • G98 also goes back to the initial point before the rapid to the next hole, to clear steps and clamps.
  • G99 is for flat plate: less movement, shorter cycle.

Source: Mach4 Mill Programming Guide v1.1 (Artsoft), "G98 Initial Point Return; G99 R Point Return" (archived Jul 1, 2024)

No Fanuc row yet: that chapter of the 0i manual has not been read.

Haas follows Fanuc's numbering, but options and parameters differ between controls: check your control's manual.