CNC programming · G-code

How to Use G81, G73 and G83 CNC Drilling Cycles

Three canned cycles cover most machining-centre drilling: G81 for shallow holes, G73 for high-speed pecking, and G83 for deep holes. This guide compares them with commented examples, explains the Q/R/P/K parameters and G98/G99 returns, and covers the safety steps that keep a deep hole from becoming a broken-drill incident.

G81G73G83Canned cyclesPeck drilling
Start reading

Quick answer

G81 is a simple drill: rapid to the R plane, feed to Z, retract. G73 is high-speed pecking — it feeds down in increments of Q with a small retract that breaks the chip but does not clear the hole. G83 is deep-hole pecking — it typically retracts fully to the R plane each peck, clearing chips and letting coolant back in. Cycle choice depends on depth, chip behaviour, material and coolant, not depth alone, and the exact retract behaviour is controller-dependent, so always verify on your own machine before running unattended.

01Quick comparison

CycleActionBest forSpeed
G81Rapid to R → feed to Z → retractShallow holes, ~up to 3×DFastest
G73Peck with small retract (breaks chip)Moderate depth; chip needs breaking, not clearingMedium
G83Peck with full retract to R (clears chips)Deep holes, packing materialsSlowest, safest

02What is a canned drilling cycle?

A canned cycle collapses the whole rapid–feed–retract sequence of a hole into a single program line. Instead of writing the motion for every hole, you define the cycle once, then list the hole positions. A pattern of fifty holes becomes fifty short lines instead of two hundred motion blocks.

The cycle stays active after the first hole and repeats at every X/Y you program until you cancel it with G80. Forgetting to cancel is the most common "why did it drill another hole?" bug.

03G81 — standard drilling

The simplest cycle: rapid to the R plane, feed straight down to Z, rapid retract. One continuous cut, no interruption. Use it only where chips clear on their own.

G90 G94 G17          ; absolute, per-min, XY plane
G00 X0 Y0 G43 Z50 H01   ; move to start, tool length comp
S12000 M03           ; spindle on (set from RPM calc)
G99 G81 R2 Z-20 F250  ; R plane 2mm, depth 20mm, feed 250
X20 Y0              ; hole 2
X40 Y0              ; hole 3
G80 G00 Z50        ; CANCEL cycle, retract

Example 1. FANUC-style G81. R2 = retract plane 2 mm above the part; Z-20 = final depth; F250 = feed (from the feed calculator). Syntax is illustrative — confirm against your control manual.

04G73 — high-speed peck drilling

G73 feeds down in increments of Q, then makes a small retract — just enough to break the chip, not to clear the hole. This keeps the tool close to the cut, so it is faster than G83 while still controlling long, stringy chips.

G99 G73 R2 Z-30 Q5 F200  ; peck every 5mm, small retract
X20 Y0
X40 Y0
G80 G00 Z50

Example 2. G73 with Q5 = 5 mm peck increment. The retract between pecks is short (control-defined). Use where the chip must break but the hole is not so deep that full evacuation is required.

05G83 — deep-hole peck drilling

G83 feeds down in increments of Q, then typically retracts fully to the R plane, clearing chips out of the hole and letting coolant flush back in. It is slower than G73 but is the safe choice for deep holes and gummy materials.

G99 G83 R2 Z-60 Q8 P100 F150  ; deep hole, 8mm peck
X20 Y0                       ; P100 = 0.1s dwell at bottom
X40 Y0
G80 G00 Z50

Example 3. G83, Z-60 = 60 mm deep, Q8 = 8 mm peck increment, P100 = 100 ms bottom dwell (most controls read P in ms). The full retract between pecks is why this is the deep-hole standard — but confirm the actual retract on your control.

Exact G83 retract behaviour is controller-dependent. Whether it returns fully to R every peck or shortens the retract after the first peck depends on a control parameter. Prove it with a dry run before running a deep hole unattended.

06G98 vs G99 — return levels

G99 — return to R plane

The tool retracts only to the R (clearance) plane between holes. Faster, because it stays just above the part. Use when nothing obstructs the path between holes.

G98 — return to initial plane

The tool retracts all the way to the start height above everything. Safer when features sit at different heights or the path between holes is not clear. Costs a little cycle time.

If a cycle is called with G99 but a tall boss or clamp sits between two holes, the tool can crash on the low return. When in doubt, default to G98 and accept the extra time.

07G80 — cancel the cycle

