---
title: "Lathe Threading Pullout Codes M23 and M24, Demystified"
description: "M23 and M24 commonly toggle the chamfered thread pullout on Fanuc-family lathes: the angled exit at the end of each pass. What it does, and the caveats."
url: https://gcodepractice.com/journal/lathe-threading-pullout-codes-m23-m24/
canonical: https://gcodepractice.com/journal/lathe-threading-pullout-codes-m23-m24/
author: "Lawrence Arya"
authorUrl: https://www.linkedin.com/in/vibecoding/
published: 2026-06-07
updated: 2026-06-07
category: "Practice"
tags: ["m23", "m24", "threading", "lathe"]
lang: en
---

# Lathe Threading Pullout Codes M23 and M24, Demystified

> **TL;DR** On many Fanuc-family lathes, M23 and M24 toggle the threading pullout chamfer: with pullout on, each threading pass exits the thread on a gradual angle over roughly the final pitch or so, easing tool load and leaving a clean run-out; with it off, the pass stops abruptly, which is what you need threading up to a shoulder where there is no room for a chamfered exit. The assignment is builder-dependent enough to verify in your machine's manual, the cycle-parameter alternative (the chamfer amount in G76) interacts with it, and the choice is geometry-driven: open run-out favors pullout on, shoulders demand it off plus an undercut.

Every threading pass has to end somehow, and the two options are a small mechanical drama: ease out of the cut on a gradual angle, unloading the insert over the final pitch, or stop abruptly with the tool still buried at full depth. M23 and M24 are the codes that commonly toggle that choice on Fanuc-family lathes, pullout chamfer on, pullout chamfer off, and like most lathe M-codes in this range, they come with a caveat worth stating before the explanation: assignments vary by builder, and your machine's manual is the verification step.

## What the pullout chamfer physically does

With pullout on, the control blends the end of each threading pass into an angled retreat: over roughly the final pitch or so of travel, X retracts while Z completes, so the thread shallows gradually into a tapered run-out instead of ending at a wall. The insert exits the cut unloading progressively, the [thread's](https://en.wikipedia.org/wiki/Threading_(manufacturing)) end looks intentional, and the tool sees none of the shock of stopping mid-bite. With pullout off, the pass runs to its endpoint at full depth and lifts out, abrupt by design, because some geometry demands it.

| The situation | The setting | Why |
| --- | --- | --- |
| Thread runs out at a shaft end or into open space | Pullout on | Gentler exit, cleaner run-out, longer insert life |
| Thread runs up to a shoulder | Pullout off | An angled exit would need room the shoulder denies |
| Shoulder thread, properly designed | Pullout off, plus an undercut groove | The groove gives the thread a defined end |
| Unknown machine, inherited program | Verify before trusting | The M-number assignment is builder territory |

## The shoulder problem, which decides everything

The geometry rule is the whole decision: a chamfered exit consumes axial room, roughly a pitch of thread that fades to nothing, and threading to a shoulder offers no such room, the full thread has to persist as close to the face as the design needs. So shoulder threads run pullout-off, and the abrupt-stop consequences move to the print: the standard solution is an undercut, a relief groove at the thread's end, [grooving-tool territory](/journal/lathe-boring-bar-crashed-into-back-of-part-g-code/), that gives both the threading insert and the mating part a defined place to finish. A torn-looking thread end or inserts chipping at end-of-pass on shoulder work is this physics complaining, and the fix is in the design as often as the code.

## Two controls of the same behavior

The M-code pair is one of two handles: Fanuc-style cycles also carry the chamfer inside the cycle, the conventional r-style chamfer amount in [G76](https://www.helmancnc.com/fanuc-g76-thread-cycle-for-dummies/), expressed in multiples of the lead, set in the cycle line or by parameter. Toggle and parameter address the same exit behavior from two directions, and how they interact, which wins, whether the M-codes even exist, is control- and builder-specific in the way [this whole M-number neighborhood is](/journal/star-sliding-head-lathe-m-codes-list/). The professional method costs one scrap pass: command the configuration you intend, thread a test diameter, and read the run-out, a gradual taper says pullout is live, a wall says it is not, then document what your machine actually does next to the [rest of its dialect](/journal/lnc-controller-g-code-list/).

Dialect breadth, for completeness: the open-source world expresses threading exits through cycle parameters rather than M-codes, [LinuxCNC's G76](https://linuxcnc.org/docs/html/gcode/g-code.html) includes a taper entry/exit argument, which is the same physics wearing parameter syntax.

## Where this sits in the threading skill

Pullout is a finishing touch on the fundamentals: it matters only after the [synchronization that makes threading work at all](/journal/how-to-fix-a-cross-threaded-part-g-code/) and the [locked-RPM discipline](/journal/spindle-speed-calculation-for-g97-lathe/) are in place, the same mode-arming family that puts [M29 ahead of every rigid-tap cycle](/journal/m29-rigid-tap-fanuc-setup-code/), and it rewards the same habit as the rest of the lathe's mode codes, knowing the pair's existence and question on sight, then verifying the specifics per machine. That sight-recognition layer is what the free 60-second drills on the [G-code practice page](/g-code-practice/) build across the M-code families: not every builder's assignments, which no app could honestly promise, but the reflex that sees a threading cycle and asks how its passes end, which is the question this entire page exists to install.

## Sources

- [Helman CNC: Fanuc G76 threading cycle](https://www.helmancnc.com/fanuc-g76-thread-cycle-for-dummies/)
- [Wikipedia: Threading (manufacturing)](https://en.wikipedia.org/wiki/Threading_(manufacturing))
- [LinuxCNC: G-code reference](https://linuxcnc.org/docs/html/gcode/g-code.html)

## Frequently asked questions

### What do M23 and M24 do on a CNC lathe?

On many Fanuc-family lathes they toggle the threading pullout chamfer: pullout-on gives each pass a gradual angled exit over roughly the final pitch, pullout-off ends passes abruptly for shoulder threads. Assignments are builder-dependent; verify in the machine's manual.

### When should thread pullout be on versus off?

Geometry decides: open run-out favors pullout on, gentler on the insert with a clean tapered run-out. Shoulder threads demand it off, with an undercut groove giving the thread a defined end.

### How does the pullout setting interact with the G76 chamfer parameter?

They address the same exit behavior from two directions, and which governs is control-specific. Test with a scrap pass, read the run-out, and document what your machine actually does.

### Why does my thread look torn or the insert chip at the end of passes?

An abrupt exit under full load is the classic cause. Enable pullout or the cycle chamfer where geometry allows; where a shoulder forbids it, the print-level fix is the undercut groove.

---

Source: https://gcodepractice.com/journal/lathe-threading-pullout-codes-m23-m24/
Author: Lawrence Arya — https://www.linkedin.com/in/vibecoding/
