Glossary Updates12 new terms added to the glossaries · October 2, 2026, 22:44 CEST
AI TechDocKnowledge

Glossary · CNC and machine tools

G-code

Also known as: Preparatory function, G word

German: G-Code

In CNC programming, a G-code is a preparatory function, written with the address letter G and a number, that tells the control how to perform the following movement or which mode to use, for example linear interpolation (G01) or circular interpolation (G02, G03).

  • CNC
  • Standards

In one sentence

A G-code is a preparatory function in a CNC program, such as G01 for linear interpolation, that sets how the control executes movements.

Example

G00 X0 Y0 moves the tool at rapid traverse to the zero point; the next block G01 Z-5 F100 starts a linear cut at 100 mm/min.

How it applies

  • Programming: ISO 6983-1 (and DIN 66025 in Germany) standardizes the basic format and many G-codes, but controls from different vendors extend and interpret them differently. A program written for one control is not automatically correct on another.
  • CAM: Postprocessors in Computer-aided manufacturing (CAM) systems translate tool paths into the G-code dialect of a specific machine and control.
  • Documentation: A G-code reference in machine documentation should list the codes actually supported by that machine, mark which are Modal commands and name the control and software version. Don't copy a generic G-code table without checking it against the control vendor's programming manual.

G-code vs. M-code

G-codes prepare and define movements and modes. M-codes are miscellaneous functions that switch machine functions such as spindle, coolant or tool change. In everyday speech, 'G-code' is also used for a complete NC program.

By knowledge.aitechdoc.world · Published September 26, 2026 · Last reviewed

Source: ISO 6983-1:2009, Automation systems and integration — Numerical control of machines — Program format and definitions of address words — Part 1: Data format for positioning, line motion and contouring control systems

Definitions follow the cited standards and specifications. Where a source is a copyrighted publication, such as an ISO, IEC or EN standard, the definition is a close paraphrase, not a verbatim quotation, so as not to infringe copyright. We recommend reading the original publication. The sections “How it applies” are editorial commentary by AI TechDoc Knowledge and are not part of any standard.

Seen a mistake? Send us a note!