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)

CodeFunctionMachine
G00Rapid PositioningBoth
G01Linear Interpolation (Feed Move)Both
G02Circular Interpolation ClockwiseBoth
G03Circular Interpolation Counter-ClockwiseBoth
G04DwellBoth
G10Programmable Data Input (Set Offsets)Both
G17XY Plane SelectionMill
G18XZ Plane SelectionBoth
G19YZ Plane SelectionMill
G20Inch InputBoth
G21Metric InputBoth
G28Return to Reference Point (Machine Home)Both
G28.1Set Predefined Position (GRBL / LinuxCNC)Mill
G30Return to 2nd/3rd/4th Reference PointBoth
G30.1Set Second Predefined Position (GRBL / LinuxCNC)Mill
G38.2Straight Probe Toward Workpiece (Stop on Contact, Error if Not)Mill
G38.3Straight Probe Toward Workpiece (No Error)Mill
G40Cutter Radius Compensation CancelBoth
G43.1Dynamic Tool Length Offset (GRBL / LinuxCNC)Mill
G49Tool Length Compensation CancelMill
G53Machine Coordinate System (One Block)Both
G54Work Coordinate System 1Both
G55Work Coordinate System 2Both
G56Work Coordinate System 3Both
G57Work Coordinate System 4Both
G58Work Coordinate System 5Both
G59Work Coordinate System 6Both
G61Exact Stop ModeBoth
G80Cancel Canned CycleBoth
G90Absolute Programming (Mill) / OD Turning Cycle (Lathe)Both
G91Incremental ProgrammingMill
G92Coordinate System Setting (Mill) / Threading Cycle (Lathe)Both
G92.1Cancel G92 Offset / Coordinate PresetBoth
G93Inverse Time FeedMill
G94Feed per Minute (Mill) / Facing Cycle (Lathe)Both

GRBL M-codes (10)

CodeFunctionMachine
M00Program StopBoth
M01Optional StopBoth
M02End of ProgramBoth
M03Spindle On ClockwiseBoth
M04Spindle On Counter-ClockwiseBoth
M05Spindle StopBoth
M07Mist Coolant OnBoth
M08Flood Coolant OnBoth
M09Coolant OffBoth
M30Program End and RewindBoth

Options, machine builders and software versions change which codes are available. Always confirm in the programming manual for your exact machine.

Other controls