G-codeCanned CyclesModal group 9Mill

G84 & G74: Tapping Cycles

G84 is the right-hand tapping cycle. From the R plane the tap feeds down to Z with the spindle turning clockwise, the spindle reverses at the bottom and the tap feeds back out up its own thread. G74 is the left-hand version, cutting anticlockwise and reversing to clockwise to come out. The feed has to be the thread pitch times the spindle speed, so an M8 x 1.25 tap at 400 rpm needs F500 in millimetres per minute. Both cycles stay modal until G80, like the drilling cycles, so every X or Y after them taps another hole.

Syntax

G84 X__ Y__ Z__ R__ P__ F__ K__    Right-hand tap: clockwise in, reverse out
G74 X__ Y__ Z__ R__ P__ F__ K__    Left-hand tap: anticlockwise in, reverse out
G80                                Cancel the cycle

Parameters

AddressMeaningNotes
X YHole positionEach later block with an X or a Y taps another hole
ZDepth of the tap tipAllow for the chamfered lead of the tap: the full thread stops two or three pitches short of the tip
RStart of the feedGive the tap room to come up to speed and the holder room to float: 5mm (0.2in) is a sensible minimum
FFeedPitch x rpm in G94 (feed per minute). In G95 (feed per revolution) F is the pitch itself
PDwell at the bottomFanuc reads milliseconds and takes P only on a block that taps
KRepeat countL on a Haas
JRetract multiple, Haas onlyJ2 comes out twice as fast as it went in

On imperial taps the pitch is one over the threads per inch: a 3/8-16 tap at 900 rpm needs 900 / 16 = 56.25in/min, which is the worked figure in Haas's own manual.

Example

O0016 (TAP 4X M8X1.25 BLIND AND 1X M10X1.5 LH THROUGH, 30MM 6082 PLATE)
(TAP DRILLS ALREADY DONE: 4X 6.8MM TO Z-23, 1X 8.5MM THROUGH)
G21 G17 G40 G49 G80 G90 G94      (safe start block, feed per minute)
T06 M06                          (M8 x 1.25 spiral flute tap)
G54
S400 M03                         (spindle on, clockwise, before the cycle)
G00 X20. Y20.
G43 H06 Z25. M08
G99 G84 Z-19. R5. F500           (1.25 pitch x 400 rpm, 16mm of full thread)
X60.                             (second hole)
Y50.                             (third)
G98 X20.                         (fourth, back up to Z25 to clear the clamps)
G80 G00 Z25. M09                 (cancel before anything else moves)
M05
T07 M06                          (M10 x 1.5 left-hand tap)
S300 M04                         (anticlockwise before G74)
G00 X40. Y35.
G43 H07 Z25. M08
G98 G74 Z-35. R5. F450           (1.5 pitch x 300 rpm, lead clear of the back face)
G80 G00 Z25. M09
M05
G49
G91 G28 Z0.                      (home Z)
M30

Controller differences

ControlBehaviour
FanucThe spindle has to be turning before the cycle: M03 ahead of G84, M04 ahead of G74. Feed override is ignored while the tap is in the hole, and a feed hold does not stop the machine until the return is finished. A G00 to G03 code on the same block as G84 cancels the cycle, and an M code on the cycle block runs once, at the first positioning, not at every hole. Rigid tapping runs through the same G84 and G74, with a peck form and an extraction override of its own; G84.2 and G84.3 are the FS15-format rigid cycles. On a lathe in G code system A, G74 is end face peck drilling, not a tapping cycle.
HaasG84 rigid taps with no M29; there is no M29 on the mill M-code list. J is a retract multiple, so J2 comes out at twice the cutting speed, and Setting 130, Tap Retract Speed, does the same from the settings page (0 to 4; a J on the block wins). Setting 133, REPT Rigid Tap, orients the spindle so a second pass down the same hole picks up the first thread. The loop count is L. On a Haas lathe G74 is the end face grooving and peck drilling cycle.
Siemens 840DNative programs tap with CYCLE84, which needs a spindle that can run position-controlled, or CYCLE840 for a compensating chuck. CYCLE84 takes the thread as MPIT (M3 to M48) or PIT (the pitch), and the sign of either sets the direction, so one cycle covers right and left hand. SST is the tapping speed and SST1 the retract speed. In ISO dialect mode M29 switches the spindle to axis mode for rigid tapping; outside the cycle the native language taps with G331 and G332.
MazakEIA/ISO programs have G84 and G74, and synchronous tapping is an option with its own section in the manual. There is no M29 on Mazak's machining-centre M-code list, so a Fanuc post that writes one is not writing a Mazak code.
GrblNo tapping cycles: G74 and G84 are not on the v1.1 list, and a block carrying one stops the stream with error:20, unsupported command. Every tapped hole has to be posted another way.
MarlinNeither code is in the G-code index, so there is no tapping cycle to call, and even G80 exists only on a build with GCODE_MOTION_MODES compiled in.

What goes wrong

A feed in the wrong units snaps more taps than anything else. G84 wants pitch times speed in G94, so an M8 x 1.25 at 400 rpm is F500. Post F1.25 while G94 is live and the tap is asked to advance 1.25mm a minute while the spindle turns 400 times, and the tap strips the thread or twists off; post F500 under G95 and the control reads 500mm per revolution. Write G94 or G95 into the start block and check F against the pitch on every tapping line.

Then the spindle direction. A Fanuc wants the spindle already turning before the cycle, M03 for G84 and M04 for G74. Carry an M04 left over from a left-hand tap into a G84 and a right-hand tap goes in the wrong way round.

Close holes catch people next. The spindle reverses at the bottom of every hole, and Fanuc's own manual says to put a G04 dwell between holes that sit close together, so the spindle is back to speed before the next one starts.

The feed hold surprises an operator once. Feed override is ignored inside the hole and the hold does not stop the axis until the return is finished, so the knob at 0% does nothing while a tap jams in a blind hole. Reset or the emergency stop is what stops it.

Last, depth. The chamfered lead of a spiral flute tap is two or three pitches, about 3mm on an M8, so 16mm of full thread puts the tip at Z-19 and needs the 6.8mm drill to Z-23 below it. Tap to the drill depth and the tip bottoms out and breaks.

Updated 12 Oct 2026