Cutline Studio

Guide

Grbl alarm and error codes, explained

Grbl reports problems as a number: ALARM:2 or error:20. Alarms stop the machine and lock it until you clear them. Errors reject one line of G-code. Here's every code from Grbl 1.1, what it means, and what to do about the ones hobby CNC owners hit most.

Updated November 25, 2026.

The ones you'll see most

How to clear a Grbl alarm

  1. Find out why it happened first. Unlocking without fixing the cause usually brings the alarm straight back.
  2. Send $X to unlock, or $H to home. After a hard limit (ALARM:1) or a reset during motion (ALARM:3), always home again, because the machine may have lost its position.
  3. Re-check your work zero before restarting the job.

Grbl alarm codes

AlarmGrbl 1.0 messageWhat it meansWhat to do
1Hard limitHard limit has been triggered. Machine position is likely lost due to sudden halt. Re-homing is highly recommended.A limit switch was hit (or tripped by electrical noise). Re-home before running again; if no switch was hit, check wiring and shielding.
2Soft limitSoft limit alarm. G-code motion target exceeds machine travel. Machine position retained. Alarm may be safely unlocked.The job asks the machine to go past its travel. Usually the work zero (X0 Y0 Z0) is set so part of the job falls off the table, or the safe height is above the top of Z travel. Unlock with $X, then fix the zero or the file.
3Abort during cycleReset while in motion. Machine position is likely lost due to sudden halt. Re-homing is highly recommended.Reset while moving. Re-home: the machine may have lost steps.
4Probe failProbe fail. Probe is not in the expected initial state before starting probe cycle when G38.2 and G38.3 is not triggered and G38.4 and G38.5 is triggered.
5Probe failProbe fail. Probe did not contact the workpiece within the programmed travel for G38.2 and G38.4.
6Homing failHoming fail. The active homing cycle was reset.Homing was interrupted by a reset.
7Homing failHoming fail. Safety door was opened during homing cycle.
8Homing failHoming fail. Pull off travel failed to clear limit switch. Try increasing pull-off setting or check wiring.The switch stayed pressed after homing backed off. Increase pull-off ($27) or check the switch.
9Homing failHoming fail. Could not find limit switch within search distances. Try increasing max travel, decreasing pull-off distance, or check wiring.A switch wasn't found. Check the switch and wiring, and that max travel ($130-$132) is long enough.
10Homing failHoming fail. Second dual axis limit switch failed to trigger within configured search distance after first. Try increasing trigger fail distance or check wiring.

Grbl error codes

Errors don't lock the machine. Grbl skips the line it can't run and replies with the code, which most senders show in the console next to the line.

