Understanding a G-code file (.gcode, .nc) and how to manage it
By the PandaFile team · · 4 min read
STL, DXF, a sliced project… and at the end of the chain, the G-code. It's what actually drives the machine, but it's also the most misunderstood file and the riskiest to reuse. This article complements the maker's file formats overview.
What is G-code?
G-code (extensions .gcode, .nc, .tap, and so on) is a list of machine instructions: movements, speeds, temperatures, turning the tool or laser on. It's produced by a slicer or CAM software from a 3D model or a drawing.
Why it isn't reusable everywhere
G-code is specific to a machine and a setup: printer, nozzle, profile, or a specific mill and tool. Using it on another configuration gives you a bad result at best, a machine crash at worst. That's why it's better to archive the source model (STL, 3MF) or the drawing (DXF) rather than the G-code alone.
How to manage it safely
If you keep G-code files (for parts you reprint often), tag them clearly with their machine and profile, and keep the link to the source file. A library like PandaFile helps you connect source, project, and G-code without mixing them up — see managing versions in 3D printing and organizing your CNC files.
Frequently asked questions
What is a G-code file?
It's a list of machine instructions (movements, speeds, temperatures, activating the tool or laser), produced by a slicer or CAM software from a 3D model or a drawing.
Can you reuse G-code on another machine?
No: it's sliced for a specific machine and setup. On a different configuration, you have to start over from the source model (STL, 3MF) or the drawing (DXF).
Should you archive the G-code or the source file?
Better the source file, which stays reusable. Only keep G-code for parts you reprint often on the same machine, tagging it with its configuration.
Topics