---
title: "G98 vs G99: Canned Cycle Return Planes Explained"
description: "G98 retracts to the initial level, G99 only to the R plane. How to mix them around clamps, the lathe feed-mode trap, and the cycle time G99 really saves."
url: https://gcodepractice.com/journal/g98-vs-g99-canned-cycle-return-plane/
canonical: https://gcodepractice.com/journal/g98-vs-g99-canned-cycle-return-plane/
author: "Lawrence Arya"
authorUrl: https://www.linkedin.com/in/vibecoding/
published: 2026-08-03
updated: 2026-08-03
category: "Code reference"
tags: ["g-code", "g98", "g99", "canned-cycle", "drilling", "beginner"]
lang: en
---

# G98 vs G99: Canned Cycle Return Planes Explained

> **TL;DR** In mill canned cycles, G98 retracts to the initial level (the Z where the cycle started) and G99 retracts only to the R plane just above the part. Default to G99 for speed over open ground and switch to G98 exactly where the tool must clear a clamp or step. Watch the Fanuc trap: on lathes the same letters mean feed per minute and feed per revolution instead. Make the initial level a deliberate height, and close cycles with G80.

On a mill, G98 and G99 decide where the tool retracts to between holes in a canned cycle. G98 returns to the initial level, the Z height the tool was at before the cycle started. G99 returns only to the R plane, the clearance level just above the part that the cycle's R word defines. G99 saves seconds of air travel on every hole, which adds up fast on a plate with two hundred holes; G98 buys clearance, which is what you need the moment a clamp, a step in the part, or a fixture rib sits between two holes. Programs mix them freely, hole by hole, and the standard recipe is G99 for runs of holes over open ground with a switch to G98 for the one move that has to hop an obstacle. Get the pair backwards and the tool either wastes cycle time high in the air or drags across a clamp at rapid speed.

## The two levels a canned cycle knows about

