Fanuc G-codes – reference table
Fanuc G-codes at a glance: the essential commands up front plus a complete reference table from G00 to G113 with concise descriptions for milling and turning.
This reference lists the G-codes of the Fanuc control. The first table shows the most important everyday commands, the second the complete list from G00 to G113. The functions actually available depend on the control model and its options.
To learn how to read and write the work offsets G54 to G59 via macro variables, see Work offset parameters.
Essential G-codes
| Code | Description |
|---|---|
| G00 | Positioning (rapid traverse) |
| G01 | Linear interpolation (cutting feed) |
| G02 | Circular interpolation clockwise or helical interpolation clockwise |
| G03 | Circular interpolation counterclockwise or helical interpolation counterclockwise |
| G17 | XpYp plane selection |
| G18 | ZpXp plane selection |
| G19 | YpZp plane selection |
| G68 | Start coordinate system rotation or activate three-dimensional coordinate conversion |
| G69 | Cancel coordinate system rotation or deactivate three-dimensional coordinate conversion |
| G80 | Canned cycle cancel |
| G81 | Drilling cycle or spot drilling cycle |
| G83 | Deep-hole drilling cycle |
| G84 | Tapping cycle |
| G90 | Absolute programming |
| G91 | Incremental programming |
| G94 | Feed per minute |
| G95 | Feed per revolution |
| G96 | Constant surface speed control |
| G97 | Constant surface speed control cancel |
Full reference
| Code | Description |
|---|---|
| G00 | Positioning (rapid traverse) |
| G01 | Linear interpolation (cutting feed) |
| G02 | Circular interpolation clockwise or helical interpolation clockwise |
| G03 | Circular interpolation counterclockwise or helical interpolation counterclockwise |
| G02.2 | Involute interpolation clockwise |
| G03.2 | Involute interpolation counterclockwise |
| G02.3 | Exponential interpolation clockwise |
| G03.3 | Exponential interpolation counterclockwise |
| G02.4 | Three-dimensional coordinate transformation clockwise |
| G03.4 | Three-dimensional coordinate transformation counterclockwise |
| G04 | Dwell |
| G05 | AI contour control (command compatible with high-precision contour control) |
| G05.1 | AI contour control / nano smoothing / smooth interpolation |
| G05.4 | HRV3/4 on/off |
| G06.2 | NURBS interpolation |
| G07 | Interpolation with a virtual axis |
| G07.1 | Cylindrical interpolation (G107) |
| G08 | AI contour control (command compatible with advanced look-ahead control) |
| G09 | Exact stop |
| G10 | Data input by program |
| G10.6 | Tool retraction and recovery |
| G10.9 | Programmable switching of the diameter/radius specification |
| G11 | Data input by program mode cancel |
| G12.1 | Polar coordinate interpolation mode |
| G13.1 | Polar coordinate interpolation mode cancel |
| G15 | Polar coordinate command cancel |
| G16 | Polar coordinate command |
| G17 | XpYp plane selection |
| G18 | ZpXp plane selection |
| G19 | YpZp plane selection |
| G20 | Input in inches (G70) |
| G21 | Input in mm (G71) |
| G22 | Soft limit monitoring on |
| G23 | Soft limit monitoring off |
| G25 | Spindle speed deviation monitoring off |
| G26 | Spindle speed deviation monitoring on |
| G27 | Reference point check |
| G28 | Automatic return to reference point |
| G29 | Return from reference point |
| G30 | Move to the 2nd, 3rd and 4th reference points |
| G30.1 | Move to the shiftable reference point |
| G31 | Skip function |
| G31.8 | Skip for EGB axis |
| G33 | Thread cutting |
| G34 | Thread cutting with variable lead |
| G35 | Circular thread cutting clockwise |
| G36 | Circular thread cutting counterclockwise |
| G37 | Automatic tool length measurement |
| G38 | Cutter or tool nose radius compensation: preserve vector |
| G39 | Cutter or tool nose radius compensation: corner circular interpolation |
| G40 | Cutter or tool nose radius compensation cancel; three-dimensional tool radius compensation cancel |
| G41 | Cutter or tool nose radius compensation left; three-dimensional tool radius compensation left |
| G41.2 | Cutter compensation for 5-axis machining: left (type 1) |
| G41.3 | Cutter compensation for 5-axis machining (leading-edge compensation) |
| G41.4 | Tool radius compensation for 5-axis machining: left (type 1, FS16i-compatible command) |
| G41.5 | Tool radius compensation for 5-axis machining: left (type 1) |
| G41.6 | Tool radius compensation for 5-axis machining: left (type 2) |
| G42 | Cutter or tool nose radius compensation right; three-dimensional tool radius compensation right |
| G42.2 | Cutter compensation for 5-axis machining: right (type 1) |
| G42.4 | Tool radius compensation for 5-axis machining: right (type 1) |
| G42.5 | Tool radius compensation for 5-axis machining: right (type 1) |
| G42.6 | Tool radius compensation for 5-axis machining: right (type 2) |
| G40.1 | Normal direction control mode cancel |
| G41.1 | Normal direction control on: left |
| G42.1 | Normal direction control on: right |
| G43 | Tool length compensation + |
| G44 | Tool length compensation − |
| G43.1 | Tool length compensation in the tool axis direction |
| G43.4 | Tool center point control (type 1) |
| G43.5 | Tool center point control (type 2) |
| G45 | Increase tool compensation amount |
| G46 | Decrease tool compensation amount |
| G47 | Double increase of tool compensation amount |
| G48 | Double decrease of tool compensation amount |
| G49 | Tool length compensation cancel (G49.1) |
| G50 | Scaling cancel |
| G51 | Scaling |
| G50.1 | Programmable mirror image cancel |
| G51.1 | Programmable mirror image |
| G50.2 | Polygon turning cancel |
| G51.2 | Polygon turning |
| G52 | Local coordinate system setting |
| G53 | Machine coordinate system setting |
| G53.1 | Tool axis direction control |
| G54 | Workpiece coordinate system 1 selection (G54.1) |
| G55 | Workpiece coordinate system 2 selection |
| G56 | Workpiece coordinate system 3 selection |
| G57 | Workpiece coordinate system 4 selection |
| G58 | Workpiece coordinate system 5 selection |
| G59 | Workpiece coordinate system 6 selection |
| G60 | Single-direction positioning |
| G61 | Exact stop mode |
| G62 | Automatic corner override |
| G63 | Tapping mode |
| G64 | Cutting mode |
| G65 | Macro call |
| G66 | Modal macro call A |
| G66.1 | Modal macro call B |
| G67 | Modal macro call A/B cancel |
| G68 | Start coordinate system rotation or activate three-dimensional coordinate conversion |
| G69 | Cancel coordinate system rotation or deactivate three-dimensional coordinate conversion |
| G68.2 | Feature coordinate system selection |
| G72.1 | Figure copying (rotational copy) |
| G72.2 | Figure copying (linear copy) |
| G73 | Deep-hole drilling cycle |
| G74 | Left-hand tapping cycle |
| G76 | Fine boring cycle |
| G80 | Canned cycle cancel |
| G80.5 | Electronic gearbox with 2 axis pairs: end of synchronization |
| G80.8 | Electronic gearbox: end of synchronization |
| G81 | Drilling cycle or spot drilling cycle |
| G81.1 | Chopping (reciprocating axis motion) |
| G81.5 | Electronic gearbox with 2 axis pairs: start of synchronization |
| G81.8 | Electronic gearbox: start of synchronization |
| G82 | Drilling cycle or counterboring cycle |
| G83 | Deep-hole drilling cycle |
| G84 | Tapping cycle |
| G84.2 | Tapping cycle without floating tap holder (FS15 format) |
| G84.3 | Left-hand tapping without floating tap holder (FS15 format) |
| G85 | Boring cycle |
| G86 | Boring cycle |
| G87 | Back boring cycle |
| G88 | Boring cycle |
| G89 | Boring cycle |
| G90 | Absolute programming |
| G91 | Incremental programming |
| G91.1 | Check of the maximum specified incremental amount |
| G92 | Workpiece coordinate system setting or maximum spindle speed clamp |
| G92.1 | Workpiece coordinate system preset |
| G93 | Inverse-time feed |
| G94 | Feed per minute |
| G95 | Feed per revolution |
| G96 | Constant surface speed control |
| G97 | Constant surface speed control cancel |
| G98 | Canned cycle: return to initial level |
| G99 | Canned cycle: return to R point level |
| G107 | Cylindrical interpolation |
| G112 | Polar coordinate interpolation |
| G113 | Polar coordinate interpolation cancel |