G-code reference
G42 G-Code: Cutter Radius Compensation Right
Cutter Radius Compensation Right — Offsets the tool path to the right of the contour by the D value. With a right-hand cutter, G42 on an outside contour gives conventional milling.
| Property | Value |
|---|---|
| Code | G42 |
| Function | Cutter Radius Compensation Right |
| Modal group | 07 |
| Type | Modal — stays active until replaced by another code of the same group |
| Used on | Mills and lathes |
| Syntax | G42 D_ G01 X_ Y_ |
What does G42 do?
Offsets the tool path to the right of the contour by the D value. With a right-hand cutter, G42 on an outside contour gives conventional milling.
G42 is modal: once programmed it remains in effect for the following blocks until another code from modal group 07 replaces it or the control is reset.
Syntax and parameters
G42 D_ G01 X_ Y_| Address | Meaning |
|---|---|
D | Offset register |
G42 example program
G42 D01 G01 X0 Y5.0 F600.▶ Open this example in the G-code viewer
Tips and common mistakes
- On a lathe turning an OD with the turret behind the spindle, G42 is the usual choice.
Controller compatibility
G42 follows the ISO/Fanuc dialect used by Fanuc, Haas, Brother, Doosan, Hurco (ISO mode), Mazak (EIA/ISO mode), Okuma (G-code mode) and Siemens in ISO dialect mode. Parameters, option packages and builder-specific behaviour can differ, so confirm the details in your machine's programming manual before running a new program.