Lathe G code list (Fanuc G code system C)
The table below uses Fanuc lathe G code system C. Many lathes use system A instead, where several numbers mean something else:
| Function | System A | System C (this page) |
|---|---|---|
| Inch / metric input | G20 / G21 | G70 / G71 |
| Thread cutting | G32 | G33 |
| Coordinate system setting, maximum spindle speed | G50 | G92 |
| Finishing cycle | G70 | G72 |
| Stock removal in turning / in facing | G71 / G72 | G73 / G74 |
| Pattern repeating | G73 | G75 |
| Face peck drilling / grooving / multiple threading cycle | G74 / G75 / G76 | G76 / G77 / G78 |
| Turning cycle A / thread cutting cycle / facing cycle B | G90 / G92 / G94 | G20 / G21 / G24 |
| Feed per minute / per revolution | G98 / G99 | G94 / G95 |
| Absolute / incremental programming | X, Z / U, W addresses | G90 / G91 |
On Fanuc controls the G code system is selected by a parameter. Check your machine's manual before you copy a code from any table.
CNC Syntax Editor highlights G codes in lathe and mill programs. To see the tool path of a program, open it in the free online G-code viewer; the Free Edition of the editor is on the download page.
G code list for lathes (system C)
| Code | Description |
|---|---|
| G00 | Positioning |
| G01 | Linear interpolation |
| G02 | Circular interpolation CW |
| G03 | Circular interpolation CCW |
| G04 | Dwell |
| G10 | Offset value setting |
| G70 | Inch data input |
| G71 | Metric data input |
| G22 | Stored stroke limit ON |
| G23 | Stored stroke limit OFF |
| G27 | Reference point return check |
| G28 | Return to reference point |
| G29 | Return from reference point |
| G30 | Return to 2nd reference point |
| G31 | Skip cutting |
| G33 | Thread cutting |
| G34 | Variable lead thread cutting |
| G36 | Automatic tool compensation X |
| G37 | Automatic tool compensation Z |
| G40 | Tool nose radius compensation cancel |
| G41 | Tool nose radius compensation left |
| G42 | Tool nose radius compensation right |
| G92 | Programming of absolute zero point (also: Maximum spindle speed setting) |
| G65 | User macro simple calling |
| G66 | User macro modal calling |
| G67 | User macro modal call cancellation |
| G68 | Mirror image for double turrets ON |
| G69 | Mirror image for double turrets OFF |
| G72 | Finishing cycle |
| G73 | Stock removal in turning |
| G74 | Stock removal in facing |
| G75 | Pattern repeating |
| G76 | Peck drilling in Z axis |
| G77 | Grooving in X axis |
| G78 | Thread cutting cycle |
| G20 | Cutting cycle A |
| G21 | Thread cutting cycle |
| G24 | Cutting cycle B |
| G96 | Constant surface speed control |
| G97 | Constant surface speed control cancel |
| G94 | Per minute feed |
| G95 | Per revolution feed |
| G90 | Absolute programming |
| G91 | Incremental programming |
M codes | G codes | G and M codes for mills | ISO tape codes | EIA tape codes | Online G-code viewer