G-Code

The most widely used programming language for CNC machines. G-code commands control machine movements, spindle operations, coolant, and other functions through standardized alphanumeric codes.

G-code (also written as G code or Gcode) is the standard language that CNC machines understand. Each line of G-code is an instruction telling the machine what to do.

Common G-Code Commands

CodeFunction
G00Rapid positioning (non-cutting move)
G01Linear interpolation (cutting move)
G02Circular interpolation (clockwise)
G03Circular interpolation (counter-clockwise)
G28Return to home position
G40Cancel cutter compensation
G41/G42Cutter compensation left/right
G43Tool length compensation
G54-G59Work coordinate systems
G90Absolute positioning
G91Incremental positioning

AI and G-Code

AI is increasingly being used to optimize G-code programs by analyzing toolpaths, reducing unnecessary movements, and adjusting cutting parameters for better efficiency. Learn more in our article on how AI is transforming CNC programming.

Related Terms

M-CodeCNC ControllerToolpathPost Processor