Skip to content

G-code: the language the machine actually runs

A slicer or CAM program ends its work by writing G-code: moves, speeds, temperatures and spindle or laser commands, line by line. The file describes how one machine should make a part, not what the part is.

What the standard defines

A family of commands for numerically controlled machines: movement in straight lines and arcs, feed rates, and machine functions. The international standard sets the general form of such programs. Hobby 3D printers, routers and lasers use firmware dialects built on that form, adding commands for heaters, fans, extrusion, lasers and calibration.

What it does not promise

No portability between machines: a file sliced for one printer carries its build volume, temperatures and start routines. No common dialect: firmware families differ in the commands they accept. No description of the part: G-code cannot be turned back into a clean model. No safety: a machine runs whatever commands it receives, which is why firmware protections and the maker’s instructions matter.

What it works with

Slicers for printers, CAM software for routers and laser software, all of which produce it. Firmware on the machine, which interprets it. STL and 3MF files, from which printer G-code is generated.

Questions makers ask before buying

Can a G-code file be shared with someone who has a different printer?

It is rarely useful. Temperatures, dimensions, start routines and firmware commands differ between machines; sharing the model file lets the other person slice for their own printer.

Do laser engravers use G-code?

Many hobby laser controllers accept G-code, generated by laser software from vector or image files. The laser maker states which controller and software it uses.

Last reviewed 15 September 2026