What is a G83 CNC code?
G83 is a CNC canned cycle for peck drilling. It drills a hole in a series of steps called pecks, retracting fully out of the hole after each one.
That full retract is the key difference between G83 and other drilling cycles. Pulling the tool completely out gives chips a clean path to escape and lets coolant flush the hole before the next pass.
G83 is a modal command, meaning it stays active until you cancel it with G80.
Key Takeaways
- G83 drills in steps (pecks), retracting fully to the R plane or initial point after each one
- Use it when hole depth is 3–4 times the drill diameter or greater
- Q sets the peck depth — typically no larger than the drill’s diameter
- Cancel it with G80 when you’re done drilling, or the machine will keep drilling at every XY position in the program
- G73 is the faster alternative — use it for shallower holes where full chip clearance isn’t needed
| G83 – At A Glance | |
|---|---|
| Function | Peck drilling canned cycle |
| Type | Modal (Group 9) |
| Cancelled by | G80 |
| Returns to | G98: initial point / G99: R plane |
| Key parameter | Q — peck depth per pass |
| Use when | Hole depth is 3–4× greater than diameter |
Peck Drilling vs. Standard Drilling
Standard drilling (G81) pushes straight to depth in one pass. That works fine for shallow holes in most materials. Peck drilling breaks that depth into steps.

Each peck drills a short distance, then the tool retracts. This breaks the chip, clears debris, and lets coolant into the hole. On deep holes, that makes a big difference in hole quality and tool life.
G83 is especially common for blind holes, where chips have nowhere to go except back up the drill flute. Helping them clear the hole prevents packing, which causes oversize holes and broken tools.
Other codes used with the G83 code
- F – Feedrate
- G98 – Return to initial plane after each cycle
- G99 – Return to R plane after each cycle
- R – R plane position (clearance height above part)
- X – Hole X position
- Y – Hole Y position
- Z – Bottom of hole (Z depth)
- Q – Peck depth per pass
- P – Dwell time at bottom of the hole
- K or L – Number of cycle repetitions (machine dependent – check your manual)
G83 code format
G98 G83 X__ Y__ R__ Z__ Q__ F__
Here is a breakdown of each address:
- X and Y are the hole location
- R is the clearance height above the part surface
- Z is the final depth at the bottom of the hole
- Q is how far the tool drills before retracting (peck depth)
- F is the feedrate
In practice, you’ll usually see the XY position on its own line before the cycle line:
X2.0 Y3.0
G98 G83 R0.1 Z-1.5 Q0.25 F12.0
The program positions to the hole first, then triggers the drilling cycle. The Z value is the bottom of the hole — not the start.
G83 Example Program
G90 G54 G00 X1.0 Y1.0 (Rapid to first hole position)
G43 H01 Z1.0 M03 S1200 (Tool length comp, spindle on)
G98 G83 R0.1 Z-1.5 Q0.25 F12.0 (Start peck drilling cycle)
X2.0 Y1.0 (Second hole — cycle repeats)
X3.0 Y1.0 (Third hole)
G80 (Cancel canned cycle)
G00 Z5.0 M05 (Retract, spindle off)
G83 is modal, so after the first G83 line, all the XY moves repeat the cycle automatically. G80 cancels it.
When to Use G83
Use G83 when:
- The hole depth is 3–4 times the drill diameter or more
- You’re drilling blind holes and chip clearance is a concern
- You want a clean finish on deep holes
- You’re working in tough or stringy materials like stainless steel or titanium
A good general rule: if you’d use more than one peck to comfortably drill the hole manually on a drill press, use G83 on the CNC.
When Not to Use G83
Skip G83 for shallow through-holes in easy materials. Standard drilling with G81 is faster and perfectly fine when chip clearance isn’t a problem.
G83 has a longer cycle time because of the full retracts. If you’re drilling dozens of holes, that adds up. On shallower holes, G73 (partial retract) is often a better choice.
What to Think About When Using G83
Peck Depth (Q)
Q controls how far the tool drills before it retracts. A larger Q value means fewer pecks and a faster cycle. A smaller Q value is gentler on the tool.
A common starting point is to set Q equal to the drill diameter. So a 0.250″ drill would start with Q0.25. Adjust from there based on material hardness and chip behavior.
Some CNC controls support variable peck depth — where each peck gets progressively shorter to avoid chip packing deeper in the hole. Check your machine manual if you want to use that feature.
Retract Planes
G98 and G99 control where the tool goes after each drilling cycle.
- G98 returns to the Z height the tool was at when the cycle started (the initial point). Use this when there are clamps, fixtures, or raised features between holes.
- G99 returns to the R plane only. It’s faster, but be certain the R plane clears everything in your path.

If you’re not sure which to use, default to G98. The extra Z travel is worth the safety margin.
Positioning Mode
Check which positioning mode is active before running a G83 cycle.
- G90 (absolute) reads all coordinates from the part zero
- G91 (incremental) reads coordinates from the tool’s current position
The wrong mode can put the tool in a completely unexpected location. This is a common cause of machine crashes on drilling operations.
The difference between the two modes is shown below.


When in absolute mode, the machine will move relative to a fixed zero location.
When in incremental mode, the machine will move relative its current location.
Look at the first move in the pictures above. They both start at (0,0). They both move up one block in the Y axis.
On the second move, in absolute mode the machine the machine is still reading the new location as from the fixed zero location. In incremental mode the move is from the machines current location which is why the move is 1 block shorter in the Y axis.
COMMON MISTAKE – Forgetting G80
If you don’t cancel G83 with G80, the machine treats every XY move after the cycle as a new hole location. It will drill wherever the program sends it next — including over clamps, into fixtures, or off the part entirely.
Always end your drilling section with G80.
How to Cancel G83
Use G80 to cancel G83 and all other canned cycles.
G80
Put G80 on its own line immediately after your last hole. Some programmers also include G80 at the start of a drilling section as a precaution, in case a previous program left a canned cycle active.
G83 vs G73
G73 and G83 are both peck drilling cycles. The difference is how far the tool retracts after each peck.
- G83 fully retracts to the R plane or initial point after every peck — complete chip clearance, longer cycle time
- G73 only pulls back a small amount (set by the machine parameter) — faster, but less effective at clearing chips
Use G83 for deep holes where full chip removal matters. Use G73 for shallower holes where you just need to break up chips without the full retract penalty.

| Code | Retract | Best For |
|---|---|---|
| G83 | Full retract to R plane | Deep holes, blind holes, tough materials |
| G73 | Partial retract only | Moderate depth, chip breaking without full clearance |
G83 vs Other Drilling Cycles
Code | Name | Function |
Simple through-holes, no peck | ||
Drilling with dwell at bottom | ||
Deep holes, full chip clearance | ||
Moderate depth, faster cycle |