G80 ends the active canned cycle. After it, motion words return to normal G00/G01 behaviour and no hole will be drilled by a bare X/Y move.

  • Always cancel the cycle when the hole pattern is done.
  • Switch feed mode back explicitly (e.g. G00) so the next move is not a surprise feed.
  • A common bug: an X/Y move later in the program unexpectedly drills because G81 was never cancelled.

08Parameter definitions: X Y Z R Q P F K

WordMeaning (FANUC-style)Note
X YHole positionDefines where the next hole is drilled
ZFinal hole depthUsually negative, measured from R
RRetract / clearance planeAbove the part; the cycle returns here (G99) or passes through (G98)
QPeck increment (depth per peck)G73/G83 only; smaller Q = more retracts, safer but slower
PDwell at bottomMilliseconds on most controls
FFeed rateSet from the feed calculator; stays modal
KNumber of repetitionsDrills K holes at the same position

Table 2. Letter assignments vary by control. This is a FANUC-style reference; always confirm against your machine manual before programming.

09Side-by-side: one hole, three cycles

; Same position X30 Y0, depth Z-40, R2, F200
G99 G81 X30 Y0 R2 Z-40 F200   ; shallow-style call (risk if truly deep)
G99 G73 X30 Y0 R2 Z-40 Q5 F200  ; peck 5mm, small retract
G99 G83 X30 Y0 R2 Z-40 Q8 F200  ; peck 8mm, full retract
G80 G00 Z50                  ; cancel

Example 4. Notice only the cycle word and Q change — the position, R, Z and feed stay the same. The motion pattern is what each cycle changes.

10How depth and chips decide the cycle

Cycle choice is not only about depth — it is about whether chips can leave the hole. A through-coolant drill in free-machining steel may run G81 happily to 5×D, while a solid drill in stainless may need G83 at 3×D.

  • Chips clear on their own → G81.
  • Chips form but need breaking → G73.
  • Chips pack or material is gummy → G83, ideally with through-tool coolant.
  • No through-tool coolant and depth grows → G83 sooner rather than later.

11Controller differences — verify, don't assume

AspectWhat variesAction
Peck retract distanceG73/G83 short vs full retract behaviourCheck control parameter; dry run
P unitsSeconds vs millisecondsConfirm in manual
Q on first peckSome controls vary the first incrementProve on scrap
Canned cycle familyLetter set differs (Haas / FANUC / Mazak / Siemens)Use your machine's manual, not a generic post
Never copy a cycle block from another shop's program and assume it behaves the same. The same G-code can retract differently on a different control. Verify on your machine.

12Safe setup and dry run

  1. Confirm RPM and feedSet S and F from the RPM and feed calculators before the cycle runs.
  2. Verify the R planeMake sure R clears the part and any clamps; use G98 if anything is in the way.
  3. Check Z depthConfirm Z reaches the required depth but not through a fixture or vice.
  4. Single-block the first holeRun the first hole one step at a time with the feed override low.
  5. Dry run retractedWith the tool pulled up, run the program to confirm motion and positions.
  6. Prove the peck on scrapFor G73/G83, confirm the actual retract behaviour before the real part.
At Goldcattle every drilling program is simulated in CAM, run single-block on the first part, and measured on a first article — including the breakthrough feed on cross and deep holes — before it goes to production.

13Common alarms and errors

Tool breaks immediately in a deep hole
Likely cause
Chip packing; no peck (G81 used on a deep hole); coolant not reaching the tip
Check first
Coolant delivery at the tool, chip shape, L:D vs cycle choice
Then adjust
Move to G73/G83 with a shorter Q; add through-tool coolant or a parabolic drill; set a tool-life limit
Cycle drills an unexpected extra hole
Likely cause
Canned cycle never cancelled with G80
Check first
Whether G80 follows the hole pattern; whether a later X/Y move is inside the active cycle
Then adjust
Insert G80 (and explicit G00) immediately after the last hole
Hole too shallow or too deep
Likely cause
Wrong Z value, or R plane not where assumed
Check first
Z and R values against the print and the setup sheet
Then adjust
Correct Z/R; re-verify with a single-block first hole

14Decision table

ConditionRecommended cycle
Depth ≤ ~3×D, chips clearG81
~3–5×D, chip needs breakingG73 (or G83 with through-coolant)
> ~5×D, or gummy materialG83, ideally with through-tool coolant
Cross holes / interrupted exitG83 + reduced breakthrough feed
No through-tool coolant, deeper holeG83 sooner, shorter Q

