Thread Mill G-Code: Helical Interpolation, Feeds and a Worked Example

Thread milling looks like a canned cycle until you have to write it by hand. Then three numbers decide whether the gauge passes: the path radius, the Z rise per revolution, and the feed at the cutting edge rather than at the tool centre.

This guide gives you the geometry, the six numbers to calculate, a complete M10 × 1.5 program you can adapt, and the mistakes that produce an oversize thread or a broken cutter. For choosing between tapping and milling in the first place, see our thread milling vs tapping guide.

The short version. Path radius = (major diameter − cutter diameter) ÷ 2. Z rises by exactly one thread pitch per 360° of orbit. A right-hand internal thread is cut with G03 while Z rises. Program the tool-centre feed, but calculate it from the cutting-edge feed — the correction is (major − cutter) ÷ major. Get those four right and the thread gauges.

The geometry in one picture

A thread mill is smaller than the hole. The cutter does not plunge to the thread depth and stop; it orbits the hole once per pitch while rising, and the thread form is generated by the combination of the tool profile, the orbit radius and the Z movement.

Swipe the diagram sideways →

Thread mill geometry: path radius in plan and pitch per revolution, shown unrolled Left: a top view of an internal thread with the cutter orbiting a path whose radius is the major diameter minus the cutter diameter, divided by two. Right: the helix unrolled into a flat strip, where one full revolution spans the strip and Z rises by one thread pitch. Plan view: path radius The thread size comes from the orbit, not the cutter. R orbit cutter R = (D major − D cutter) ÷ 2 The cutter’s outside edge reaches the major diameter; its inside edge sweeps through the centre. Unrolled helix: one pitch per revolution Flatten the thread’s circumference into a strip and the orbit becomes a straight ramp. 0° 180° 360° pitch Z per 360° feed up Right-hand thread: G03 while Z rises. Left-hand thread: G02 with Z rising, or G03 with Z falling.
Figure 1. Left: the orbit radius sets the major diameter. Right: unrolled, the helix is a ramp — one revolution spans the circumference and rises exactly one pitch.

The useful mental model is the unrolled view. Flatten the thread’s circumference into a strip: one full orbit is the width of the strip, and the height gained is one pitch. Everything else — direction, number of turns, where to start — is bookkeeping on that ramp.

The orbit radius is why one cutter covers a range of thread sizes. A 6 mm single-profile cutter can cut anything from about M8 to M14, because the thread size is set by the path, not by the tool diameter. The limit is the minor diameter: the cutter must pass through the hole with clearance.

The six numbers you need before you write a line

Fill this table in before opening the editor. It takes two minutes and prevents most of the failures in the section on mistakes.

Table 1 — The six inputs for a thread mill program
NumberHow to get itExample (M10 × 1.5)
Major diameterNominal thread size on the drawing10.0 mm
PitchFrom the thread callout (coarse unless stated)1.5 mm
Cutter diameterTool supplier data; must clear the minor diameter6.0 mm
Path radius(major − cutter) ÷ 22.0 mm
Z rise per revolutionEqual to the pitch1.5 mm
Feed at the centreEdge feed × (major − cutter) ÷ major≈ 380 mm/min

Two checks before you cut. First, the cutter must be smaller than the minor diameter with about 0.2 mm to spare — for M10 × 1.5 the minor diameter is about 8.5 mm, so a 6 mm cutter has room. Second, the orbit plus the cutter radius must reach the major diameter exactly; a path that is 0.1 mm off shows up as a gauge failure, not as a visible defect.

A complete M10 × 1.5 program

The part is a 15 mm plate, through hole, M10 × 1.5. The tool starts 1.5 mm below the part so the first revolution is fully engaged, and cuts upward — the standard climb-milling direction for a right-hand internal thread.

( M10 x 1.5 internal, through hole, 6 mm 3-flute thread mill )
( path radius = (10 - 6) / 2 = 2.0 mm )
( 11 revolutions x 1.5 mm = 16.5 mm of travel )

