Gcode Modal Command Groups

What is a G-Code Modal code?

A command that puts the CNC program into a “mode”. The “mode” will be active until the next modal instruction is reached. For example, G91 puts the machine in an incremental mode. The program will work accordingly until a G90 (Absolute mode) command is encountered.

G-code Modal Groups Table

Group #Group NameG-Codes
1MotionG00, G01, G02, G03, G80, G81, G82, G84, G85, G86, G87, G88, G89
2Plane SelectionG17, G18, G19
3Distance ModeG90, G91
5Feed ModeG93, G94
6Units ModeG20, G21
7Cutter Radius CompensationG40, G41, G42
8Tool Length CompensationG43, G49
10Return Mode in Canned CyclesG98, G99
12Coordinate System SelectionG54, G55, G56, G57, G58, G59
  • Modal commands are attached in groups (Motion group, Compensation group, etc.)
  • Each mode group is activated/deactivated separately without affecting the other groups.
  • A group can have two or more members.
  • The biggest group is the motion group, which has 13 commands in it.
  • For example, G90 and G91 are grouped in the “Distance Group”. They dictate the distance that the machine will travel in all the motion commands that follow it until the counter instruction is encountered and changes the mode.


Assuming the machine is at the X=0, Y=0 coordinate

N10 G90 (Absolute Mode)
N20 G01 X1 Y1
N30 G01 X2 Y3
N40 G91 (Change to Incremental Mode)
N50 G01 X1 Y1
N60 G01 X2 Y3

As a result, the sequence of coordinates that the machine will pass is:


wdt_ID X Y
1 0 0
2 1 1
3 2 3
4 3 4
5 5 7

Learn about more G-Codes

Scroll to Top