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
| Code | Function |
|---|---|
| G00 | Rapid positioning (non-cutting move) |
| G01 | Linear interpolation (cutting move) |
| G02 | Circular interpolation (clockwise) |
| G03 | Circular interpolation (counter-clockwise) |
| G28 | Return to home position |
| G40 | Cancel cutter compensation |
| G41/G42 | Cutter compensation left/right |
| G43 | Tool length compensation |
| G54-G59 | Work coordinate systems |
| G90 | Absolute positioning |
| G91 | Incremental 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