G21 G90 G54
G0 X0 Y0
G0 Z5.
S6400 M03
G0 Z-16.5              ( start 1.5 mm below the part )

G1 X2.0 Y0 F380        ( move out to the path radius, at feed )
G3 X2.0 Y0 Z-15.0 I-2.0 J0.
G3 X2.0 Y0 Z-13.5 I-2.0 J0.
G3 X2.0 Y0 Z-12.0 I-2.0 J0.
G3 X2.0 Y0 Z-10.5 I-2.0 J0.
G3 X2.0 Y0 Z-9.0  I-2.0 J0.
G3 X2.0 Y0 Z-7.5  I-2.0 J0.
G3 X2.0 Y0 Z-6.0  I-2.0 J0.
G3 X2.0 Y0 Z-4.5  I-2.0 J0.
G3 X2.0 Y0 Z-3.0  I-2.0 J0.
G3 X2.0 Y0 Z-1.5  I-2.0 J0.
G3 X2.0 Y0 Z0.0   I-2.0 J0.

G1 X0 Y0               ( back to centre )
G0 Z5.
M05
M30

Fanuc-style. I and J are the centre of the arc relative to the start point, so I-2.0 means the arc centre is 2 mm in −X. Confirm your post-processor’s I/J mode (incremental vs absolute) before running.

Line by line, the blocks that matter:

Table 2 — What each block does
BlockPurposeIf it is wrong
G0 Z-16.5Start below the thread so the first orbit is completePartial thread at the top or bottom
G1 X2.0 Y0 F380Move from centre to path radius at cutting feedRapid into the wall; broken cutter
G3 … I-2.0 J0.One full orbit, counter-clockwise, rising 1.5 mmWrong hand thread or wrong pitch
Z values1.5 mm per revolution, exactlyThread pitch wrong; gauge will not enter
G1 X0 Y0Return to centre before retractingCutter drags on the last thread

Orbit direction and thread hand

Two things must match: the hand of the thread and the milling mode. Get one wrong and you cut a thread that looks right and gauges wrong, or a mirror-image thread that will not accept the mating part.

Swipe the diagram sideways →

Orbit direction and Z direction by thread hand and milling mode A four-cell matrix. For a right-hand internal thread in climb milling, orbit counter-clockwise with G03 while Z rises. Conventional milling uses G02. For a left-hand thread the orbit reverses. The table assumes an M03 right-hand cutter. Orbit and Z direction — internal threads, M03 right-hand cutter Pick the hand of the thread, then the milling mode. Cut from the bottom up so the chips fall clear. CLIMB (USUAL) CONVENTIONAL RIGHT-HAND most threads Counter-clockwise orbit G03 · Z rising Start below the thread, end above it. Standard choice for RH threads. Clockwise orbit G02 · Z rising Cutter rubs the flank; finish suffers. Use only if the setup demands it. LEFT-HAND rare, but real Clockwise orbit G02 · Z rising Mirror of the RH climb case. Check the drawing: LH is usually specified. Counter-clockwise orbit G03 · Z falling Same helix, cut top-down. Chips can pack in a blind hole.
Figure 2. With an M03 right-hand cutter, a right-hand internal thread is cut with G03 while Z rises. Reverse one of the two and you get a left-hand thread.

The rule that survives contact with the shop floor: for a right-hand internal thread, cut upward with G03. If the thread is left-hand, swap the orbit to G02 (or keep G03 and cut downward). If you are conventional milling instead of climb milling, the orbit reverses and the finish suffers — use it only when the setup forces it.

Table 3 — Direction quick reference
ThreadModeOrbitZNote
Right-handClimbG03RisingStandard; best finish
Right-handConventionalG02RisingOnly if required
Left-handClimbG02RisingMirror of the standard case
Left-handConventionalG03FallingChips can pack in a blind hole

Feed correction: the number most programs get wrong

The tool centre travels a smaller circle than the cutting edge. If you program the cutting-edge feed directly into the G-code, the edge moves slower than intended — the chip load drops, the cutter rubs, and in stainless or titanium it work-hardens.

