GLOSSARY

G-code

G-code is the plain-text instruction language a 3D printer or CNC machine executes. Each line tells the toolhead where to go and what to do.

Definition

G-code (formally RS-274) was created in the 1950s for CNC machine tools. A G-code file is a long list of commands like G1 X100 Y50 E2.5 F1500 (move to X=100, Y=50, extrude 2.5mm of filament, at 1500 mm/min). The printer's firmware reads these one at a time and drives the motors and heaters accordingly.

For 3D printing, G-code is the output of your slicer. You hand the slicer an STL plus settings; it computes every move the toolhead needs to make and writes the result to a .gcode file (or a firmware-flavored binary like .bgcode or .3mf with embedded G-code).

Why it matters

G-code is the layer where things actually go wrong. A clean STL can still produce stringy, layer-shifted, or under-extruded prints if the slicer settings are wrong. Reading G-code (or visualizing it in the slicer's preview) is how you debug print issues before committing to a six-hour print.

Different printers expect different G-code dialects. Marlin, Klipper, RepRapFirmware, and Bambu's firmware all share a common core but differ in macros, temperature commands, and extensions. Slicer profiles encode these differences.

Common confusion

A G-code file is printer-specific. Slicing a model for an Ender 3 will not work on a Bambu X1 — the bed size, nozzle, and start macros differ. Always slice fresh for the target printer.

G-code does not describe a 3D shape. It describes a path. You cannot convert G-code back into a watertight STL — you would only get a spaghetti of toolpaths.

SEE ALSO