G84 / CNC Tapping Z-Depth Calculator

Inch system. Work out the program Z for a G84 cycle that taps a through hole full-length: the tap runs through the whole thickness and keeps going 6–7 threads past the back face, so its chamfered lead is fully out and every thread in the part is a full thread.

Unit
Inch (in)
Thread
Tap type → threads past the back face
Count the tapered threads on your tap if you're unsure. The longest chamfer in the range is used, so it's the worst case.
Threads past = chamfer threads + 2 full threads of margin, so the chamfered lead (which only cuts partial threads) ends up completely out of the part. Plug tap: 5 + 2 = 7, which matches the 6–7 thread rule.
Through hole
The whole thickness gets threaded. The tap-drill hole must be drilled through.
Glossary — what do these terms mean?
G84 (tapping cycle)
The canned tapping cycle: rapid to R, feed down to Z with the spindle synced to the feed, reverse the spindle at the bottom, and feed back out. Because the tap's lead fixes how far it moves per turn, the feed must equal RPM × pitch. The key question is "what is the right final Z?", which is what this page works out.
Pitch & TPI
TPI is threads per inch (1/4-20 has 20). Pitch is the distance from one thread to the next: pitch = 1 ÷ TPI (1/4-20 → 0.050"). So N threads of travel is N × pitch: 7 threads of 1/4-20 = 0.350", and 6 threads = 0.300".
Threads past the back face (the 6–7 thread rule)
To tap a through hole full-length, the tap can't stop at the back face. Its tip is chamfered, so the bottom few threads of the tap only cut partial threads. Sending the tip 6–7 threads past the back face carries that chamfer completely out of the part, so the full-size threads behind it pass all the way through and every thread in the hole is a full thread. For 1/4-20 that's 0.300–0.350" of overtravel. The page works this out from the tap type: threads past = chamfer threads + 2. That's 7 for a plug tap, 4 for a bottoming tap and 12 for a taper tap. Tick Override to enter your own number.
Tap chamfer (lead)
The tapered end of the tap. Bottoming taps have 1–2 chamfer threads, plug taps (and most spiral-point taps) 3–5, and taper taps 7–10. The threads past the back face must be at least the chamfer threads; otherwise the threads at the back face are only partial. A taper tap may need more than 7.
Program Z (tap tip target)
The Z on the G84 line: the deepest point the tap tip reaches, measured from the part surface (Z0): Z = −(thickness + threads past × pitch). Make sure there's room under the part for the tap to come out, using parallels or a relief in the fixture, and that it won't hit the vise floor.
Tap drill
The drill that makes the hole before tapping, sized for about 75% thread engagement. The presets use the standard 75% tap drills (1/4-20 → #7, 0.201"). A custom thread uses the approximation D − 0.0130 × 75 ÷ TPI. Drill it through first, using the G81 page for its Z.
Sample G84 program
A minimal tapping block. The G84 line defines the cycle once, with final depth Z, retract plane R, and feed F = S ÷ TPI. Each X Y line after it taps another hole, until G80 cancels the cycle. The result panel generates the Z and R for this line; fill in F from your spindle speed (S ÷ TPI).
(--- setup ---)
G00 G90 G17 G20 G40 G49 G80 M05
T03 M06                  (load 1/4-20 tap)
G90 G54 S500 M03         (spindle on, CW)
G00 X0.0 Y0.0
G43 H03 Z1.0 M08
G00 Z.2

(--- G84 tap cycle: .500 thick + 7 threads past ---)
G84 G99 Z-.8500 R.100 F25.0  (F = 500 / 20 TPI)
X1.0  Y0.0              (cycle repeats at hole 2)
X2.0  Y0.0              (... hole 3)
G80                     (cancel canned cycle)

(--- clean up ---)
G00 Z.2 M09
G28 G91 Z0. M05
G90
M30

Program Z = −(thickness + threads past × pitch). Check your control's G84 feed convention (some use F as pitch), confirm there's room under the part, and verify Z before running.