Home > Publications >

Main list of G-code


G-code is a CNC programming language. It is a set of consecutive commands that instruct the machine where and how to move.

Rapid positioning

Sample text G-code

A program written using G-code consists of frames, each frame contains a set of control commands. Below is a complete list of basic commands.

Summary table of codes:

Codes Description
G00-G04 Tool positioning
G17-G19 Work plane switching (XY, XZ, YZ)
G20-G21 Not standardized
G40-G44 Compensation of the size of the various parts of the instrument (length, diameter)
G53-G59 Switching coordinate systems
G80-G84 Drilling and threading cycles
G90-G92 Coordinate system switching (absolute, relative)

Table of main commands:

Codes Description
G00 Rapid positioning
G01 Linear interpolation
G02 Circular interpolation, clockwise
G03 Circular interpolation, counterclockwise
G04 Dwell, Exact stop
G05 High Speed Machining Mode
G10 Programmable data input
G11 Data write cancel
G17 XY plane selection
G18 ZX plane selection
G19 YZ plane selection
G20 Programming in inches
G21 Programming in millimeters (mm)
G28 Return to home position (machine zero, aka machine reference point)
G30 Return to secondary home position (machine zero, aka machine reference point)
G40 Tool Radius Compensation Cancel
G41 Tool Radius Compensation Left
G42 Tool radius compensation right
G43 Tool height offset compensation negative
G44 Tool height offset compensation positive
G49 Tool length compensation cancel
G50 Define the maximum spindle speed
G50 Scaling function cancel
G50 Position register
G52 Local coordinate system setting
G53 Positioning in machine coordinate
G54—G59 Work Coordinate Registers 1 Thru 6
G61 Exact Stop Check Mode
G62 Automatic corner override
G65 Macro call
G66 Macro modal call
G67 Macro modal call cancel
G68 Programmed Coordinate Rotation
G69 Coordinate Rotation Cancel
G70 Longitudinal finishing cycle
G71 Multipass longitudinal rough turning cycle
G73 Fixed Cycle (Step)
G74 Fixed Cycle (Reverse Tapping)
G75 Peck grooving cycle for turning
G76 Fixed Cycle (Fine Boring)
G80 Canned cycle cancel
G81 Drilling cycle, spot boring
G82 Drilling cycle, counter boring
G83 Peck drilling cycle
G84 Tapping cycle
G84.2 Rigid tapping cycle
G85 Boring cycle
G86 Boring cycle
G87 Back boring cycle
G88 Boring cycle
G89 Boring cycle
G90 Select absolute command
G91 Select incremental command
G92 Programming of absolute zero point
G93 Inverse time feed
G94 EPer minute feed
G95 Per revolution feed
G96 Constant surface speed control
G97 Constant surface speed control cancel
G98* Return to initial point in canned cycle
G99 Return to R point in canned cycle

Subscribe to our news
and regular updates