Quick answer
The tool centre runs on a radius of (thread diameter − tool diameter) ÷ 2 inside a hole, or (minor diameter + tool diameter) ÷ 2 outside, and Z moves one pitch per revolution. An M12 × 1.75 internal thread 6 mm deep with a 9 mm single-point tool runs at R1.500 mm and needs 4 revolutions. A 1/2-13 internal thread 0.5" deep with a 0.375" tool runs at R0.0625" with 7 revolutions. Right-hand internal threads climb upwards with G03.
Source: Helical interpolation geometry for a right-hand thread with climb milling; check thread mill data with the tool maker. Reviewed . Use the calculator below for any other size.
Thread Milling G-Code
Generate helical interpolation toolpaths for internal or external Right-Hand threads. Uses Climb Milling best practices by default.
Generated Toolpath
Climb Milling Strategy
Internal RH: Tool feeds from the bottom up (Z increases) using G03 to ensure proper climb cutting.
Tool Clearance
A smooth 180° arcing lead-in and lead-out is automatically generated to prevent witness marks on the thread wall.
How the Thread Milling Generator Works
Thread milling cuts a thread by moving a rotating thread mill around a helix: one full circle in X and Y while Z moves by one pitch. The generator works out the radius of the tool-centre path from the thread and tool diameters, then writes arc-in, helical and arc-out moves for a right-hand thread with climb milling.
For an internal thread, the tool plunges to depth in the centre of the pre-drilled hole and climbs upwards with G03 (anticlockwise). Anticlockwise with Z rising gives a right-hand helix, and inside a bore it is a climb cut. For an external thread, the tool starts above the part and works downwards with G02 (clockwise). Clockwise with Z falling is also right-hand, and outside a diameter it is the climb direction.
A single-point tool (one row of teeth) needs as many revolutions as there are pitches in the thread length. A full-profile tool has teeth along its length, and the generator gives it one revolution.
The Formulas
Worked Examples
- Thread Ø12, pitch 1.75, single-point tool Ø9, Z0 to Z−6, F200
- Rpath = (12 − 9) ÷ 2 = 1.500 mm
- Revolutions = ⌈6 ÷ 1.75⌉ = ⌈3.43⌉ = 4
- Lead-in: G03 X1.500 Y0.000 Z-5.125 I0.750
- Helix ends at Z1.875 and the lead-out at Z2.750, back at the centre
- Thread Ø0.5, 13 TPI, single-point tool Ø0.375, Z0 to Z−0.5
- P = 1 ÷ 13 = 0.0769 in, Rpath = (0.5 − 0.375) ÷ 2 = 0.0625 in
- Revolutions = ⌈0.5 ÷ 0.0769⌉ = ⌈6.5⌉ = 7
- Lead-in to Z−0.4615, helix to Z0.0769, lead-out to Z0.1154
Because the revolutions are rounded up, the helix finishes a little past the thread length: above the top for internal threads, and up to one pitch below Z End for external threads. Leave room for that.
Tips for Using the Results
- Feed is at the tool centre. The F value is written exactly as entered and applies to the tool centre. Inside a hole the cutting edge travels faster than the centre, by Dthread ÷ (Dthread − Dtool). Use the Circular Feed calculator to convert an edge feed to a centre-line feed.
- Size the hole first. Internal threads need a pre-drilled hole at the minor diameter. Get the size from the Tap Drill calculator.
- Adjust the fit with the tool diameter. The code has no cutter compensation. Entering a slightly smaller tool diameter makes the path cut deeper on both internal and external threads. Check the pitch diameter with a gauge or by the three-wire method.
- Preview before cutting. Paste the output into the G-Code 3D Viewer to check the depth, the direction and the number of turns.
Frequently Asked Questions
Generated code is a starting point. Check tool data, thread dimensions and feeds against your tooling manufacturer's recommendations, and prove the program with a dry run before cutting.