Swipe the diagram sideways →

Feed correction: cutting-edge feed versus tool-centre feed The cutting edge travels a larger circle than the tool centre. Programming the tool-centre feed directly makes the chip load too high. Multiply the cutting-edge feed by major diameter minus cutter diameter, divided by major diameter.Feed correction: the edge moves faster than the centre Program the centre path, but set the feed for the cutting edge. Cutting-edge path — major diameter (R edge) Tool-centre path used in the G-code (R centre) Corrected feed F centre = F edge × (D major − D cutter) ÷ D major Example: M10 × 1.5, 6 mm cutter, 0.05 mm/tooth, 3 flutes n = 6,366 rpm → F edge ≈ 955 mm/min F centre = 955 × (10 − 6) ÷ 10 ≈ 382 mm/min So program F ≈ 380 mm/min, not 955. Ignore this and the chip load at the edge is 2.5× what you intended on a 6 mm cutter in M10. The ratio is exactly the orbit radius over the major radius.
Figure 3. The ratio of centre feed to edge feed is exactly the orbit radius over the major radius.
Fcentre = Fedge × (Dmajor − Dcutter) ÷ Dmajor
For M10 × 1.5 with a 6 mm cutter: 955 × (10 − 6) ÷ 10 ≈ 382 mm/min.

Calculate the edge feed as you would for any milling cutter — RPM from surface speed, feed per tooth from the material — then apply the ratio. The correction is larger than most people expect on small threads: a 6 mm cutter in M10 needs the centre feed cut to about 40% of the edge feed.

Table 4 — Worked numbers for common threads (6 mm cutter unless stated)
ThreadPath radiusRPMEdge feedProgrammed feed
M6 × 1.02.0 mm (4 mm cutter)7,000560≈ 190
M8 × 1.251.5 mm (5 mm cutter)6,800680≈ 255
M10 × 1.52.0 mm6,400955≈ 380
M16 × 2.04.5 mm (7 mm cutter)5,5001,150≈ 650
1/4-20 UNC2.4 mm (5 mm cutter)6,800680≈ 400

Starting values for aluminium on a rigid machine; halve the surface speed for stainless and use about a third for titanium. Tool supplier data overrides these.

CNC machined aluminium flange with six threaded holes
Photo 1. Six threaded holes, one program. On a flange like this, the path radius and the feed correction are set once and reused for every hole.

Blind holes and depth

A blind hole changes the start point, not the geometry. You cannot start below the part, so start at the bottom of the thread, cut upward, and leave clearance below the thread for the chips and the tool’s entry.

Table 5 — Through hole vs blind hole
CaseStart ZEnd ZWatch
Through hole1–2 mm below the part0 to +1 mm aboveBurr at the exit; deburr after
Blind holeBottom of the threadTop of the threadClearance below the thread; chips
Blind, deepBottom, with a relief grooveTopCutter deflection at depth

For a blind hole, leave 2–3 pitches of clearance below the thread and at least one pitch above it for the cutter to exit cleanly. The depth stack-up — thread depth, clearance, tap lead, drill point — is covered in the design rules of the threading guide.

If the hole is deep relative to the cutter diameter, expect deflection. A 6 mm cutter at 30 mm depth will cut an oversize thread at the bottom unless you reduce the radial engagement or use a larger cutter with a reduced path.

Ten mistakes that fail the gauge

Table 6 — Symptom, cause, fix
#SymptomLikely causeFix
1Thread is tight; go gauge will not enterPath radius too smallRecompute (major − cutter) ÷ 2
2Thread is loose; no-go entersPath radius too large, or cutter wearCheck radius and tool offset
3Pitch is wrong over several turnsZ rise per revolution ≠ pitchOne pitch per 360°, not per line
4Thread is left-handG02 used for an RH threadG03 with Z rising
5Rough flanks, chatterFeed too high or cutter too longApply feed correction; shorten the tool
6Cutter breaks on entryRapid move to the path radiusG1 at cutting feed
7Partial thread at the topStart point too highStart below the thread
8Burr ring at the exitNo exit clearanceCut past the end; deburr
9Gauge passes at the top, fails at the bottomCutter deflectionReduce depth per pass or radial load
10Works on one machine, not anotherI/J incremental vs absoluteMatch the control’s arc mode

