G-code
G-code is machine instruction code for 3D printers, CNC mills, laser cutters, and other computer-controlled fabrication machines.
What is G-code?
G-code is a machine instruction language that tells computer-controlled fabrication equipment how to move, extrude, cut, heat, and operate. In 3D printing, G-code is usually generated by a slicer from a mesh model and contains layer-by-layer toolpath commands for the printer.
How it works
A G-code file is a plain-text list of commands such as movement coordinates, feed rates, temperatures, fan speeds, and extrusion amounts. Different machines and firmware interpret common commands similarly, but many dialects add machine-specific commands and settings. G-code matters because it is the final manufacturing instruction set that turns a digital 3D model into physical motion. Artists usually do not write all G-code by hand, but they may inspect or edit it to tune print starts, pauses, material changes, or machine behavior.
Use cases
Exporting a 3D model to a slicer that generates printer-ready G-code.
Checking toolpaths before a 3D print to verify supports, layers, and travel moves.
Adding custom start, end, pause, or filament-change commands for fabrication.
Related Tools
3D File Compressor
Shrink 3D file size without losing visible quality.
Online 3D Viewer
View and inspect any 3D file right in your browser.
3D Text Generator
Turn text descriptions into 3D text and shapes.
Related Blog Articles

3D Printing Guide: Essential Tips for Beginners in 2024

3D Print File Types: What Every Designer Should Know

How to Fix Non-Manifold Edges in STL Files for 3D Printing

The Ultimate Guide to Mesh Topology for High-Performance 3D Models
Frequently Asked Questions
G-code tells a 3D printer where to move, how fast to move, when to extrude material, and what temperatures or fans to use during a print.
G-code is not a 3D model format. It is a machine instruction format generated from a model by slicer or CAM software.
Yes. Most G-code files are plain text, so they can be opened and inspected in a text editor.
No. Many printers share common G-code commands, but firmware such as Marlin, RepRapFirmware, Klipper, and proprietary systems can support different command sets.
Slicer software such as PrusaSlicer, Cura, Bambu Studio, and OrcaSlicer generates G-code from 3D models and print settings.
G-code files commonly use .gcode, but some machines and workflows use extensions such as .gc, .nc, or .tap.
Yes. Incorrect G-code can cause crashes, overheating, extrusion problems, or unsafe motion, so edits should be tested carefully.
STL stores a triangle mesh that describes surface geometry, while G-code stores machine commands that control fabrication movement and process settings.
Yes. G-code is widely used for CNC milling, CNC routing, lathes, laser cutters, plotters, and other computer-controlled manufacturing machines.
Explore More Features

3D Agent
Chat from an idea, photo, or sketch to a print-ready 3D model

Image to 3D
Turn any photo into a detailed 3D model in seconds

Text to 3D
Describe it, generate it - 3D models from text prompts

AI Texturing
Add realistic PBR textures to any 3D model with AI

AI Image Generator
Generate multi-view images optimized for 3D creation

Animation
Auto-rig and animate any 3D character in seconds
Still have questions about G-code?
Ask the Meshy 3D Agent anything about 3D — its built-in knowledge base answers your questions and turns them into models, right in the chat.