CNC Thread Milling Calculator, G-Code and Toolpath Guide

22 July 2026

Mentor CNC Editör Ekibi

Mentor CNC • Training, Calculation and Toolpath

CNC Thread Milling Calculator, G-Code and Toolpath Guide

Thread milling is the machining of an internal or external thread with a rotating thread mill using helical interpolation. During the operation, the tool moves in a circular path in the XY plane while advancing along the Z axis by exactly the thread pitch at the same time. This page covers tool diameter selection, right-hand and left-hand thread direction, climb and conventional milling, radial passes, circular feed compensation, tolerance adjustment and general CNC program logic together.

Brand-independent approach: The information here does not promote any specific cutting tool brand or product code. The common application principles of major cutting tool manufacturers, general thread geometry and CNC programming logic have been combined in an original way for Mentor CNC.

Internal and external threadThe tool center path and the program diameter are calculated separately.
Right- and left-hand threadThe Z travel direction is set automatically with G02/G03.
Speed and feedThe actual program feed is corrected in circular motion.
General G-codeA Fanuc-type helical interpolation template is generated.

What does this page give a CNC operator?

In thread milling, knowing only the thread diameter and pitch is not enough. The ratio of the tool diameter to the hole, whether the tool is single- or multi-row, the direction of the helix, whether the Z axis moves up or down, and how the feed written into the CNC program is corrected must all be considered together. A wrong choice can cause the thread diameter to come out incorrect, leave a mark at the entry, break the tool or result in an unnecessarily long cycle time.

How does thread milling work?

The thread mill follows a helical path around the hole or the shaft. The Z travel in one full 360° turn equals the pitch for a single-start standard thread, and the lead (lead = pitch × number of starts) for a multi-start thread.

  1. Approach: The tool enters the cutting diameter tangentially from a safe zone.
  2. Thread machining: The Z axis advances simultaneously with the G02 or G03 circular motion.
  3. Exit: The tool leaves the cut along a tangential or controlled path without scoring the machined surface.
Z travel in one full turn = Pitch × Number of starts
XY circular Z travel
Helical interpolation combines the XY circular motion and the Z linear motion at the same time.
1

Adjustable thread size

For the same pitch and profile, different thread diameters larger than the tool diameter can be machined. The final size can be adjusted with the toolpath radius or an offset.

2

More controlled load

On large-diameter threads, the entire circumference of the tap does not take load at once. The tool load can be reduced by using radial passes.

3

Breakage risk management

Even if the tool breaks, in most cases it is easier to remove from the part than a tap. Bottom chip jamming in a blind hole is also more controlled.

Thread mill tool–thread configurations

Single-row / single-profile tool

The tool makes many helical turns along the length of the thread. The tool load is low and it is flexible on long threads; however, the cycle time is the longest.

Low loadLong cycleSuited to long threads

Multi-row – tool longer than the thread

If the cutting profile length covers the entire thread, the operation can be completed in a single 360° helical turn. It gives the shortest cycle time; but the cutting load is higher.

Single turnHigh efficiencyHigher load

Multi-row – tool shorter than the thread

A long thread is divided into several axial sections. The program and alignment are more complex; the tool reference must be set carefully so that no marks or minor profile mismatches occur between sections.

Sectioned machiningLong threadZ alignment critical
When selecting a tool: The tool profile angle, pitch spacing, effective cutting length, number of starts and whether the thread is internal or external must all be verified together. It is not enough that the tool diameter simply fits into the hole.

Climb or conventional milling?

Climb milling – general first choice

The chip thickness starts high at the cutting edge entry and decreases at the exit. A larger portion of the heat is carried away with the chip; tool wear and the tendency to re-cut chips are reduced. On rigid, backlash-free CNC machines it is the general first choice for thread milling.

  • Better surface quality
  • Longer tool life
  • Lower friction
  • Chips carried away from the cutting zone

Conventional milling – special cases

The chip thickness starts near zero and grows toward the exit. Friction and heat can increase. Even so, it may be preferred on old machines with poor backlash compensation, on some cast-iron skins or on parts with a hard surface.

  • Force-direction advantage in mechanical systems with backlash
  • Starting the cut from beneath the casting skin
  • Possibility of protecting the cutting edge under a hard surface
Warning: Conventional milling should not be selected by looking at the table alone. The machine backlash, tool overhang, clamping rigidity and material surface must be evaluated together.

