G-code reference
G81 G-Code: Drilling Cycle (Spot Drill)
Drilling Cycle (Spot Drill) — Simple drilling canned cycle: rapid to R, feed to Z, rapid out. It is used for spot drilling and shallow holes.
| Property | Value |
|---|---|
| Code | G81 |
| Function | Drilling Cycle (Spot Drill) |
| Modal group | 09 |
| Type | Modal — stays active until replaced by another code of the same group |
| Used on | Milling machines |
| Syntax | G81 X_ Y_ Z_ R_ F_ |
What does G81 do?
Simple drilling canned cycle: rapid to R, feed to Z, rapid out. It is used for spot drilling and shallow holes.
G81 is modal: once programmed it remains in effect for the following blocks until another code from modal group 09 replaces it or the control is reset.
Syntax and parameters
G81 X_ Y_ Z_ R_ F_| Address | Meaning |
|---|---|
Z | Hole bottom |
R | Retract (rapid-to) plane |
F | Feed |
K/L | Repeat count (incremental patterns) |
G81 example program
G90 G98 G81 X10.0 Y10.0 Z-3.0 R2.0 F150.
X30.0
X50.0
G80▶ Open this example in the G-code viewer
Tips and common mistakes
- Holes deeper than ~3× diameter should use G83.
- G98 returns to the initial Z, G99 to the R plane between holes.
Controller compatibility
G81 follows the ISO/Fanuc dialect used by Fanuc, Haas, Brother, Doosan, Hurco (ISO mode), Mazak (EIA/ISO mode), Okuma (G-code mode) and Siemens in ISO dialect mode. Parameters, option packages and builder-specific behaviour can differ, so confirm the details in your machine's programming manual before running a new program.
Related codes
- G82 — Drilling Cycle with Dwell (Counterbore / Spot)
- G83 — Peck Drilling Cycle (Deep Hole)
- G80 — Cancel Canned Cycle
- G98 — Initial Plane Return (Mill) / Feed per Minute (Lathe)