CNC G-Codes & M-Codes (FANUC Reference)

G-Codes

CodeDescription
G00Rapid Positioning
G01Linear Cutting
G02Clockwise Arc
G03Counter-Clockwise Arc
G04Dwell / Pause
G20Inch Mode
G21Metric Mode
G28Return to Machine Home
G30Return to Second Home Position
G40Cancel Cutter Compensation
G41Left Compensation
G42Right Compensation
G43Tool Length Compensation +
G44Tool Length Compensation -
G45Increase Tool Offset
G49Cancel Tool Length Offset
G50Max RPM Limit (Lathe)
G70Finishing Cycle
G71Roughing Cycle
G72Facing Cycle
G73Pattern Repeating Cycle
G74Peck Drilling in Z
G75Grooving Cycle (X Direction)
G76Thread Cutting Cycle
G77Turning Pattern Repeat Cycle
G78Alternate Threading Cutting Cycle
G79Face Pattern Repeat Cycle
G80Cancel Canned Cycle
G81Drilling Cycle
G82Drill With Dwell
G83Peck Drilling
G84Tapping Cycle
G90Absolute Mode
G91Incremental Mode
G92Threading / Coordinate Clamp
G96Constant Surface Speed (CSS)
G97Fixed RPM Mode
G98Feed per Minute
G99Feed per Revolution

M-Codes

CodeDescription
M00Program Stop
M01Optional Stop
M02Program End
M03Spindle ON (CW)
M04Spindle ON (CCW)
M05Spindle Stop
M06Tool Change
M07Coolant ON (Turning)
M08Coolant ON (VMC)
M09Coolant OFF
M29Rigid Tapping Mode
M30Program End + Reset
M40Gear Neutral / Mid
M41Low Gear
M42High Gear
M68Chuck Close
M69Chuck Open
M78Tailstock Advance
M79Tailstock Retract
M98Subprogram Call
M99Return from Subprogram