---
title: "Common G-Codes Every CNC Beginner Should Know"
description: "A short reference list of the G-codes that show up in almost every CNC program, with a one-line meaning for each, built for beginners."
url: https://gcodepractice.com/journal/common-g-codes-for-cnc-beginners/
canonical: https://gcodepractice.com/journal/common-g-codes-for-cnc-beginners/
author: "Lawrence Arya"
authorUrl: https://www.linkedin.com/in/vibecoding/
published: 2026-05-29
updated: 2026-05-29
category: "Code reference"
tags: ["g-code", "reference", "cheat sheet", "beginner"]
lang: en
---

# Common G-Codes Every CNC Beginner Should Know

> **TL;DR** The core beginner G-codes are G00 (rapid), G01 (linear feed), G02 and G03 (clockwise and counterclockwise arcs), G17 to G19 (plane select), G20 and G21 (inch and metric), G28 (return to reference), G40 to G43 (cutter and tool length comp), G54 to G59 (work offsets), and G90 and G91 (absolute and incremental). Learn these first.

There are dozens of G-codes in the standard, but a CNC beginner does not need all of them to start reading programs. A smaller core shows up constantly. Learn this set first.

## The motion codes

These command movement and appear in almost every line of cutting:

- **G00**: rapid positioning (non-cutting). See [G00 vs G01](/journal/g00-vs-g01/).
- **G01**: linear interpolation, a straight feed move.
- **G02**: clockwise circular interpolation (arc).
- **G03**: counterclockwise circular interpolation. See [G02 vs G03](/journal/g02-vs-g03/).

## Setup and mode codes

These set up how the machine interprets everything else:

- **G17 / G18 / G19**: select the working plane (XY, XZ, YZ). G17 is the common default for milling.
- **G20 / G21**: units, inch (G20) or millimeters (G21). Getting this wrong scales your whole part.
- **G90 / G91**: absolute (G90) or incremental (G91) positioning.
- **G54 to G59**: work coordinate offsets, telling the machine where your part zero is.

## The core dozen at a glance

| Code | Meaning | Group |
| --- | --- | --- |
| `G00` / `G01` | Rapid positioning / linear feed | Motion |
| `G02` / `G03` | Clockwise / counterclockwise arc | Motion |
| `G17`-`G19` | Plane select (XY / XZ / YZ) | Setup |
| `G20` / `G21` | Inch / millimeter units | Setup |
| `G90` / `G91` | Absolute / incremental positioning | Setup |
| `G54`-`G59` | Work coordinate offsets | Setup |
| `G40`-`G43` | Cutter and tool length compensation | Compensation |
| `G28` | Return to reference (home) | Reference |

## Reference and compensation codes

- **G28**: return to the machine reference (home) position.
- **G40 / G41 / G42**: cutter compensation off, left, and right.
- **G43**: tool length compensation.

## How to learn them

A list like this is a reference, and reading a reference builds recognition, not recall. To actually memorize these, drill them as code-to-meaning and meaning-to-code questions, and put extra reps on the confusable pairs. That is the core of the [practice-first method for beginner CNC code](/journal/beginner-cnc-code-practice/). Many beginners get the modal behavior wrong too, so it is worth reading about [modal versus non-modal G-codes](/journal/modal-vs-non-modal-g-codes/) once these names are familiar.

Then do the same for the machine functions in [common M-codes for CNC beginners](/journal/common-m-codes-for-cnc-beginners/).

## Bottom line

Start with the motion codes, the units and positioning modes, work offsets, and compensation. That dozen covers most beginner programs. Memorize them by recall, not re-reading.

## Sources

- [LinuxCNC G-code quick reference](https://linuxcnc.org/docs/html/gcode/g-code.html)
- [Wikipedia: G-code](https://en.wikipedia.org/wiki/G-code)
- [ISO 6983-1 (numerical control of machines)](https://www.iso.org/standard/34608.html)
- [CNCCookbook: G-code and M-code cheat sheet](https://www.cnccookbook.com/g-code-m-code-cnc-list-cheat-sheet/)

## Frequently asked questions

### How many G-codes do I need to learn as a beginner?
Around a dozen will carry you through most beginner programs. The motion codes (`G00` to `G03`), the units and positioning modes, work offsets, and the compensation codes cover the vast majority of what you will read.

### Are G-codes the same on Haas and Fanuc?
The most common G-codes behave the same across Haas, Fanuc, and most controls because they follow a shared standard. Always confirm the details against your specific machine's manual, since some codes and options vary.

### What is the fastest way to memorize the common G-codes?
Active recall, not re-reading a chart. A free tool like G-Code Sprint turns the core G-codes into timed code-to-meaning and meaning-to-code drills and repeats the ones you miss, which locks them in faster than a printed cheat sheet.

*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/common-g-codes-for-cnc-beginners/
Author: Lawrence Arya — https://www.linkedin.com/in/vibecoding/