Table 3. Starting points only. Band edges shift with material, drill geometry, coolant pressure and machine rigidity — and the exact retract behaviour is controller-dependent.

FAQFrequently asked questions

When should I use G81 instead of G83?

Use G81 for shallow holes — roughly up to 3×D — where chips clear on their own and there is no packing risk. The moment chips cannot escape (deeper holes, gummy material, no through-tool coolant), move to G73 or G83. Using G83 on a shallow hole only wastes cycle time; using G81 on a deep hole risks a packed flute and a snapped drill.

What is the difference between G73 and G83?

Both peck. G73 makes a small retract between pecks — enough to break the chip but not to clear the hole, so it is fast. G83 typically retracts fully to the R plane each peck, clearing chips and replenishing coolant, so it is slower but far safer for deep holes. The exact retract distance is set by your control's parameters — never assume it from another machine's post.

What do Q, R, P and K mean?

Q is the peck increment (depth of each peck). R is the retract (clearance) plane the cycle returns to between holes or pecks. P is a dwell at the bottom of the hole, in milliseconds on most controls. K repeats the cycle at the same location K times. X, Y, Z are the position and final depth. Always check your control's exact meaning — letter assignments vary.

G98 or G99 — which return plane?

G98 returns to the initial (safe) plane above all features; G99 returns to the R plane just above the part. G99 is usually faster because the tool stays low between holes, but only use it when nothing is in the way. G98 is the safe default when clearance above the part is uncertain or features sit at different heights.

How do I cancel a drilling cycle?

Program G80. Any cycle remains active and will repeat at every subsequent position until cancelled, which is a classic cause of surprise holes. Get in the habit of cancelling the cycle (and switching back to G00/G01) right after the hole pattern.

Why does my G83 not fully retract?

Because retract behaviour is controller-dependent. Many controls have a parameter that changes whether G83 does a full return to R or a shorter retract after the first peck. Check your control manual and prove it with a dry run before trusting it on a deep hole.

Can I use these cycles on a lathe?

This page is written for machining centres (mills/VMCs). Lathes have drilling cycles too (often G74/G83-style depending on the control), but the syntax and plane logic differ. Do not copy milling cycle format onto a turning centre without checking the lathe manual.

What safety steps should I never skip?

Single-block the first hole, dry run with the tool retracted, confirm the R plane and Z depth, verify the retract direction with G98/G99, and prove the peck behaviour on a scrap part. Our workflow uses CAM simulation, single block and a first article before any production run.

Do these cycles set the cutting speed and feed?

No. The canned cycle only controls the motion pattern. RPM (from the RPM calculator) and feed (from the feed calculator or the feeds & speeds guide) must already be active as S and F words before the cycle runs.

Where do I get reliable cycle syntax?

From your machine's own programming manual — Haas, FANUC, Mazak, Siemens and others differ in detail. The examples here are illustrative FANUC-style syntax; treat them as a study aid, not a drop-in program.

The CNC drilling & parameters library

G-code is the bridge between the process decision and the machine. This page keeps the syntax honest and the safety front and centre.

Need reliable CNC drilling for complex hole patterns?

Send us your CAD drawing. We program, simulate and prove out drilling cycles on CAM, then verify the first article — including the R plane, peck behaviour and breakthrough feed — before production. Deep holes, cross holes and multi-station patterns are our everyday work.

  • 26 years of in-house precision machining
  • CAM programming and simulation before the machine runs
  • Single-block prove-out and first-article inspection
  • 3-, 4- and 5-axis CNC, 100+ machines
  • ISO 9001 quality system
  • 24-hour response on engineering reviews
CNC Machining Services
GC

Goldcattle CNC Engineering Team

Xiamen Goldcattle Industrial & Trade Co., Ltd. has run in-house precision machining for 26 years as a Chinese National High-Tech Enterprise, with more than 100 machines covering CNC machining, injection moulding, tooling, die casting, 3D printing and sheet metal. Everything on this page reflects how we actually set up, prove out and inspect holes on production parts — not a catalogue reprint.

Technically reviewed by our CNC Programming Lead · ISO 9001 quality system · Published 2026-08-05 · Last updated 2026-08-05. Cutting data, coolant concentrations and controller syntax should always be confirmed against your machine, controller, tooling and fluid manufacturer's current documentation.

Recommended Reading