AiVibe

CNC & Precision Machining

G-code

G-code is the common name for the word-address programming language used by most CNC machines. Each block combines letter addresses and numbers that set motion type, coordinates, feed, spindle speed and tool.

A G-code program is a sequence of blocks, each made of words such as G01, X25.0 or F300. Preparatory G words set the type of motion and the operating mode, for example G00 for rapid positioning, G01 for straight-line feed, G02 and G03 for clockwise and anticlockwise arcs, G17 to G19 for plane selection and G90 or G91 for absolute or incremental coordinates. Other addresses carry axis positions, feed rate (F), spindle speed (S), tool number (T) and miscellaneous machine functions (M). Many codes are modal, so they stay active until another code in the same group replaces them.

G-code is used on milling machines, lathes, routers, grinders and many other CNC machines. Most production programs are generated by CAM software through a post-processor, while short programs, edits and probing routines are often written by hand at the control.

The language was standardised as EIA RS-274-D and ISO 6983-1, but every control family implements its own dialect, so a program written for one control may behave differently on another. Programs should be verified by simulation and a careful prove-out before production. Richer, feature-based alternatives such as STEP-NC (ISO 14649) exist but are far less widely deployed.

Key points

Where AiVibe comes in

AiVibe designs and manufactures the AiAmbA AI Factory: edge devices plus AI agents that let people talk to CNC, PLC and robot controllers in plain language. Agents only propose changes, and a trained operator confirms each one.

Explore AiVibe’s work in CNC & Precision Machining →

Related terms

Terms that refer to G-code

Ask AiMuruga can explain G-code for your plant, product or security programme, and draw how it fits.