G-code and M-code cheat sheet (Fanuc milling)
Meanings are typical for Fanuc-style milling controls. Other controls and machine builders may differ – follow the machine documentation.
G-codes
| Code | Meaning |
|---|---|
| G00 | Rapid traverse |
| G01 | Linear interpolation (feed) |
| G02 | Circular interpolation clockwise |
| G03 | Circular interpolation counter-clockwise |
| G04 | Dwell |
| G17 / G18 / G19 | Plane XY / ZX / YZ |
| G20 / G21 | Inch / metric input |
| G28 | Return to reference point |
| G40 | Cutter compensation cancel |
| G41 / G42 | Cutter compensation left / right |
| G43 / G49 | Tool length offset / cancel |
| G53 | Machine coordinate move |
| G54–G59 | Work coordinate systems |
| G73 | High-speed peck drilling |
| G74 / G84 | Left-hand / right-hand tapping |
| G76 | Fine boring |
| G80 | Canned cycle cancel |
| G81 / G82 | Drilling / drilling with dwell |
| G83 | Deep-hole peck drilling |
| G85–G89 | Boring cycles |
| G90 / G91 | Absolute / incremental |
| G94 / G95 | Feed per minute / per revolution |
| G96 / G97 | Constant surface speed / constant RPM |
| G98 / G99 | Return to initial level / R plane |
M-codes
| Code | Meaning |
|---|---|
| M00 | Program stop |
| M01 | Optional stop |
| M02 | End of program |
| M03 / M04 | Spindle clockwise / counter-clockwise |
| M05 | Spindle stop |
| M06 | Tool change |
| M08 / M09 | Coolant on / off |
| M19 | Spindle orientation |
| M29 | Rigid tapping |
| M30 | End of program and rewind |
| M98 / M99 | Subprogram call / return |
M19, M29 and some cycle meanings depend on the machine builder.
© CNC Pasaulis · cncpasaulis.lt/en/charts/g-code-m-code-cheat-sheet/