{"id":"gcode-g21","model_id":"G21","name":"LinuxCNC G21 Units: millimeters","summary":"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.","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."],"safety_notes":[],"sources":[{"url":"https://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g20-g21","title":"G-Codes","accessed":"2026-10-26"}],"verification":{"status":"source_checked","checked_at":"2026-10-26","values":3,"method":"llm_source_check"},"updated_at":"2026-10-26","type":"instruction","spec":{"language":"gcode","code":"G21","group":"Units","syntax":"G21","parameters":[],"dialect":"LinuxCNC","related":[],"standards":[]},"url":"https://machineschema.com/instruction/gcode-g21","license":"https://creativecommons.org/licenses/by/4.0/"}