Drilling a row of holes is the same three moves over and over: rapid to the hole, feed down, retract. A canned cycle packs that whole sequence into one modal line so you do not repeat it for every hole. G81 and G83 are the two you will use most.

What a canned cycle does

Instead of writing a rapid, a feed, and a retract for each hole, you call a cycle once with its parameters, then list the hole positions. The control runs the full sequence at every X Y until you cancel it. (New to the idea entirely? The what-is-a-canned-cycle overview introduces the whole concept before this G81-versus-G83 comparison.) Because the cycle is modal, that single setup line drives an entire bolt pattern. The cycles are defined in the LinuxCNC canned-cycle reference, and the modal behavior is the same idea as modal vs non-modal G-codes elsewhere in the language.

G81: the simple drill cycle

G81 is the most basic cycle. For each hole it rapids to the R plane, feeds to the final Z depth in one pass, then retracts. It is the right choice for shallow holes where chips clear on their own. The G81 cycle reference shows the standard form:

G81 G99 X10. Y10. Z-15. R2. F100   (drill the first hole)
X30. Y10.                          (second hole, same cycle)
X50. Y10.                          (third hole)
G80                                (cancel the cycle)

The parameters appear once. Each later line is just a position, and G80 ends the cycle.

G83: peck drilling for deep holes

G83 adds chip clearing. Instead of one plunge, it drills down by the peck increment Q, then fully retracts to the R plane to pull the chips out, then plunges back to continue. It repeats until it reaches Z. That full retract is what deep holes need: without it, chips pack the flutes and break the drill. The G83 peck cycle reference gives the form, which just adds Q:

G83 G99 X10. Y10. Z-40. Q5. R2. F80

A common rule of thumb is to switch from G81 to a peck cycle once the hole is roughly three or more times deeper than its diameter.

The drilling family shares one grammar and differs in what happens at the bottom (and some controls extend the cycle idea sideways: Haas’s G12/G13 circular pocket cycles apply the same one-block thinking to round pockets):

CycleWhat it doesBest for
G81Feed to depth, retractShallow through-holes
G82Feed to depth, dwell (P), retractFlat-bottom holes, counterbores
G83Peck with full retract each step (Q)Deep holes, chip clearing
G73High-speed peck, small retract (Q)Deep holes, faster, lighter clearing
G80Cancel the active cycleEnding any cycle

The R plane and the return modes

Two more words shape the cycle. R is the retract plane, a clearance height just above the part where the motion changes from rapid to feed, so the drill does not slam into the surface. G98 and G99 choose where the tool returns between holes:

CodeReturns toUse when
G98The initial Z levelThere are clamps or steps to clear between holes
G99The R planeThe path between holes is clear (faster)

The cycle replaces the manual G00 rapid and G01 feed moves you would otherwise write by hand, and the depths are measured from the active G54 work offset, so the part must be set up correctly first. These are exactly the lines you learn to recognize when you read a CNC program, which is why the drill cycles belong on every list of common G-codes for CNC beginners.

Bottom line

G81 drills straight to depth and retracts; G83 pecks in Q steps with a full retract each time to clear chips on deep holes. Both are modal, so each later hole is just an X Y position, and G80 cancels the cycle. Set Z for depth, R for the clearance plane, and pick G98 or G99 for the return height.

Sources

Frequently asked questions

What is the difference between G81 and G83?

G81 feeds straight to the final depth in one pass, then retracts. G83 drills in increments set by Q and fully retracts to the R plane between each peck to clear chips. Use G81 for shallow holes and G83 for deep ones.

What do the R, Z, and Q words mean in a drill cycle?

Z is the final depth, R is the retract plane where rapid changes to feed, and Q is the peck increment used by G83 and G73. F is the feedrate.

How do you cancel a canned cycle?

G80 cancels any active canned cycle. Because cycles are modal, the machine keeps drilling at every new X Y until you call G80.

What is the best way to learn canned cycles like G81 and G83?

Drill the codes with active recall. A free app like G-Code Sprint quizzes G81, G83, and the rest of the everyday codes as quick timed questions and repeats whichever ones you miss.

G-Code Sprint is a study and practice tool only. Always follow your instructor, employer, machine manual, and shop safety procedures.