G-code
G-code (Geometric Code) is the standardized computer numerical control (CNC) programming language used to command 3D printer hardware. It tells stepper motors where to move (X, Y, Z coordinates), how fast to travel (F feedrate), and how much plastic to extrude (E axis).
G-code contains the exact time and filament estimates the printer will execute. Slicer-reported grams and hours from G-code are the raw inputs behind every accurate quote.
Estimate it in the 3D printing cost calculator →Common G-code Commands in 3D Printing
Standard commands include G0 / G1 (coordinated linear travel and extrusion), G28 (home all axes), M104 / M109 (set and wait for hotend temperature), M140 / M190 (set and wait for bed temperature), and M106 / M107 (part cooling fan control).
Generating G-code from 3D Files
3D models in STL or 3MF format cannot be read directly by printers. A slicer slices the model into horizontal layers and generates thousands of sequential G-code lines optimized for specific printer kinematics.
Parsing Print Metadata from G-code
Modern slicers embed comment headers at the top of G-code files detailing exact filament consumption (grams and meters), total layer count, and print time predictions in seconds, which quoting calculators read directly.
Cite This Page
Use these formats to cite this page in research, reports, and documentation. Both snippets are copy-ready.
APA 7
TryAR Labs. (2026, August 25). G-code. MakerWorld Estimator. https://estimator.tryar.in/glossary/gcode
BibTeX
@misc{tryarlabs2026gcode,
title = {{G-code}},
author = {{TryAR Labs}},
year = {2026},
month = {aug},
url = {https://estimator.tryar.in/glossary/gcode},
note = {MakerWorld Estimator}
}
Calculate 3D Print Costs in Real Time
Estimate exact filament gram rates, machine hours, and profit margins for any MakerWorld design or 3MF/STL upload.
Calculate Now