Every drilling cycle move involves three Z heights, and keeping them straight makes G98 and G99 obvious. The initial level is wherever Z was when the cycle was called, typically a comfortable clearance height like an inch above the part. The R plane is the level named by the R word in the cycle line, the height where rapid motion changes to feed, usually a small distance above the surface such as 0.1 inch. The bottom is the Z word, the hole depth. The [LinuxCNC G-code reference](https://linuxcnc.org/docs/html/gcode/g-code.html) documents the sequence: rapid to the hole position, rapid down to R, feed to Z, then retract, and the retract destination is exactly what G98 versus G99 selects.

So a cycle under G98 finishes each hole by pulling all the way back up to the initial level, while under G99 it stops the retract at R and scoots to the next hole from there. Everything else about the cycle, the pecks, the dwells, the feed, is identical; the pair controls nothing but that final retract height between holes. Canned cycle basics, the R and Z and Q words and the modal behavior, are covered in [what is a canned cycle in CNC](/journal/what-is-a-canned-cycle-in-cnc/) and in the [G81 versus G83 comparison](/journal/g81-vs-g83-drilling-canned-cycles/); this pair is the piece that decides the shape of the air moves between the holes.

## What each one looks like in practice

Take a simple four-hole pattern with the part surface at Z0, the R plane at 0.1, depth at -0.5, and the tool starting at Z1.0:

```
G90 G54 G17
G00 X1.0 Y1.0
G43 H3 Z1.0 (initial level: Z1.0)
G99 G81 R0.1 Z-0.5 F8.0 (first hole, return to R)
X2.0 (second hole)
X3.0 (third hole)
G98 X4.0 (fourth hole, return to initial level)
G80
```

Holes one through three retract only to Z0.1 between holes: minimal air travel, fastest pattern. The fourth hole carries G98 on its line, so after drilling it the tool climbs back to Z1.0. In a real program that G98 appears exactly where the next rapid has to clear something taller than the R plane, a strap clamp between two hole groups, the wall of a pocket, a boss standing above the surrounding face. G98 and G99 are modal, so each stays active for the following holes until the other appears, and either can be stated per hole line as the example shows.

| | G98: initial level return | G99: R plane return |
| --- | --- | --- |
| Retract height between holes | Z where the cycle started | The cycle's R word |
| Cycle time | Slower, long air moves | Faster, minimal air moves |
| Clearance over obstacles | Whatever the initial level gives | Almost none, R is barely above the part |
| Typical use | Hopping clamps, steps, walls between holes | Runs of holes over open, flat ground |
| Risk when misused | Wasted time only | Rapid into a clamp or step |

The asymmetry in that last row is the safety lesson: choosing G98 where G99 would do costs seconds; choosing G99 where G98 was needed costs a tool, a part, or worse. When in doubt, the expensive-looking choice is the cheap one.

## The trap: the same letters mean something else on a lathe

Fanuc-family controls reuse G98 and G99 on lathes for a completely different job: feed per minute versus feed per revolution, the roles that mills assign to [G94 and G95](/journal/g94-vs-g95-feed-per-minute-vs-feed-per-rev/). The [Fanuc G-code list](https://www.helmancnc.com/fanuc-g-code-list/) shows both meanings, and the collision is a standing source of confusion when people carry knowledge between machine types or read example code without knowing which machine it targets. A lathe program starting G99 G96 is setting per-rev feed and constant surface speed; a mill program with G99 G81 is setting the retract plane of a drilling cycle. Same two characters, unrelated meanings.

The practical defense is to always read G98/G99 in context: next to a canned cycle word like G81, G83, or G84, they are return planes; next to feed and spindle words on a turning center, they are feed modes. When practicing codes, learn them as machine-plus-code pairs rather than bare numbers, because several other codes shift meaning the same way between mill and lathe dialects, a theme that runs through the [lathe versus mill G-code differences cheat sheet](/journal/lathe-vs-mill-g-code-differences-cheat-sheet/).

## Choosing the initial level deliberately

G98 only protects you if the initial level is actually high enough, and this is where the pair connects to setup discipline rather than syntax. The initial level is not stated anywhere in the cycle line; it is simply the Z position the tool occupied when the cycle began, which makes it an implicit input that is easy to leave to chance. A program that approaches the part at Z0.25, then calls a cycle expecting G98 to clear a half-inch clamp, retracts to 0.25 and hits the clamp anyway. The retract goes to where the tool started, not to where it would be safe.

The clean pattern is to make the pre-cycle approach height an explicit, named decision: rapid to the drilling position, position Z at the chosen initial level with the tool length offset active, and only then open the cycle. On the way out, close the cycle with G80 and move to a known safe height before any long travel, the same discipline that surrounds [G28 return to home position](/journal/g28-return-to-home-position-explained/) moves. Cycles inherit whatever Z context you give them; giving them a deliberate one is what makes G98 mean something.

There is one more subtlety worth knowing: on many controls, if the R plane is programmed above the initial level, the behavior is control-specific and often surprising. Keeping the relationship simple, initial level clearly above R, R just above the part, avoids the corner cases entirely.

A realistic sequencing example shows the decision in motion. Imagine a rectangular plate with two groups of six holes, and a strap clamp across the middle of the plate between the groups. The efficient program drills group one under G99, six quick low retracts. The move from hole six to hole seven crosses the clamp, so hole six's line carries G98: the tool climbs to the initial level, crosses in safety, and the cycle continues. Hole seven's line restates G99, and group two runs fast again. Two mode words in twelve holes, each earning its place. At second op, the clamp moves to a different position, and the G98 moves with it; the return-plane choices are as much a part of the fixturing plan as the clamp itself, which is why they get reviewed whenever the setup changes.

## How much time G99 actually saves

The savings are easy to estimate and bigger than intuition suggests. Suppose the initial level is 1.0 inch above the part, R is 0.1, and the machine rapids in Z at 400 inches per minute. Each G98 hole adds roughly 1.8 inches of extra Z travel compared with G99, about 0.27 seconds. On 10 holes that is a rounding error; on a 500-hole plate it is over two minutes per part, and across a 200-part batch it is seven hours of pure air cutting. Estimating this kind of arithmetic before running a job is a skill of its own, covered in [how to estimate cycle time from a G-code program](/journal/how-to-estimate-cycle-time-from-a-g-code-program/).

That arithmetic is why the professional default is G99 with tactical G98s, rather than G98 everywhere as a comfort blanket. The clamp positions are known at setup time; the program encodes them once, and the machine stops paying a clearance tax on the hundreds of holes that never needed it. When a program you inherit runs visibly slower than it should on hole work, scanning for a blanket G98 is one of the first easy wins.

## Bottom line: G99 for speed, G98 for the hop

Between holes, G99 retracts to the R plane and G98 retracts to the initial level. Default to G99 over open ground, switch to G98 for exactly the moves that must clear a clamp or a step, and make the initial level a deliberate height rather than an accident of the approach move. Remember the Fanuc lathe reuses the same letters for feed modes, so read the pair in context, and close every cycle with G80 plus a move to a known safe height. That is the entire skill, and it is worth having cold: this pair is on nearly every drilled part you will ever program.

## Frequently asked questions

### What is the difference between G98 and G99 in a drilling cycle?

They set the retract height between holes in a canned cycle on a mill. G98 returns the tool to the initial level, the Z height where the cycle started; G99 returns it only to the R plane, the clearance height named by the cycle's R word. G99 minimizes air travel and is the default for holes over open ground; G98 provides clearance for moves that must pass over clamps, steps, or walls.

### Do G98 and G99 mean something different on a lathe?

Yes, and it is a classic Fanuc trap: on many turning controls G98 means feed per minute and G99 means feed per revolution, the roles that mills give to G94 and G95. Read the pair in context: beside a canned cycle like G81 or G83 they are return planes; beside feed and spindle words on a lathe they are feed modes. Example code from the internet is only trustworthy once you know which machine type it targets.

### When should I use G98 instead of G99?

Whenever the straight-line move to the next hole would hit something taller than the R plane: a strap clamp between hole groups, a boss or step on the part, a fixture rib, a pocket wall. State G98 on the hole line before the hop, and switch back to G99 for the next open run. Also confirm the initial level itself is high enough, because G98 retracts to where the cycle started, not to an inherently safe height.

### What is the fastest way to memorize G98 vs G99 and the other cycle codes?

Recall practice beats rereading charts, because the failure happens months later at the machine when the chart is not in front of you. A free app like G-Code Sprint drills G98/G99, the cycle family G81 through G89, and the rest of the everyday codes as short timed quizzes, repeating the ones you miss until the answer is a reflex. Pair the drilling with reading real programs and predicting each retract before checking.

### Does G99 actually save meaningful cycle time?

On hole counts in the hundreds, yes. With an initial level 1 inch up, R at 0.1, and 400 in/min Z rapids, each G98 hole wastes roughly 0.27 seconds versus G99; on a 500-hole plate that exceeds two minutes per part, and multiplies across the batch. That is why the professional pattern is G99 by default with G98 only where an obstacle demands it, rather than G98 everywhere for comfort.

## Sources

- [LinuxCNC G-code reference](https://linuxcnc.org/docs/html/gcode/g-code.html)
- [HelmanCNC Fanuc G-code list](https://www.helmancnc.com/fanuc-g-code-list/)
- [CNC Cookbook: G-code program format and structure](https://www.cnccookbook.com/g-code-basics-program-format-structure-blocks/)

---

Source: https://gcodepractice.com/journal/g98-vs-g99-canned-cycle-return-plane/
Author: Lawrence Arya — https://www.linkedin.com/in/vibecoding/
