---
title: "GRBL Alarm 1 vs Error 1: What Each Means and the Fix"
description: "GRBL has two different number-1 messages: error:1 is a malformed G-code word, ALARM:1 is a tripped hard limit with position lost. Here is how to fix each."
url: https://gcodepractice.com/journal/grbl-alarm-1-g-code-error-explained/
canonical: https://gcodepractice.com/journal/grbl-alarm-1-g-code-error-explained/
author: "Lawrence Arya"
authorUrl: https://www.linkedin.com/in/vibecoding/
published: 2026-06-04
updated: 2026-06-04
category: "Code reference"
tags: ["grbl", "alarm", "error", "troubleshooting", "hobby-cnc"]
lang: en
---

# GRBL Alarm 1 vs Error 1: What Each Means and the Fix

> **TL;DR** GRBL uses two separate message families. error:1 means a received G-code line was malformed, a word did not start with a letter, and the line was rejected without running. ALARM:1 means a hard limit switch was hit during motion, the machine halted instantly, and position is no longer trusted, so you unlock with $X and re-home with $H. One is a typo in the file; the other is a physical event at the machine.

Hobby machines running GRBL report problems with two different message families, and both have a number 1. People searching for a GRBL alarm 1 G-code error are usually staring at one of two completely unrelated messages: `error:1`, a rejected line of code, or `ALARM:1`, a physical limit hit. The fix depends entirely on which one you have, so start by reading the message exactly.

## Which message are you actually seeing?

| Message | What happened | Severity |
| --- | --- | --- |
| `error:1` | A received line was malformed and was rejected | The line never ran; the machine keeps working |
| `ALARM:1` | A hard limit switch tripped during motion | Machine halted; position lost; motion locked out |

Both lists are published in the [GRBL v1.1 interface documentation](https://github.com/gnea/grbl/wiki/Grbl-v1.1-Interface). The number is just an index within each family; the prefix is the part that matters.

## What causes error 1, and how do you fix it?

`error:1` is GRBL saying a G-code word did not begin with a letter. Every word in the [G-code language](https://en.wikipedia.org/wiki/G-code) is a letter followed by a value, `G1`, `X10.5`, `F500`, and GRBL rejects any line where that grammar breaks, the same letter-plus-value rule behind the question of [leading zeros in G00](/journal/do-i-have-to-type-leading-zeros-in-g00/).

The usual culprits, in the order worth checking:

1. Stray characters in the file: smart quotes, accents, or other non-ASCII characters pasted in from a document editor.
2. A corrupted line from the serial link: wrong baud rate, a flaky USB cable, or electrical noise garbling bytes mid-stream.
3. A sender or macro inserting text GRBL was never meant to parse.

The fix is at the file or connection level: open the flagged line in a plain-text editor, retype it cleanly, and if errors appear at random lines on re-runs, suspect the cable and baud rate rather than the program.

## What causes ALARM 1, and how do you fix it?

`ALARM:1` is physical. A hard limit switch closed while the machine was moving, GRBL slammed to a stop, and because that stop is instant and uncontrolled, the step counters no longer match reality. That is why the alarm locks everything: position is officially unknown.

Recovery is two commands, then a diagnosis:

| Step | Command | Why |
| --- | --- | --- |
| 1. Unlock | `$X` | Kills the alarm lock so the machine can move |
| 2. Re-home | `$H` | Re-finds the switches; position is untrustworthy until then |
| 3. Diagnose | (see below) | Or the alarm comes straight back |

The diagnosis is the real work. Three causes cover almost every case: the work zero was set so the program ran past the machine's travel; the program itself is larger than the work area; or electrical noise on the limit-switch wiring faked a trigger, a known issue on long unshielded runs that the [GRBL configuration guide](https://github.com/gnea/grbl/wiki/Grbl-v1.1-Configuration) addresses with wiring practice and the `$5` invert setting. Enabling soft limits (`$20`) with correct travel values (`$130` to `$132`) converts most future overtravels into a polite pre-move rejection, `ALARM:2`, instead of a physical hit.

A concrete example: a router job homed fine, then threw `ALARM:1` ten seconds into the cut. The work zero had been touched off at the far corner of the spoilboard, so the program's first long X move ran the gantry into the switch. Re-homing and re-zeroing in the middle of the board fixed it; nothing was wrong with the file.

## Why do GRBL machines mix these up so often?

Because one hobby machine wears many hats. The same GRBL board drives routers, lasers, and converted printers, the ecosystem covered in [OpenBuilds GRBL controller practice](/journal/openbuilds-grbl-controller-g-code-practice/), and its operators often come from 3D printing, where firmware behaves differently, the same gap explored in [what G54 means in 3D printing](/journal/what-is-g54-in-3d-printing/). Knowing the standard codes cold is what lets you tell a file problem from a machine problem in seconds.

## Bottom line

Read the prefix before the number. `error:1` is a malformed G-code word, fixed in the file or the serial link, and the machine is fine. `ALARM:1` is a tripped hard limit with position lost: `$X` to unlock, `$H` to re-home, then fix the zero, the travel, or the wiring that caused it. Telling the two apart instantly is a recall skill, and a routine on the [G-code practice hub](/g-code-practice/) builds exactly that.

## Sources

- [GRBL v1.1 Interface (error and alarm code lists)](https://github.com/gnea/grbl/wiki/Grbl-v1.1-Interface)
- [GRBL v1.1 Configuration ($ settings, limits, homing)](https://github.com/gnea/grbl/wiki/Grbl-v1.1-Configuration)
- [Wikipedia: G-code](https://en.wikipedia.org/wiki/G-code)

## Frequently asked questions

### What does GRBL alarm 1 mean?
`ALARM:1` means a hard limit switch tripped during motion. GRBL halts instantly and locks motion because position is no longer trusted. Unlock with `$X`, re-home with `$H`, then find the cause: wrong work zero, a program larger than the travel, or noise faking a trigger.

### What does GRBL error 1 mean?
`error:1` means a received line was malformed, a word did not begin with a letter, so the line was rejected and never ran. Look for stray non-ASCII characters, a corrupted serial stream, or a sender inserting junk.

### How do you clear a GRBL alarm?
Send `$X` to kill the alarm lock, then `$H` to re-home, because position is unreliable after a hard-limit halt. Fix the underlying cause or the alarm returns on the next run.

### What is the best way to learn the G-code that GRBL machines run?
Drill the core codes with active recall, since GRBL runs a standard subset. A free app like G-Code Sprint quizzes the everyday codes and repeats whichever ones you miss.

*G-Code Sprint is a study and practice tool only. Always follow your instructor, employer, machine manual, and shop safety procedures.*

---

Source: https://gcodepractice.com/journal/grbl-alarm-1-g-code-error-explained/
Author: Lawrence Arya — https://www.linkedin.com/in/vibecoding/
