CNC mill · G-code
G84: tapping cycle
G84 feeds a tap to depth, reverses the spindle and feeds out. Feed per revolution equals the thread pitch, so F = RPM × pitch in inches per minute. Haas lists it in modal group 09. Formats below from Haas, LinuxCNC, Mach4, Mach3 and Fanuc, each from its maker.
Worked example
1/4-20 tap at 500 RPM: F = 500 × 0.05 = 25 in/min. Written for this page in the Haas format.
T4 M06 (1/4-20 tap)G00 G90 G54 X1. Y1.G43 H04 Z0.1 M08G84 Z-0.5 R0.2 F25. S500X2.G80 G00 Z1. M09 (cancel the cycle)M30A 1/4-20 tap at 500 RPM feeds F = 500 × 0.05 = 25 in/min in G94, or F0.05 per rev in G95.
How each control writes it
Haas G84 X- Y- Z- R- F- S-
One source: Haas Automation, the control's maker
- E
- Chip-clean RPM: the spindle reverses to throw chips after each cycle (optional)
- F
- Feedrate
- J
- Retract multiple: J2 retracts twice as fast as it cut (also Setting 130) (optional)
- L
- Number of holes (repeats) in G91 incremental mode (optional)
- R
- R plane: the Z position above the part the cycle feeds from (optional)
- X
- X location of the hole (optional)
- Y
- Y location of the hole (optional)
- Z
- Z position at the bottom of the hole
- Q
- Peck depth, always incremental (optional)
- S
- Spindle speed (optional)
- No M03/M04 needed before G84: the cycle starts and stops the spindle.
- G74 is the left-hand (reverse) tapping cycle.
LinuxCNC G84 X- Y- Z- R- L- P- F-
One source: the LinuxCNC project, the control's maker
- X
- Hole X location (optional)
- Y
- Hole Y location (optional)
- Z
- Final depth
- R
- Retract (R) plane along Z
- L
- Repeat count, used in incremental mode (optional)
- P
- Dwell at the bottom, seconds (optional)
- $
- Spindle to use (optional)
- F
- Feed: spindle speed × pitch
- G84 is not synchronized: it is for a floating tap holder.
- Rigid (synchronized) tapping is G33.1 X- Y- Z- K-, with K the pitch.
Source: LinuxCNC documentation, "G84 Right-hand Tapping Cycle, Dwell" (archived Oct 29, 2026)
Mach4 G84 X- Y- Z- R- L- F- (rigid: G84.2 … P- J-)
One source: Artsoft (Newfangled Solutions), the control's maker
- X
- Hole X position (optional)
- Y
- Hole Y position (optional)
- Z
- End point (bottom) of the hole
- R
- Retract plane; the rapid plane under G99 (optional)
- L
- Number of repetitions (optional)
- F
- Feed: RPM × pitch in G94, or the pitch itself in G95
- J
- G84.2/G84.3 only: spindle speed for the retract (optional)
- G84 is for a tension/compression holder. G84.2 (right hand) and G84.3 (left hand) tap rigidly, with the axis geared to the spindle, on machines with spindle feedback.
- Feed per revolution (G95) needs RPM feedback; without it, program feed per minute (G94).
- Feed and speed overrides are held at 100% during tapping cycles.
Source: Mach4 Mill Programming Guide v1.1 (Artsoft), "G84 Right Hand Tapping; G84.2/G84.3 Rigid Tapping" (archived Jul 1, 2024)
Mach3 G84 X- Y- Z- R- L-
One source: Artsoft (Newfangled Solutions), the control's maker
- X, Y
- Hole position (optional)
- Z
- Bottom of the hole
- R
- Retract plane (optional)
- L
- Repeats (optional)
- Starts speed-feed synchronisation, feeds to Z, reverses the spindle and feeds back out at the current feed rate.
- The spindle is left turning clockwise at the end.
Source: Using Mach3Mill rev 1.84 (Artsoft), "10.7.24.5 G84 Cycle" (archived Oct 18, 2026)
Fanuc G84 X_ Y_ Z_ R_ P_ F_ K_ ;
One source: FANUC, the control's maker
- X
- Hole X position (optional)
- Y
- Hole Y position (optional)
- Z
- Bottom of the hole: a position in G90, the distance from the R point in G91
- R
- R point: a position in G90, the distance from the initial level in G91
- P
- Dwell at the bottom of the hole (optional)
- F
- Feedrate
- K
- Number of repeats, for equally spaced holes (give the first hole in G91) (optional)
- FANUC 0i-MF (machining centre), from its operator’s manual. On another FANUC model, check that control’s manual.
- Start the spindle with an M code before the cycle; it reverses at the bottom to back out.
- Feedrate override is ignored while it taps. Rigid tapping is its own section (§5.2).
- G98 returns to the initial level after the hole, G99 to the R point.
Source: FANUC B-64604EN-2/01, Operator's Manual, 0i-MF (machining centre), §5.1.8
How the controls differ
- Only Haas takes E, Q, S.
- Only LinuxCNC takes $.
- Only Fanuc takes K.
- A word two controls share can still mean different things: read each control's list above.
Haas follows Fanuc's numbering, but options and parameters differ between controls: check your control's manual.