Right–left thread, internal–external thread and G02/G03 direction

The table below is prepared assuming M03 clockwise spindle rotation and G17 in the XY plane. The same thread geometry can be produced with two opposite helix directions; the choice of climb or conventional changes G02/G03 together with the Z direction.

Thread typeThread directionMillingHelix commandZ travelStart
Internal threadRightClimbG03UpFrom below the thread
Internal threadRightConventionalG02DownFrom above the thread
Internal threadLeftClimbG02UpFrom below the thread
Internal threadLeftConventionalG03DownFrom above the thread
External threadRightClimbG02DownFrom above the thread
External threadRightConventionalG03UpFrom below the thread
External threadLeftClimbG03DownFrom above the thread
External threadLeftConventionalG02UpFrom below the thread
Verification is mandatory: Some CAM systems may use a different direction definition due to spindle direction, coordinate system, reversed tool mounting or machine kinematics. On the first part, the toolpath must be verified on the graphic screen; the program should be tried in the air, in single block and at low feed.

Why should the tool enter the material tangentially?

If the tool enters the cutting diameter with a straight, radial motion, the entire load can hit the cutting edge in a short time and a mark can form at the entry point. A tangential approach increases the load gradually and reduces the starting mark on the surface.

  1. Approach at rapid speed from the center or a safe outer point.
  2. Drop out of rapid at a safe distance as you approach the cutting diameter.
  3. Enter the toolpath tangentially with a slow arc motion.
  4. Start the approach feed at roughly 50% of the thread machining feed as a general rule.
  5. Use a tangential arc at the exit as well; the exit feed can be higher than the entry.
1. Safe approach 2. Tangential arc 3. Helical thread path
The approach arc must connect tangentially to the toolpath; this way the cutting load builds up gradually rather than suddenly.

Thread mill diameter and number of radial passes

Tool diameter on internal threads

  • A general starting ratio is for the tool diameter to be roughly 50–70% of the thread diameter.
  • A smaller tool can reduce profile error and chip jamming; but rigidity decreases.
  • The tool diameter should not be larger than about 85% of the pilot hole.

Tool diameter on external threads

  • A general starting ratio is for the tool diameter to be roughly 70–100% of the thread diameter.
  • A large tool can provide rigidity and productivity; but profile deviation and the collision area increase.
  • The shoulder, clamping and neighboring surface clearances must also be checked.

Practical starting table for radial passes

PitchApprox. TPISteel / stainless starting passesAluminum / brassTitanium / nickel alloy
up to 1.75 mmover 14.5 TPI1 pass1 pass2 passes
1.75–2.50 mm10–14.5 TPI2 passes1 pass3 passes
2.50–6.00 mm4–10 TPI3 passes1 pass4 passes
over 6.00 mmunder 4 TPI4 passes1–2 passes5 passes

The number of passes should be changed according to the material, profile depth, tool overhang, number of flutes, machine rigidity and the target surface quality. The table is only a starting suggestion.

Why is the program feed corrected in circular motion?

The actual diameter followed by the cutting edge and the diameter followed by the tool center are not the same. If the linear feed value is written directly into the G02/G03 line, the actual feed per tooth at the cutting edge differs from the target. For this reason the linear feed is calculated first, then converted into the center-path feed according to whether the thread is internal or external.

Linear milling feed

Vf = fz × z × n

fz: feed per tooth, z: number of cutting flutes, n: spindle speed.

Spindle speed

n = (1000 × Vc) / (π × Dc)

Vc: cutting speed, Dc: thread mill diameter.

Internal thread program feed

Fprogram = Vf × (Thread diameter − Tool diameter) / Thread diameter

Because the tool center path is at a smaller diameter, the program feed is lower than the linear feed.

External thread program feed

Fprogram = Vf × (Thread diameter + Tool diameter) / Thread diameter

The tool center travels on an orbit larger than the diameter machined by the cutting edge.

Example: If the internal thread diameter is 30 mm, the tool diameter is 12 mm and the linear feed is 600 mm/min, then the program feed is 600 × (30 − 12) / 30 = 360 mm/min.

Thread tolerance and program diameter adjustment

The nominal major and minor diameters define the basic profile of the thread. In practice, to leave clearance on an internal thread the machined major diameter is enlarged slightly; on an external thread the machined minor diameter is reduced slightly. The most accurate adjustment is made from the pitch diameter limits of the desired tolerance class.

