G-Code Reference

G-Code Reference

This is a section of some of the more common g-codes and their format and meaning.u00a0 Note that not all codes are supported by all machines, so please check to see if your machine supports a code before trying to use it.u00a0 This is by no means an exhaustive list, there are many more g-codes in use and some proprietary ones as well.

Summary of GCODE Commands By Category

Set Up Commands

u00a0CODE u00a0u00a0 COMMANDu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 FORMATu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0PURPOSE

F u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0 Feed Speed u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0 Fnu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0Designates feed rate, or rateu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 of movement, of the axes.

G4 u00a0u00a0u00a0u00a0u00a0u00a0 Dwell Time u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0 G4/du00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 Specifies a programmed delayu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0during a drill cycle.

G90u00a0u00a0u00a0u00a0u00a0 Absolute Coordinates u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0 G90u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 Indicates that absolute motionu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 will be used to performu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 subsequent motion commands.

G91u00a0u00a0u00a0u00a0u00a0 Incremental Coordinates u00a0u00a0u00a0u00a0u00a0 G91u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0Indicates that incrementalu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0motion will be used to performu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0subsequent motion commands.

G92u00a0u00a0u00a0u00a0u00a0 Set Absolute Positionu00a0 u00a0 u00a0 u00a0 u00a0 u00a0u00a0G92XxYyZzu00a0 u00a0 u00a0 u00a0Sets new absolute coordinatesu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0for the current position.

M0 u00a0u00a0u00a0u00a0u00a0 Program Pauseu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0u00a0M0u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 Pauses the .NC file run.

M30 u00a0u00a0u00a0 End Of Data u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0M30u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 Designates the end of a block ofu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0commands in a file.

M3 u00a0u00a0u00a0u00a0u00a0 Spindle On u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0 M3 oru00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 Starts the spindle.

M4 u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0 M4

M5 u00a0u00a0u00a0u00a0u00a0 Spindle Off u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0 M5u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0Turns the spindle off.

M6 u00a0u00a0u00a0u00a0u00a0 Tool Change u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0 M6T#u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0Allows the tool to be changed byu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 turning off the spindle andu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 coolant and stopping the file.

M7 u00a0u00a0u00a0u00a0u00a0 Coolant On u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0 M7 oru00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0Turns the coolant on.

M8 u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0M8

M9 u00a0u00a0u00a0u00a0u00a0 Coolant Off u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0 M9u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 Turns the coolant off.

M90 u00a0u00a0u00a0 Output Off u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0 M90 OUT#u00a0 u00a0 u00a0 u00a0Turns off the designated output.

M91 u00a0u00a0u00a0 Output On u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0 M91 OUT#u00a0 u00a0 u00a0 u00a0 Turns on the designated output.

Routing Commands

CODEu00a0u00a0u00a0 COMMANDu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0FORMATu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0PURPOSE

G0 u00a0u00a0u00a0u00a0u00a0u00a0u00a0 Rapid Moveu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0G0XxYyZzu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 Moves one or more of theu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0axes, at the rapid speed, to au00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0specified location.

G1 u00a0u00a0u00a0u00a0u00a0u00a0 Linear Cutting Move u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0 G1XxYyZzu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0Moves one or more of theu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0axes along a straight line, atu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0the cutting speed, to au00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0specified location.

G2 u00a0u00a0u00a0u00a0u00a0u00a0 Clockwise Arcu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0G2XxYyIiJi oru00a0 u00a0 u00a0 u00a0Moves two of the axes, at theu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 G2XxZzIiKiu00a0oru00a0 u00a0 u00a0 cutting speed, along an arc inu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 G2YyZzJiKiu00a0 u00a0 u00a0 u00a0 u00a0a clockwise direction to au00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 specified location.

G3 u00a0u00a0u00a0u00a0u00a0u00a0 Counterclockwise Arc u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0u00a0 G3XxYyIiJi oru00a0 u00a0 u00a0 Moves two of the axes, at theu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 G3XxZzIiKi oru00a0 u00a0 u00a0cutting speed, along an arc inu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 G3YyZzJiKiu00a0 u00a0 u00a0 u00a0 u00a0a counterclockwise directionu00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0 u00a0to a specified location.

u00a0