Skip to main content
Independent machine intelligence · Research before the decision
THE MACHINEBLUE BOOKFree machine reference
◧ The Machine Blue BookTechnologyReference LibraryMachine DirectoryGlossaryShowroomControlsManualsContactMain site ↗
Reference › Glossary › G-Code
Definition

G-Code

In plain terms: G-code is the list of written commands a CNC machine follows, line by line, telling it where to move, how fast, and when to change tools or turn the coolant on.

Why it matters on the floor: Programs are usually made in CAM software and edited at the machine, and the details differ between control brands, so a program written for one machine may need changes for another.

What is G-Code?

G-code is the standard programming language that tells a CNC machine what to do — where to move, how fast, when to turn the spindle or coolant on, and which tool to use. Each line is a command; 'G' words control motion (like G00 rapid, G01 feed, G02/G03 arcs) and 'M' words control machine functions (M03 spindle on, M06 tool change). It's usually generated by CAM software from a 3D model, then edited at the machine.

Every CNC control reads a dialect of G-code, though details vary between Fanuc, Haas, Siemens and others. Conversational programming is an easier, menu-driven alternative that generates G-code behind the scenes. See conversational and CNC control.

Also known as

gcodeG codeNC code

Related terms

Conversational Programming
Programming
CNC Control
Controls
CAM
Computer-Aided Manufacturing
Canned Cycle
Programming