---
title: "Why Is My CNC Moving in Inches Instead of MM? Fix It"
description: "A CNC moving in inches when you expect millimeters is running G20: left active by a previous job, a power-on default, or a program that never states units."
url: https://gcodepractice.com/journal/why-is-my-cnc-moving-in-inches-instead-of-mm/
canonical: https://gcodepractice.com/journal/why-is-my-cnc-moving-in-inches-instead-of-mm/
author: "Lawrence Arya"
authorUrl: https://www.linkedin.com/in/vibecoding/
published: 2026-06-04
updated: 2026-06-04
category: "Practice"
tags: ["units", "g20", "g21", "troubleshooting"]
lang: en
---

# Why Is My CNC Moving in Inches Instead of MM? Fix It

> **TL;DR** A CNC moving in inches instead of millimeters has G20 active where you expected G21, and the cause is one of four: the program never states its units so the machine kept whatever was active before, a previous job or MDI session left inch mode on, the control's power-on default is set to inch, or the CAM post output the program in G20. Check the active-codes page first, then make every program state G21 in its safety block.

A machine that lurches 25 times farther than commanded is not malfunctioning; it is obeying. `G20`, inch mode, is active, your millimeter numbers are being read as inches, and the only real question is which of four doors let inch mode in. Check them in order and this never costs you more than a minute again.

## Which door let G20 in?

| Door | What happened | The tell |
| --- | --- | --- |
| Program states no units | Machine kept whatever was active before | No `G21` anywhere in the file |
| Leftover modal state | A previous job or MDI session ran `G20` | Problem appears after someone else's job |
| Power-on default | The control wakes up in inch | Problem appears after every restart |
| CAM post in inch | The program itself is `G20` | `G20` printed right there in the file |

The modal mechanics behind doors one and two are the heart of it: units are modal, so whatever was set last simply stays, as the [LinuxCNC units reference](https://linuxcnc.org/docs/html/gcode/g-code.html) and the standard [G20/G21 guides](https://www.helmancnc.com/g20-g21-g-code-for-units-inch-metric/) describe. A program silent about units inherits a stranger's choice.

## How do you confirm it in ten seconds?

Open the control's active G-codes page, the status screen listing current modal state, and read the units group: it says `G20` or `G21` outright. This display is the single most underused diagnostic on the machine; it answers mode questions, units, plane, positioning, instantly, where guessing from behavior answers them expensively. Make it the first stop whenever motion size looks wrong, the same reflex that catches the related scale trap of a [missing decimal point](/journal/missing-decimal-point-in-g-code-crash/).

## What is the permanent fix?

Defense in two layers, because each covers the other's gap. At the machine, set the power-on default parameter to metric so every restart wakes in `G21`; this kills door three. In every program, state `G21` in the safety block, `G21 G17 G40 G90`, which kills doors one and two on any machine you ever run, including machines whose parameters belong to someone else. Door four is a CAM settings check: open the post output and look at the units line before the first run, part of reading any new program the way [a program should be read](/journal/how-to-read-a-cnc-program-for-beginners/).

A concrete version: a shop's Monday-morning mystery, the first metric job after a weekend always overtraveling, traced to a Friday-night MDI habit of testing in inches. The power-on default was metric, but the machine had not been restarted, so door two stood open all weekend. One `G21` added to the program template ended a recurring incident nobody had connected.

## Why does this keep happening to careful people?

Because modal state is invisible and memory is retrieval-based. Units feel too basic to check, so nobody actively recalls them until motion goes wrong, the same recognition-without-retrieval trap behind [forgetting which M-code turns off the coolant](/journal/i-keep-forgetting-which-m-code-turns-off-the-coolant/). The full conceptual background, what `G20` and `G21` each do and why the mismatch scales by 25.4, lives in [G20 vs G21 inch vs metric](/journal/g20-vs-g21-inch-vs-metric/); this page is the symptom-first version for the moment it bites.

## Bottom line

Inch moves on a metric job mean `G20` is active, let in by a silent program, leftover modal state, an inch power-on default, or an inch CAM post. Read the active-codes page to confirm in seconds, set the default to metric, and state `G21` in every safety block so no machine's history can surprise you. Making that units reflex automatic is what a recall routine on the [G-code practice hub](/g-code-practice/) is for.

## Sources

- [LinuxCNC G-code reference (G20/G21 units)](https://linuxcnc.org/docs/html/gcode/g-code.html)
- [HelmanCNC: G20 G21 units inch and metric](https://www.helmancnc.com/g20-g21-g-code-for-units-inch-metric/)
- [Wikipedia: G-code](https://en.wikipedia.org/wiki/G-code)

## Frequently asked questions

### Why is my CNC moving in inches instead of mm?
`G20` is active where you expected `G21`: the program states no units, a previous job or MDI left inch mode on, the power-on default is inch, or the CAM post output `G20`. The active-codes display confirms it instantly.

### How do I check whether G20 or G21 is active?
Open the control's active G-codes status page and read the units group. It shows the mode directly, in seconds.

### How do I make my CNC always start in mm?
Set the power-on default parameter to metric, and state `G21` in every program's safety block anyway, so any machine's leftover state is overridden.

### What is the best way to learn the units codes so this stops happening?
Drill `G20` and `G21` with the modal setup codes until stating units is reflex. 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/why-is-my-cnc-moving-in-inches-instead-of-mm/
Author: Lawrence Arya — https://www.linkedin.com/in/vibecoding/