Mean pitch diameter = (PDmin + PDmax) / 2
ΔPD = | PD0 − Mean pitch diameter |

Internal thread

Starting approach for the major diameter to be machined in the program:

Dprogram = Dmajor + ΔPD

External thread

Starting approach for the minor diameter to be machined in the program:

Dprogram = Dminor − ΔPD
Size adjustment: The final size must be checked with a gauge or a suitable measuring method; the diameter offset should be changed in small steps according to tool wear. The exact diameter correction should not be guessed without knowing the tolerance class.

Common problems in thread milling

The thread comes out small or tight

It may be tool wear, a wrong program diameter or an insufficient diameter offset. On an internal thread the tool center path is enlarged in a controlled way.

An entry mark forms

It may be a straight radial entry, a high approach feed or a short approach arc. Use a tangential arc and a lower entry feed.

The tool chatters

The tool diameter may be small and the overhang long. Increase the number of passes, shorten the overhang and, if possible, choose a more rigid tool.

A profile error forms

The tool diameter may be too large relative to the thread diameter. A smaller-diameter tool can improve profile accuracy.

The surface comes out poor

Conventional milling, chip re-cutting, wrong feed compensation or insufficient cooling should be checked.

A sectioned tool mark remains

On a multi-row short tool, the axial shift, the effective cutting length and the start of the next section may not match each other.

CNC thread milling calculator and general G-code tool

The tool below generates tool diameter checking, speed, linear feed, circular program feed, tool center path, radial passes, helix direction, approximate time and a general Fanuc-type program template.

Common metric, UNC, UNF and BSW sizes. Choose "Custom" for a custom size.
The major diameter is machined on internal threads, the minor diameter on external threads.
Changes the G02/G03 and Z direction of the helical motion.
Climb is the general first choice on rigid CNC machines.
mm
For example 20 mm for M20.
mm
The axial distance between one thread and the next.
Z travel in one turn = pitch × number of starts.
mm
The usable thread length to be machined.
Affects the number of helix turns or axial sections.
mm
The cutting diameter of the tool.
mm
The effective axial length of the cutting profile on a multi-row tool.
Used in the linear feed calculation.
Provides a general starting value for Vc, fz and passes.
m/min
If you have a tool catalog value, enter it.
mm/tooth
If you have a tool catalog value, enter it.
Suggested according to material and pitch.
mm
Pilot hole on internal threads; unmachined stock diameter on external threads.
mm
Added to the program diameter on internal threads; subtracted on external threads.
%
General starting value of 50% for tangential entry.
rpm
The calculated speed is limited by this value.
Advanced program settings
mm
mm
mm
The top of the part is usually taken as Z0.
mm
mm/min
Used for the time estimate.
Machine speed—
Program feed—
Tool center path—
Helix direction—
Linear feed Vf—
Lead / Z per turn—
Radial passes—
Estimated cutting time—
Tool / thread ratio—
Total radial depth—
Helix turns / section—
Entry feed—

Toolpath simulation

General CNC program template

The general program will be generated here after calculation.

This program is a general template for training and preliminary preparation. Tool length compensation, workpiece zero, Z sign direction, tool call, cutting fluid, full-circle assumption, G02/G03 behavior and machine kinematics may vary depending on the control unit. Before using it on a real machine, verify the program on the graphic screen, in the air, in single block and at low feed.

Frequently asked questions about CNC thread milling

Why is the thread milling feed different from a normal milling feed?
The tool center and the cutting edge move at different diameters. For this reason the linear Vf value must be converted into the circular program feed according to the internal or external thread diameter.
What should the tool diameter be on an internal thread?
The general starting approach is for the tool diameter to be roughly 50–70% of the thread diameter. In addition, the tool diameter should not exceed about 85% of the pilot hole.
In which direction is climb milling done on a right-hand internal thread?
Assuming M03 spindle rotation and a standard XY plane, climb milling on a right-hand internal thread is usually done with G03 from below the thread upward.
What is the difference between a single-row and a multi-row thread mill?
A single-row tool makes many turns along the length of the thread and works at a low load. If a multi-row tool's effective length covers the thread, it can provide a shorter cycle time in a single helical turn.
How many radial passes should be used?
It depends on the pitch, material, tool overhang and rigidity. A single pass may be enough on fine-pitch steel, while more than one pass may be needed on a large pitch or a difficult material such as titanium.