File Formats
  • Audio
  • Video
  • Images
  • 3D & CAD
  • Documents
  • Data
  • Code
  • System
3D & CAD
  • Meshes
  • Scenes
  • Modelling projects
  • CAD
  • 3D printing
  • Point clouds
  • Game models
  1. Home
  2. 3D & CAD
  3. 3D printing
  4. G-code
.GCODE
  • Overview

.GCODE

G-code for 3D printers

Introduction

G-code is the language of numerically controlled machines, standardised as RS-274 and used by CNC mills and lathes for decades. 3D printers use their own dialects of it. A slicer turns a model into a G-code file made for one printer: every move of the print head, every change of temperature and every length of filament to push.

Because the file is made for a particular printer, nozzle and material, it is the last step before printing and is rarely shared between different machines.

Software

  • PrusaSlicer (Windows, macOS, Linux)
  • UltiMaker Cura (Windows, macOS, Linux)
  • Bambu Studio (Windows, macOS, Linux)
  • OrcaSlicer (Windows, macOS, Linux)
  • OctoPrint (printer host, runs on Linux and others)
  • Klipper (printer firmware)
  • Marlin (printer firmware)

Structure

A G-code file is plain text, one command per line. Each line starts with a command letter and number, followed by parameters, each a letter and a value. A semicolon starts a comment, which slicers use for settings, layer markers and print time estimates.

CommandMeaning
G0, G1Move to the given X, Y, Z, pushing E of filament, at feed rate F
G28Move to the home position
G90, G91Absolute or relative positions
M82, M83Absolute or relative extrusion
M104, M109Set the nozzle temperature, without or with waiting
M140, M190Set the bed temperature, without or with waiting
; layer 1
M140 S60        ; bed to 60 °C
M109 S210       ; nozzle to 210 °C and wait
G28             ; home all axes
G90             ; absolute positions
M82             ; absolute extrusion
G1 Z0.2 F3000
G1 X50 Y50 E2.5 F1500
The start of a print: heat up, home, then the first extruding move.
© 2026 fileformats.org About Contact Made by Lewpen