← NCTune CNC Toolbox

Free CNC generator

Thread Milling G-code Generator

Calculate the cutter-centre path, corrected feed and helical interpolation code for a cylindrical internal thread.

Right- and left-hand threadsFanuc / Haas and Sinumerik ISOG2 / G3 and feed correctionNo data upload

Process and geometry

How does thread milling work?

The cutter follows a helix. One complete revolution changes Z by exactly one pitch, while the cutter-centre path is smaller than the thread diameter by the effective cutter diameter.

Helical motion

The generator separates axial length into complete revolutions and an optional final fraction. It never rounds turn count, so non-multiple lengths remain correct.

Cutter-centre path

For an internal thread, final path diameter equals nominal diameter minus effective cutter diameter plus diametral correction.

Effective diameter

Use the cutting diameter at the part of the tool that generates the thread form. Verify the value in the manufacturer's data.

Feed correction

Why is cutter-centre feed corrected?

On an internal arc, the cutter centre travels a shorter distance than its cutting edge. When edge feed is entered, centre feed is calculated as: Fcentre = Fedge × Dpath ÷ (Dpath + Dcutter).

Right- and left-hand threads

In G17, a right-hand thread cut bottom-up uses G3 and top-down uses G2. The relationship is reversed for a left-hand thread.

Diameter correction

After measuring the thread, adjust the diametral correction without changing nominal size or cutter diameter. A +0.10 correction increases path diameter by 0.10.

Explicit assumptions

The generator assumes G17, positive tool-axis Z, a right-handed coordinate system, M3 and an internal thread. It does not select tooling or cutting data.

FAQ

Frequently asked questions

Does the generator select a thread mill?

No. Enter the effective cutting diameter and verify it in the tool manufacturer's documentation.

Is the pre-hole diameter selected automatically?

No. A preset changes only nominal diameter and pitch. D − P is merely an indicative starting value.

Why is programmed feed lower than entered feed?

The cutter centre follows a shorter internal path than the cutting edge. Feed is corrected independently for each radial pass.

Can the generator create a left-hand thread?

Yes. Thread hand automatically selects the corresponding G2 or G3 direction.

Can I mill from top to bottom?

Yes. Both axial directions are supported and change both Z direction and interpolation command.

Does the generator support multiple passes?

Yes. Pass diameters are distributed from the no-contact path to the final path, with optional repeats at final diameter.

Can the code run directly on a machine?

Not without review. Verify datum, thread hand, control syntax, offsets and tool data, then simulate and test above the part.

Is any data sent to a server?

No. Calculations run locally. The configuration link does not store the program comment.

Why does the generator not use G41/G42?

It calculates the cutter-centre path directly, reducing dependence on control-specific compensation activation and behaviour.

Are external threads supported?

No. This version supports cylindrical internal threads only, without tapered or multi-start threads.

Related tools

Prepare the remaining CNC calculations

PCD generator

Hole coordinates on a bolt circle and example NC code.

Open generator

Tapping calculator

Synchronized feed, pitch, TPI and approximate tap-drill size.

Open calculator

Chamfer calculator

Edge chamfers, countersinks and chamfer-mill plunge geometry.

Open calculator

Custom solutions

Need a thread-milling cycle, macro or postprocessor tailored to a specific machine?

NCTune develops postprocessors, automation and dedicated generators for Siemens NX CAM and CNC controls.

Discuss your project