Fanuc, Siemens and Heidenhain

The geometry is universal; the syntax is not. The biggest differences are arc definition and whether the control offers a thread-milling cycle.

Table 7 — Dialect differences
ControlArc formNotes
Fanuc / HaasG02/G03 with I, J, K or RI/J are usually incremental from the start point; check parameter
Siemens 840DG02/G03 with I, J or CR=Also has a thread-milling cycle with pitch and direction parameters
HeidenhainCC/C with polar coordinatesCycle 262/263 for thread milling; Q parameters for the helix
Mach3 / LinuxCNCG02/G03 with I, JIncremental I/J; verify with a dry run

If the control has a thread-milling cycle, use it: it handles the entry arc, the helix and the exit. Write the longhand program when you need control over the entry point, or when the cycle is not available on an older machine.

Proving the first part

Cut one part and gauge it before running the batch. A thread mill program that is 0.1 mm off in radius produces a thread that looks perfect and fails the gauge.

  • Go/no-go plug gauge. The go gauge must enter the full thread by hand; the no-go must not enter more than 2.5 turns.
  • Pitch check. Screw in a known-good bolt or use a pitch gauge; a wrong Z rise is not always visible.
  • Depth check. Measure the usable thread depth, not the drill depth.
  • First-article record. Note the tool, the offsets, the program revision and the gauge result.
Machined titanium threaded housing with an internal thread
Photo 2. A threaded housing in titanium: the same program geometry, a third of the surface speed, and a gauge check on every first article.

If the first part fails, change one variable at a time. Radius first, then feed, then tool. Changing all three at once turns a gauge failure into a guess.

FAQ

What is the formula for thread mill path radius?

For an internal thread, path radius = (major diameter − cutter diameter) ÷ 2. For an external thread, it is (major diameter + cutter diameter) ÷ 2.

How much Z movement per revolution?

Exactly one thread pitch per 360° of orbit. For M10 × 1.5 that is 1.5 mm per revolution. A multi-start thread rises by the lead, which is the pitch multiplied by the number of starts.

G02 or G03 for a right-hand thread?

With an M03 right-hand cutter and climb milling, a right-hand internal thread is cut with G03 while Z rises. Left-hand threads use G02 with Z rising, or G03 with Z falling.

Why is my thread oversize?

Usually the path radius is too large, the cutter is worn, or the tool is deflecting in a deep hole. Check the radius against (major − cutter) ÷ 2 first, then the tool offset and the depth.

Do I need a tool radius offset?

No. The program is written to the tool centre; a radius offset would double-count the cutter. Use the path radius in the code and keep the offset at zero.

How do I correct the feed for thread milling?

Multiply the cutting-edge feed by (major diameter − cutter diameter) ÷ major diameter. The result is the tool-centre feed you program.

Can I thread mill a blind hole?

Yes. Start at the bottom of the thread and cut upward, with 2–3 pitches of clearance below the thread and at least one pitch of exit clearance above.

How many passes for a large thread?

One pass is common for small threads in aluminium. For large threads, hard materials or deep holes, use two passes: a roughing pass at a smaller radius and a finishing pass at full radius.

What cutter diameter should I use?

Small enough to clear the minor diameter by about 0.2 mm, and large enough to be rigid. Most shops use 50–70% of the nominal thread diameter; smaller cutters reach deeper but deflect more.

Does this work on a 3-axis machine?

Yes. Thread milling needs three axes and helical interpolation. No fourth axis or special holder is required.

Send the drawing. We will tell you which threading route we would use.

Tapping, thread milling or forming — with the class, the depth and the inspection plan in the quote. If the callout is incomplete, we will flag it before the parts are made.

  • Thread callout and engagement check
  • Process route and gauge plan
  • NDA available on request
Get a quote Free DFM review
Scroll to Top