---
title: "Modal vs Non-Modal G-Codes: What Beginners Get Wrong"
description: "Modal G-codes stay active until you change them; non-modal codes act only on their own line. Here is why that distinction trips up beginners."
url: https://gcodepractice.com/journal/modal-vs-non-modal-g-codes/
canonical: https://gcodepractice.com/journal/modal-vs-non-modal-g-codes/
author: "Lawrence Arya"
authorUrl: https://www.linkedin.com/in/vibecoding/
published: 2026-05-27
updated: 2026-05-27
category: "Code reference"
tags: ["g-code", "modal", "concepts", "beginner"]
lang: en
---

# Modal vs Non-Modal G-Codes: What Beginners Get Wrong

> **TL;DR** A modal G-code stays active until another code in the same group cancels or replaces it, so a feed move like G01 keeps applying to later lines even when it is not repeated. A non-modal (one-shot) code, like G04 dwell, affects only the block it appears in. Beginners forget that modal state carries forward.

Beginners often memorize what each code *means* and still misread programs. The missing piece is *modal* behavior: whether a code stays on after its line.

## Modal codes stay active

A **modal** code remains in effect until another code in the same group replaces or cancels it. Motion codes are the clearest example. Once you program `G01`, the machine keeps feeding in a straight line on later lines even if you only give new coordinates:

```
G01 X10 F150   (feed move, G01 now active)
X20            (still a G01 feed move, no code repeated)
X30            (still feeding)
```

That is why a missing or wrong modal code earlier in a program can quietly change every line that follows. The codes are grouped: `G00`, `G01`, `G02`, and `G03` share a motion group, so setting one cancels the others. The same is true for units (`G20`/`G21`) and positioning (`G90`/`G91`).

## Non-modal codes are one-shot

A **non-modal** code, sometimes called a one-shot, affects only the block it sits in. `G04` (dwell) is a common example: it pauses for that line and then has no further effect. Codes like `G28` behave as one-shots in normal use too.

## What beginners get wrong

The classic mistake is treating every line as independent, as if a code only matters where it appears. With modal codes, the *state* carries forward. A beginner who reads `X20` on its own line and cannot say what motion it makes has not learned the codes wrong, they have missed the modal idea.

This is also why pure memorization of meanings is not enough. You need the concept *and* fast recall of the codes. Build the recall with the [practice-first method](/journal/beginner-cnc-code-practice/), and make sure you know the [common G-codes](/journal/common-g-codes-for-cnc-beginners/) those modal groups are built from.

## Bottom line

Modal codes stay on until changed; non-modal codes act once. Beginners trip when they forget the state carries forward. Learn the groups, not just the individual meanings.

*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/modal-vs-non-modal-g-codes/
Author: Lawrence Arya — https://www.linkedin.com/in/vibecoding/
