LinuxCNC G21 Units: millimeters

G21 is a G-code command that selects millimeters as the length unit for a program. It is used in the preamble so subsequent length values are interpreted in millimeters.

Source checked3/3 values · 2026-10-26

Specification

1 source
Languagegcode
CodeG21
GroupUnits
SyntaxG21
DialectLinuxCNC

Study notes

  • G20 selects inches; G21 selects millimeters.
  • The document recommends including units in the preamble of each G-code file.
  • When G21 is in effect, G96 constant surface speed uses meters per minute.
↑↓ navigate↵ openesc close