G-Code Drilling Cycle Calculator

Build G81/G83 canned-cycle blocks for any hole pattern depth and peck size

Generates complete G81 drill and G83 peck-drill canned-cycle G-code from a hole depth, retract plane, peck increment, feed rate, RPM, and an XY hole list. Produces a formatted, ready-to-paste program block that keeps the cycle modal across every hole. Runs in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is the difference between G81 and G83?

G81 is a simple drilling cycle that plunges straight to depth and retracts once. G83 is a peck-drilling cycle that drills in increments, fully retracting between pecks to clear chips and re-introduce coolant. Use G83 for deep holes, gummy materials, or any hole deeper than about three diameters.

Hand-coding drilling cycles is repetitive and error-prone, especially across a grid of holes. This tool builds a complete G81 or G83 canned-cycle block from your depth, feed, speed, and a list of hole coordinates, emitting a program you can paste directly into the controller.

How it works

A canned cycle sets the drilling parameters once on the first hole, then repeats for every subsequent X and Y position because the cycle is modal. The generated block follows the standard Fanuc-style structure:

G90 G54 G17 G21
S<rpm> M03
G00 X<first> Y<first>
G00 Z<retract>
G98 G83 X.. Y.. Z<depth> R<retract> Q<peck> F<feed>
X.. Y..        (remaining holes)
G80
M05

For G81 the Q peck word is dropped and the drill plunges straight to depth. G98 returns the tool to the initial Z between holes, and G80 cancels the cycle at the end so following moves behave normally.

Choosing between G81 and G83

The choice is driven by hole depth relative to drill diameter, material, and chip control:

Use G81 (straight drill) when:

  • Hole depth is less than about 3× the drill diameter
  • Material is free-cutting (aluminium, brass, free-machining steel)
  • Chips break naturally at that depth without packing

Use G83 (peck drill) when:

  • Depth exceeds 3–4× the drill diameter
  • Material is gummy or work-hardens easily (stainless steel, titanium, some plastics)
  • Chips are long and stringy rather than breaking cleanly
  • Coolant delivery through the spindle is not available

G83 takes more cycle time because of the repeated retract moves, but it dramatically reduces drill breakage in deep holes. Breaking a small drill at depth in stainless steel typically means scrapping the workpiece — the time saved by skipping pecks is false economy.

Setting the peck increment (Q value)

A peck increment of roughly half the drill diameter is a common starting point. For a 10mm drill, that means Q = 5mm. In soft materials you can increase Q to 60–80% of the diameter to speed the cycle; in hard or abrasive materials, reduce Q to 30–40% and rely on full chip-clearing retracts rather than partial chip-break retracts.

Note that some controllers support G73, which retracts only a small fixed amount (chip-break only) rather than all the way to the R plane. The generator here uses the G83 full retract as the safer default.

Practical notes

The tool validates that your retract plane sits above the final depth and that feed, speed, and peck values are positive, so a malformed cycle is caught before it reaches the machine. Holes are read one per line as x, y pairs, separated by a comma or space. Always dry-run or single-block the program first, confirm the retract plane clears every clamp, and verify feeds and speeds against the drill manufacturer’s recommendations for your material before running at full rate.