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

CodeDescription
G00Positioning (rapid traverse)
G01Linear interpolation (cutting feed)
G02Circular interpolation clockwise or helical interpolation clockwise
G03Circular interpolation counterclockwise or helical interpolation counterclockwise
G17XpYp plane selection
G18ZpXp plane selection
G19YpZp plane selection
G68Start coordinate system rotation or activate three-dimensional coordinate conversion
G69Cancel coordinate system rotation or deactivate three-dimensional coordinate conversion
G80Canned cycle cancel
G81Drilling cycle or spot drilling cycle
G83Deep-hole drilling cycle
G84Tapping cycle
G90Absolute programming
G91Incremental programming
G94Feed per minute
G95Feed per revolution
G96Constant surface speed control
G97Constant surface speed control cancel

Full reference

CodeDescription
G00Positioning (rapid traverse)
G01Linear interpolation (cutting feed)
G02Circular interpolation clockwise or helical interpolation clockwise
G03Circular interpolation counterclockwise or helical interpolation counterclockwise
G02.2Involute interpolation clockwise
G03.2Involute interpolation counterclockwise
G02.3Exponential interpolation clockwise
G03.3Exponential interpolation counterclockwise
G02.4Three-dimensional coordinate transformation clockwise
G03.4Three-dimensional coordinate transformation counterclockwise
G04Dwell
G05AI contour control (command compatible with high-precision contour control)
G05.1AI contour control / nano smoothing / smooth interpolation
G05.4HRV3/4 on/off
G06.2NURBS interpolation
G07Interpolation with a virtual axis
G07.1Cylindrical interpolation (G107)
G08AI contour control (command compatible with advanced look-ahead control)
G09Exact stop
G10Data input by program
G10.6Tool retraction and recovery
G10.9Programmable switching of the diameter/radius specification
G11Data input by program mode cancel
G12.1Polar coordinate interpolation mode
G13.1Polar coordinate interpolation mode cancel
G15Polar coordinate command cancel
G16Polar coordinate command
G17XpYp plane selection
G18ZpXp plane selection
G19YpZp plane selection
G20Input in inches (G70)
G21Input in mm (G71)
G22Soft limit monitoring on
G23Soft limit monitoring off
G25Spindle speed deviation monitoring off
G26Spindle speed deviation monitoring on
G27Reference point check
G28Automatic return to reference point
G29Return from reference point
G30Move to the 2nd, 3rd and 4th reference points
G30.1Move to the shiftable reference point
G31Skip function
G31.8Skip for EGB axis
G33Thread cutting
G34Thread cutting with variable lead
G35Circular thread cutting clockwise
G36Circular thread cutting counterclockwise
G37Automatic tool length measurement
G38Cutter or tool nose radius compensation: preserve vector
G39Cutter or tool nose radius compensation: corner circular interpolation
G40Cutter or tool nose radius compensation cancel; three-dimensional tool radius compensation cancel
G41Cutter or tool nose radius compensation left; three-dimensional tool radius compensation left
G41.2Cutter compensation for 5-axis machining: left (type 1)
G41.3Cutter compensation for 5-axis machining (leading-edge compensation)
G41.4Tool radius compensation for 5-axis machining: left (type 1, FS16i-compatible command)
G41.5Tool radius compensation for 5-axis machining: left (type 1)
G41.6Tool radius compensation for 5-axis machining: left (type 2)
G42Cutter or tool nose radius compensation right; three-dimensional tool radius compensation right
G42.2Cutter compensation for 5-axis machining: right (type 1)
G42.4Tool radius compensation for 5-axis machining: right (type 1)
G42.5Tool radius compensation for 5-axis machining: right (type 1)
G42.6Tool radius compensation for 5-axis machining: right (type 2)
G40.1Normal direction control mode cancel
G41.1Normal direction control on: left
G42.1Normal direction control on: right
G43Tool length compensation +
G44Tool length compensation −
G43.1Tool length compensation in the tool axis direction
G43.4Tool center point control (type 1)
G43.5Tool center point control (type 2)
G45Increase tool compensation amount
G46Decrease tool compensation amount
G47Double increase of tool compensation amount
G48Double decrease of tool compensation amount
G49Tool length compensation cancel (G49.1)
G50Scaling cancel
G51Scaling
G50.1Programmable mirror image cancel
G51.1Programmable mirror image
G50.2Polygon turning cancel
G51.2Polygon turning
G52Local coordinate system setting
G53Machine coordinate system setting
G53.1Tool axis direction control
G54Workpiece coordinate system 1 selection (G54.1)
G55Workpiece coordinate system 2 selection
G56Workpiece coordinate system 3 selection
G57Workpiece coordinate system 4 selection
G58Workpiece coordinate system 5 selection
G59Workpiece coordinate system 6 selection
G60Single-direction positioning
G61Exact stop mode
G62Automatic corner override
G63Tapping mode
G64Cutting mode
G65Macro call
G66Modal macro call A
G66.1Modal macro call B
G67Modal macro call A/B cancel
G68Start coordinate system rotation or activate three-dimensional coordinate conversion
G69Cancel coordinate system rotation or deactivate three-dimensional coordinate conversion
G68.2Feature coordinate system selection
G72.1Figure copying (rotational copy)
G72.2Figure copying (linear copy)
G73Deep-hole drilling cycle
G74Left-hand tapping cycle
G76Fine boring cycle
G80Canned cycle cancel
G80.5Electronic gearbox with 2 axis pairs: end of synchronization
G80.8Electronic gearbox: end of synchronization
G81Drilling cycle or spot drilling cycle
G81.1Chopping (reciprocating axis motion)
G81.5Electronic gearbox with 2 axis pairs: start of synchronization
G81.8Electronic gearbox: start of synchronization
G82Drilling cycle or counterboring cycle
G83Deep-hole drilling cycle
G84Tapping cycle
G84.2Tapping cycle without floating tap holder (FS15 format)
G84.3Left-hand tapping without floating tap holder (FS15 format)
G85Boring cycle
G86Boring cycle
G87Back boring cycle
G88Boring cycle
G89Boring cycle
G90Absolute programming
G91Incremental programming
G91.1Check of the maximum specified incremental amount
G92Workpiece coordinate system setting or maximum spindle speed clamp
G92.1Workpiece coordinate system preset
G93Inverse-time feed
G94Feed per minute
G95Feed per revolution
G96Constant surface speed control
G97Constant surface speed control cancel
G98Canned cycle: return to initial level
G99Canned cycle: return to R point level
G107Cylindrical interpolation
G112Polar coordinate interpolation
G113Polar coordinate interpolation cancel