G-Codes

Full List Of G Codes For Milling And Turning

* Press the G-Code to read the full explanation

Code What it Does Milling Turning
Rapid positioning
Linear interpolation
Circular interpolation, clockwise
Circular interpolation, counterclockwise
Dwell
High-precision contour control (HPCC)
AI Advanced Preview Control
Non-uniform rational B-spline (NURBS) Machining
Imaginary axis designation
Exact stop check, non-modal
Programmable data input
G11 Data write cancel
XY plane selection
ZX plane selection
YZ plane selection
Programming in inches
Programming in millimeters (mm)
Return to home position (machine zero, aka machine reference point)
Return to secondary home position (machine zero, aka machine reference point)
Feed until skip function
Single-point threading, longhand style (if not using a cycle, e.g., G76)
G33 Constant-pitch threading
Single-point threading, longhand style (if not using a cycle, e.g., G76)
G34 Variable-pitch threading
Tool radius compensation off
Tool radius compensation left
Tool radius compensation right
Tool height offset compensation negative
Tool height offset compensation positive
G45 Axis offset single increase
G46 Axis offset single decrease
G47 Axis offset double increase
G48 Axis offset double decrease
Tool length offset compensation cancel
Define the maximum spindle speed
Scaling function cancel
Position register (programming of vector from part zero to tooltips)
Local coordinate system (LCS)
Machine coordinate system
Work coordinate systems (WCSs)
Extended work coordinate systems
Exact stop check, modal
G62 Automatic corner override
Default cutting mode (cancel exact stop check mode)
Rotate coordinate system
Turn off coordinate system rotation
Fixed cycle, multiple repetitive cycle, for finishing (including contours)
Fixed cycle, multiple repetitive cycle, for roughing (Z-axis emphasis)
Fixed cycle, multiple repetitive cycle, for roughing (X-axis emphasis)
Fixed cycle, multiple repetitive cycle, for roughing, with pattern repetition
Peck drilling cycle for milling – high-speed (NO full retraction from pecks)
G74 Peck drilling cycle for turning
G74 Tapping cycle for milling, lefthand thread, M04 spindle direction
G75 Peck grooving cycle for turning
Fine boring cycle for milling
G76 Threading cycle for turning, multiple repetitive cycle
Cancel canned cycle
Simple drilling cycle
Drilling cycle with dwell
Peck drilling cycle (full retraction from pecks)
Peck drilling cycle (full retraction from pecks)
Tapping cycle, righthand thread, M03 spindle direction, rigid toolholder
Tapping cycle, lefthand thread, M04 spindle direction, rigid toolholder
boring cycle, feed in/feed out
boring cycle, feed in/spindle stop/rapid out
boring cycle, backboring
G88 boring cycle, feed in/spindle stop/manual operation
boring cycle, feed in/dwell/feed out
Absolute programming
Fixed cycle, simple cycle, for roughing (Z-axis emphasis)
Absolute arc programming
Incremental programming
Incremental arc programming
Position register (programming of vector from part zero to tool tip)
Threading cycle, simple cycle
Feedrate per minute
Fixed cycle, simple cycle, for roughing (X-axis emphasis)
Feedrate per revolution
Constant surface speed (CSS)
Constant spindle speed
Return to initial Z level in canned cycle
Feedrate per minute (group type A)
Return to R level in canned cycle
Feedrate per revolution (group type A)
Tool length measurement

What Is G-Code?

G-codes and CNC (Computerized Numerical Control) are two different types of programming that machines use to create a shape. In its most simplistic terms, G-codes are sets of instructions that program a machine to create a shape but require a true beginning and endpoint to work correctly. On the other hand, CNC codes are created by a computer to create different shapes without much precision.

The G-codes are commands that provide a range of motion and control functions, depending on the tool being used and the system running it. The G-codes also identify what tool is being used, along with the axis of rotation, travel limits, and electrical system voltages.

G-Code Syntax

Sample short program
N10   O1000;
N20   T05;
N30   G01   A10   X40   Z60   F1.0   S1000;
N40   M05;
LETTER ROLE
X,Y,Z,A,B,C Coordinates for Movement
F Feedrate - At what speed to move to the next coordinate.
S Spindle Speed - At speed the spindle should be rotating.
I,J,K Arc center for G02/G03
O Program Number
N Line (Block) Number
M Miscellaneous function - See separate List
T Select a tool from Magazine / Turret
P Parameter Number