ErrorGrbl 1.0 messageWhat it meansWhat to do
1Expected command letterG-code words consist of a letter and a value. Letter was not found.
2Bad number formatMissing the expected G-code word value or numeric value format is not valid.A number is badly formatted, for example a comma used as a decimal point.
3Invalid statementGrbl '$' system command was not recognized or supported.
4Value < 0Negative value received for an expected positive value.
5Setting disabledHoming cycle failure. Homing is not enabled via settings.
6Value < 3 usecMinimum step pulse time must be greater than 3usec.
7EEPROM read fail. Using defaultsAn EEPROM read failed. Auto-restoring affected EEPROM to default values.
8Not idleGrbl '$' command cannot be used unless Grbl is IDLE. Ensures smooth operation during a job.
9G-code lockG-code commands are locked out during alarm or jog state.Grbl is in alarm or jog state. Clear the alarm first ($X or home with $H).
10Homing not enabledSoft limits cannot be enabled without homing also enabled.
11Line overflowMax characters per line exceeded. Received command line was not executed.A line is too long for Grbl. Shorten comments or re-post the file.
12Step rate > 30kHzGrbl '$' setting value cause the step rate to exceed the maximum supported.
13Check DoorSafety door detected as opened and door state initiated.
14Line length exceededBuild info or startup line exceeded EEPROM line length limit. Line not stored.
15Travel exceededJog target exceeds machine travel. Jog command has been ignored.A jog would go past the machine's travel. Jog the other way or re-home.
16Invalid jog commandJog command has no '=' or contains prohibited g-code.
17Setting disabledLaser mode requires PWM output.
20Unsupported commandUnsupported or invalid g-code command found in block.The file has a command Grbl doesn't support, such as an M6 tool change or a G-code made for another controller. Re-post the file for Grbl.
21Modal group violationMore than one g-code command from same modal group found in block.
22Undefined feed rateFeed rate has not yet been set or is undefined.A cutting move came before any F feed rate. Re-post the file, or add an F value before the first G1.
23Invalid gcode ID:23G-code command in block requires an integer value.
24Invalid gcode ID:24More than one g-code command that requires axis words found in block.
25Invalid gcode ID:25Repeated g-code word found in block.
26Invalid gcode ID:26No axis words found in block for g-code command or current modal state which requires them.
27Invalid gcode ID:27Line number value is invalid.
28Invalid gcode ID:28G-code command is missing a required value word.
29Invalid gcode ID:29G59.x work coordinate systems are not supported.
30Invalid gcode ID:30G53 only allowed with G0 and G1 motion modes.
31Invalid gcode ID:31Axis words found in block when no command or current modal state uses them.
32Invalid gcode ID:32G2 and G3 arcs require at least one in-plane axis word.
33Invalid gcode ID:33Motion command target is invalid.A move target is invalid, often an arc that doesn't close. Re-post with a Grbl post processor.
34Invalid gcode ID:34Arc radius value is invalid.
35Invalid gcode ID:35G2 and G3 arcs require at least one in-plane offset word.
36Invalid gcode ID:36Unused value words found in block.
37Invalid gcode ID:37G43.1 dynamic tool length offset is not assigned to configured tool length axis.
38Invalid gcode ID:38Tool number greater than max supported value.

Codes and descriptions from the official Grbl 1.1 documentation (gnea/grbl). Forks such as grblHAL and FluidNC add more codes.

Stop errors before they start

Most G-code errors come from a file written for a different controller: Mach3 commands such as G64 or M6 tool changes, or comments Grbl can't parse. Use a post processor made for Grbl. Cutline Studio has separate Grbl and Mach3/Mach4 outputs: the Grbl output leaves out commands Grbl rejects, and every file keeps its comments free of nested brackets.

Cutline Studio's CAM screen with toolpaths on the sheet and a ready-to-save checklist
Cutline Studio's CAM screen: before you save the G-code, it lists the plywood thickness, bit, cut-outs, pockets, tabs and speed for you to check, next to the toolpaths on the sheet.

Soft-limit alarms (ALARM:2) are usually a setup problem rather than a file problem. Check that your work zero leaves the whole job, plus the bit, inside the machine's travel, and that the file's safe height fits under the top of the Z axis.

If you run a Grbl, grblHAL or FluidNC machine from Cutline Control (beta, the Machine tab in Cutline Studio 1.1), it checks the job before the bit moves: it warns when the job is bigger than your machine, which catches one common cause of ALARM:2, and it finds G-code lines your controller can't run, the usual cause of error:20. When an alarm does come up, there's help at the machine to explain it. See Grbl senders and CAM for the other senders that work with Grbl.

More guides: CAM for Grbl and Mach3 · G-code generator · CNC software for beginners · feeds and speeds for plywood · all guides

FAQ

What does ALARM:2 mean in Grbl?
A soft limit: a move in the file goes beyond the machine's travel. Grbl stops before it moves, so position is kept. Unlock with $X, then move your work zero or fix the file.
How do I unlock Grbl after an alarm?
Send $X to unlock, or $H to run the homing cycle. Home again after a hard limit or a reset during motion, because the position may be lost.
What causes error:20 in Grbl?
An unsupported G-code command, such as an M6 tool change, G64, or a command from a different controller's post processor. Re-post the file for Grbl.
What is error:22?
Undefined feed rate: a G1, G2 or G3 move ran before any F value was set. Add a feed rate or re-post the file.

Try Cutline Studio

Design one project free in your browser, or download the 7-day free trial for Windows 10 and 11.

Try it in your browser Download free trial

← Back to Cutline Studio