Skip to main content
Mythos

G-code is a plain-text machine-control language — the sequence of movement, temperature, and extrusion commands a slicer generates from a 3D model to drive a printer's motors and components layer by layer.

G-code (standardized as RS-274) is the widely used numerical-control programming language that instructs computerized machine tools, including CNC mills and 3D printers, how to move and operate. Each line is a command: "G" commands govern geometric motion such as linear moves and arcs, while "M" commands manage auxiliary machine functions like heating the nozzle, running fans, and homing axes. Parameters on each line specify coordinates, feed rate (speed), and, on printers, how much filament to extrude.

In 📝3D printing, G-code is generally not written by hand but produced by a slicer — software that divides a 3D model, usually supplied as an STL file, into thin horizontal layers and translates each into a toolpath. The resulting file can contain many thousands of sequential instructions that the printer's firmware reads and executes one by one to reproduce the model. Because G-code encodes the machine's actual behavior, it also fixes settings such as layer height, print temperature, and speed at the moment of slicing.

Although a broad standard exists, dialects vary between machines and firmware such as Marlin, RepRap, and Klipper, so a G-code file generated for one printer is not always directly portable to another. This coupling to a specific machine is why the platform-neutral model file is kept separate from the machine-specific G-code output.

Contexts

Created with 💜 by One Inc | Copyright 2026