G43

Machining centerModal, group 08

Tool length compensation + (adds the offset)

Format and notes

G43 Z_ H_ (in the same block as G00/G01)

Diagram: Tool length compensation: spindle gauge line and H

SpindleSpindle gauge line (spindle nose)HTool length offsetWorkpiece (top is Z0)Z10.With G43 Z10. H01,tool tip, H belowthe gauge line,arrives at Z10.
G43 Z_ H_ moves with the length H from the spindle gauge line to the tool tip added, so the tool tip arrives at the commanded Z (example of the common setup that measures tool length from the gauge line). A mistyped H number leads directly to a crash.

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.

    X—
    Y—
    Z—
    T—
    S0
    F0
    —0:00

      On lathes: (Not used on typical FANUC-type lathes. The tool offset is selected by the last 2 digits of 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.

      SourceMachineItemDetail
      HaasMachining centerNotesOn 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 centerCodeOkuma 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.

      1. Mitsubishi Electric — The Basics of CNC Machining Programming (for Machining center) e-Learning material (PDF) mitsubishielectric.com
      2. 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
      3. Haas Automation, Inc. — G-code, M-code, and Setting (per-code explanation pages) haascnc.com
      4. Haas Automation, Inc. — Mill Operator's Manual – 17 Mill G-Codes (online version) haascnc.com
      5. National Institute of Standards and Technology (NIST), USA — The NIST RS274NGC Interpreter – Version 3 (NISTIR 6556, 2000) nvlpubs.nist.gov
      6. 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
      7. Autodesk — OKUMA milling post processor (okuma.cps, Fusion post library) cam.autodesk.com
      8. Mitsubishi Electric — The Basics of CNC Machining Programming (for Lathe) e-Learning material (PDF, BNP-C8027-688) mitsubishielectric.com
      9. 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
      10. Haas Automation, Inc. — Lathe Operator's Manual – 16 Lathe G-Codes (online version) haascnc.com