G-code reference

G98: Canned cycle return to initial point (mill) or Feed per minute (lathe)

G98 means two different things. On a mill, it is canned cycle return to initial point: between holes, the tool returns to the height it started the cycle from. On a lathe (Fanuc G-code system A), it is feed per minute: on a system A lathe, F is read per minute. Check which machine a program is written for before reading it.

G98 on a mill: Canned cycle return to initial point

With G98, a canned cycle retracts to the initial Z (where the tool was before the cycle) between holes. It is the safe choice when clamps or bosses stand between holes. On a lathe with system A, G98 means feed per minute instead.

TypeG-code
MachineMill
GroupCycle return
ModalYes: stays active until replaced by another code from the same group

G98 example (mill)

G98 G81 X0. Y0. Z-5. R2. F100.

Drill, return to the starting height.

WordWhat it means here
G98Canned cycle return to initial point
G81Drilling cycle (spot drill)
X0.X axis target (on a lathe, the diameter)
Y0.Y axis target
Z-5.Z axis target or depth
R2.arc radius, or the R plane (retract height) in a drilling cycle, or a cycle setting
F100.feed rate (on threading codes, the lead)

Codes people confuse with G98 on a mill

CodeWhat it does instead
G99 Canned cycle return to R plane. Between holes, the tool returns only to the R plane.
G98 (lathe) Feed per minute (lathe). On a system A lathe, F is read per minute.

Memory hook: G98 = back to the start height; G99 = back to R.

Other codes in the cycle return group

Only one code from a modal group is active at a time. Programming any of these replaces G98.

  • G99 Canned cycle return to R plane

G98 on a lathe: Feed per minute

On a lathe with G-code system A, G98 sets feed per minute, used mostly for live tooling. Turning normally runs in G99, feed per revolution.

TypeG-code
MachineLathe (G-code system A)
GroupFeed mode
ModalYes: stays active until replaced by another code from the same group

G98 example (lathe)

G98 G01 Z-10. F100.

Feed at 100 mm per minute.

WordWhat it means here
G98Feed per minute (lathe)
G01Linear interpolation (feed move)
Z-10.Z axis target or depth
F100.feed rate (on threading codes, the lead)

Codes people confuse with G98 on a lathe

CodeWhat it does instead
G99 Feed per revolution (lathe). On a system A lathe, F is read per spindle revolution. The normal turning mode.
G98 (mill) Canned cycle return to initial point. Between holes, the tool returns to the height it started the cycle from.

Other codes in the feed mode group

Only one code from a modal group is active at a time. Programming any of these replaces G98.

  • G99 Feed per revolution (lathe)

Meanings follow the common Fanuc-style standard that Haas, Okuma (EIA mode), Mitsubishi, LinuxCNC and most other controls share for this code. Options and parameters change details from machine to machine, so check the manual for your control.

Quick check: G98

  1. What does G98 do? (Lathe)

  2. What does G98 do? (Mill)

  3. Which code: Between holes, the tool returns to the height it started the cycle from.(Mill)

Show the answers
  1. On a system A lathe, F is read per minute.
  2. Between holes, the tool returns to the height it started the cycle from.
  3. G98

Drill this code with the rest of the core set

More practice hubs

Frequently asked questions

What does G98 mean in CNC programming?
On a mill: Canned cycle return to initial point. Between holes, the tool returns to the height it started the cycle from. On a lathe: Feed per minute (lathe). On a system A lathe, F is read per minute.
Is G98 modal?
Yes. G98 belongs to the cycle return group and stays active until another code from that group is programmed.
What is the difference between G98 and G99?
G98 (canned cycle return to initial point): between holes, the tool returns to the height it started the cycle from. G99 (canned cycle return to R plane): between holes, the tool returns only to the R plane. A way to remember it: g98 = back to the start height; G99 = back to R.

G-Code Sprint is an educational practice tool only. It is not a CNC simulator, machine controller, safety manual, or replacement for instruction. Always follow your instructor, employer, machine manual, and shop procedures.

Free preview · no card Try G-Code Sprint