Printed from Kezuriba (kezuriba.net/en/nc/g43/)
G43
Machining centerModal, group 08Tool length compensation + (adds the offset)
Format and notes
G43 Z_ H_ (in the same block as G00/G01)
- H is the tool length offset number. Matching it to the tool number is common, but it can be different
- Command it together with the Z move, and activate it well above the workpiece
- A mistyped H number leads straight to a crash. Always check the G43 H block right after a tool change
- Tool center point control (G43.4) keeps the tool tip on the path even when the rotary axes move in 5-axis machining
Diagram: Tool length compensation: spindle gauge line and H
Full guide with examples: 5-axis tool center point control (G43.4 etc., G43 extended to rotary axes)
- Three ways to enter tool length, and where the tool goes when it is wrong (simulator)
- G43.4: tool center point control (5-axis)
Try it in the simulator (machining center)
After a tool change, apply tool length offset with G43 H_ before lowering Z. Delete the G43 line and run to see the warning.
Simulator with exercises: Machining center page
On lathes: (Not used on typical FANUC-type lathes. The tool offset is selected by the last 2 digits of the T code)
- On lathes, the tool number and offset number are specified together with a 4-digit T code such as T0101 (6 digits on some machines) (Mitsubishi lathe material, MHLW material)
- Haas lathes have G43 (group 08), but offsets are normally applied with the T code
Differences between controls and machines
The same code can be written or assigned differently depending on the CNC control and the machine builder. Always check your machine’s manual.
“One source / reference” rows were confirmed in only one source. “CAM post output / reference” rows show what a CAM post processor outputs and could not be confirmed in the control maker’s own public documents.
| Source | Machine | Item | Detail |
|---|---|---|---|
| Haas | Machining center | Notes | On NGC software 100.21.000.1100 and later, tool length compensation is always activeOn newer Haas software, compensation stays active unless G49/H00 is explicitly commanded, and it is updated automatically at tool change |
| CAM post for Okuma (Autodesk) | Machining center | Code | Okuma OSP uses G56 H_ and cancels with G53CAM post output / referenceOn FANUC-type controls, G56 is work coordinate system 3 and G53 is positioning in the machine coordinate system, which are entirely different meanings |
Frequently asked questions about G43
- What is G43 (Tool length compensation + (adds the offset)) used for and how is it formatted in a CNC program?
- G43 commands "Tool length compensation + (adds the offset)" on Machining center. The standard program format is "G43 Z_ H_ (in the same block as G00/G01)". H is the tool length offset number. Matching it to the tool number is common, but it can be different
- Is G43 a modal code or a one-shot (non-modal) code?
- G43 is a modal code (Group 08). Once commanded, it remains active across subsequent blocks until another code from the same modal group overrides it or the control is reset. Always state or cancel modal states explicitly in your safety block and at the end of a tool operation so residual modes do not cause unexpected motion when restarting mid-program.
- Does G43 work differently on machining centers (mills) versus CNC lathes?
- G43 is primarily used on Machining center. Depending on the machine type and the lathe G-code system (System A, B, or C), this code may be unavailable or assigned to a different function, so verify against your machine tool manual.
- Are there differences in G43 across FANUC, Mitsubishi, Okuma, Haas, and Siemens controls?
- Yes. Control builders such as FANUC, Mitsubishi Electric (M80/M800), Okuma (OSP), Haas, Mazak, Siemens (SINUMERIK ISO dialect), and Heidenhain can differ in argument letters, decimal-point rules, and optional parameters for G43. Review the control comparison table above and verify the exact syntax in your machine’s programming manual before proving out the program.
Sources
The meaning of this code agrees in two or more sources from different publishers. Explanations are written in our own words.
- Mitsubishi Electric — The Basics of CNC Machining Programming (for Machining center) e-Learning material (PDF) mitsubishielectric.com
- Siemens AG — SINUMERIK 802D sl/840D/840D sl/840Di/840Di sl/810D Programming Manual ISO Milling, 04.2007 Edition (6FC5398-7BP10-0BA0) cache.industry.siemens.com
- Haas Automation, Inc. — G-code, M-code, and Setting (per-code explanation pages) haascnc.com
- Haas Automation, Inc. — Mill Operator's Manual – 17 Mill G-Codes (online version) haascnc.com
- National Institute of Standards and Technology (NIST), USA — The NIST RS274NGC Interpreter – Version 3 (NISTIR 6556, 2000) nvlpubs.nist.gov
- Saitama University, Faculty of Engineering, Department of Mechanical Engineering, practical training — Machining center program 2019 (training NC program O19-0101, with comments) jisshu.mech.saitama-u.ac.jp
- Autodesk — OKUMA milling post processor (okuma.cps, Fusion post library) cam.autodesk.com
- Mitsubishi Electric — The Basics of CNC Machining Programming (for Lathe) e-Learning material (PDF, BNP-C8027-688) mitsubishielectric.com
- Ministry of Health, Labour and Welfare (MHLW), Human Resources Development Bureau, Office of the Councillor for Skills Evaluation — Human resource development manual using the practical exam tasks of the Grade 3 Skilled Worker Test: CNC lathe work (March 2018) waza.mhlw.go.jp
- Haas Automation, Inc. — Lathe Operator's Manual – 16 Lathe G-Codes (online version) haascnc.com