Controller reference
GRBL G-Code List for CNC Routers and Lasers
35 G-codes and 10 M-codes explained for GRBL controls.
GRBL is open-source firmware for hobby CNC routers and laser engravers (Arduino and 32-bit boards). It understands a compact subset of standard G-code — no canned drilling cycles, no cutter compensation and no macros — so CAM post-processors for GRBL output simple G0/G1/G2/G3 moves. Probing uses G38.2 and work offsets are set with G10 L20.
GRBL G-codes (35)
| Code | Function | Machine |
|---|---|---|
G00 | Rapid Positioning | Both |
G01 | Linear Interpolation (Feed Move) | Both |
G02 | Circular Interpolation Clockwise | Both |
G03 | Circular Interpolation Counter-Clockwise | Both |
G04 | Dwell | Both |
G10 | Programmable Data Input (Set Offsets) | Both |
G17 | XY Plane Selection | Mill |
G18 | XZ Plane Selection | Both |
G19 | YZ Plane Selection | Mill |
G20 | Inch Input | Both |
G21 | Metric Input | Both |
G28 | Return to Reference Point (Machine Home) | Both |
G28.1 | Set Predefined Position (GRBL / LinuxCNC) | Mill |
G30 | Return to 2nd/3rd/4th Reference Point | Both |
G30.1 | Set Second Predefined Position (GRBL / LinuxCNC) | Mill |
G38.2 | Straight Probe Toward Workpiece (Stop on Contact, Error if Not) | Mill |
G38.3 | Straight Probe Toward Workpiece (No Error) | Mill |
G40 | Cutter Radius Compensation Cancel | Both |
G43.1 | Dynamic Tool Length Offset (GRBL / LinuxCNC) | Mill |
G49 | Tool Length Compensation Cancel | Mill |
G53 | Machine Coordinate System (One Block) | Both |
G54 | Work Coordinate System 1 | Both |
G55 | Work Coordinate System 2 | Both |
G56 | Work Coordinate System 3 | Both |
G57 | Work Coordinate System 4 | Both |
G58 | Work Coordinate System 5 | Both |
G59 | Work Coordinate System 6 | Both |
G61 | Exact Stop Mode | Both |
G80 | Cancel Canned Cycle | Both |
G90 | Absolute Programming (Mill) / OD Turning Cycle (Lathe) | Both |
G91 | Incremental Programming | Mill |
G92 | Coordinate System Setting (Mill) / Threading Cycle (Lathe) | Both |
G92.1 | Cancel G92 Offset / Coordinate Preset | Both |
G93 | Inverse Time Feed | Mill |
G94 | Feed per Minute (Mill) / Facing Cycle (Lathe) | Both |
GRBL M-codes (10)
Options, machine builders and software versions change which codes are available. Always confirm in the programming manual for your exact machine.