Full list of G codes for Milling and Turning

* Press the G-Code to read the full explanation

What is Gcode?

G-code is the common name for the most widely used CNC programming language. It was developed in the 1950s at MIT. The language is very “primitive” in today’s standards. All the commands represented by codes (G01, G02, etc..) and not by meaningful words. Variables are represented by numbers(#500, #151, etc..) and not by words and conditional logic is very limited. Amazingly this 70 years old language is still the industry standard. Several tool manufacturers developed higher-end Wizard-like languages such as Mazak – Mazatrol or Okuma – AOT, but none of them gained very high popularity.

The target of the code is to control the movements of a computerized controlled machine. The code basically “tells” the machine in what path to move from one coordinate to the next (Called “Toolpath”), and at what speed (Called “Feedrate”).

Gcode syntax

Sample short program

N10 O1000;
N20 T05;
N30 G01 A10 X40 Z60 F1.0 S1000;
N40 M05;

What does each letter in the program mean?

M Codes

“G” stands for Geometry and hence the G-Code commands are responsible for the movements of the machine that create the geometry of the part. “M” stands for Machine (or Miscellaneous) and the M-Codes are responsible for Machine commands that cause particular operations of the equipment. Unlike G-codes, that can appear multiple times on same line, M-Code are limited to one code per line.

List of M-codes

* Press ⊕ to read the full explanation

Newsletter Signup

📢 Be the first to learn about new features on the website

We don't spam! A monthly email with real value!

Scroll to Top