.GCODE

GCODE File

G-code File
Ask a question
QUICK ANSWER

A .gcode file holds machine instructions -- coordinates, speeds, temperatures, and tool commands -- produced by slicer software for a 3D printer or CNC machine. Open it in Ultimaker Cura, PrusaSlicer, or OrcaSlicer to preview layers, or in any text editor to read the raw commands. The file is printer-specific: a file sliced for one machine may fail or cause damage on another.

Developer: ISO/EIA standard (RS-274D / ISO 6983-1); dialect extensions by Marlin, RepRap, Klipper, Fanuc, Haas, etc. Category: Developer Files Open standard MIME: text/x.gcode
OPENS ON Windows macOS Linux
Related: .DO · .MD · .HEX · .XSD

On this page

19k+ extensions indexed
Last reviewed Aug 10, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the GCODE file format?

.gcode is a plain-text file that stores machine instructions for 3D printers and CNC equipment, written in G-code - the dominant numerical control language for motion and machine control. G-code gets its name because many of its core commands begin with the letter "G" (e.g., G0 for rapid move, G28 to home all axes).

G-CODE - how does it work?

.gcode files are generated by slicer software from 3D model files such as .stl or .3mf. Each project is separated into layers; the slicer converts each layer into a sequence of commands defining printing speed, temperature, and the movements of every printer axis. A single print layer is described by a series of commands covering X/Y/Z motion and extruder feed (E-axis).

The format is line-oriented: commands carry numeric parameters (G1 X10.5 Y3.2 F3000) with semicolons marking comments. .gcode files should not be edited by users unfamiliar with the language.

G-code is not one unified standard but a family of dialects - Marlin, Klipper, and Smoothieware each add proprietary M-commands. A file sliced for one printer should always be re-sliced rather than sent directly to a different machine.

Security & safety

RISK: LOW

G-code files contain no executable code for a PC OS; they cannot run on Windows/macOS/Linux directly. However, a malformed or malicious .gcode file sent to a 3D printer or CNC machine could command dangerous movements, disable thermal runaway protection (M999 misuse), or cause hardware damage. Only run G-code from trusted sources on your printer. Verify thermal safety settings are active in firmware (Marlin THERMAL_RUNAWAY protection).

Format details

in a nutshell
FULL NAMEG-code Fileaka G-Code Source, RepRap G-code
DEVELOPERISO/EIA standard (RS-274D / ISO 6983-1); dialect extensions by Marlin, RepRap, Klipper, Fanuc, Haas, etc.since 1960s (RS-274 standard); .gcode extension popularized by RepRap project ~2007
MIME TYPEtext/x.gcode
TYPEplain text (ASCII)
STANDARDOpen · royalty-free
This extension is also used by…
  • CNC milling/turning G-code - The original use case (RS-274/ISO 6983): controls mills, lathes, routers - same syntax family but incompatible dialect with 3D printer G-code.

Programs that open GCODE files

Windows5 apps
Sublime Text Freemium Open the file to read/edit raw G-code commands; syntax highlighting via G-code package.
Ultimaker Cura Open-source File → Open File → select .gcode; Cura shows a preview of toolpaths layer by layer.
PrusaSlicer Open-source Drag the .gcode into PrusaSlicer window to preview layers and estimated time.
OrcaSlicer Open-source File → Open → .gcode; provides layer-by-layer visualization and print time.
Notepad++ (with G-code plugin) Open-source Open .gcode as plain text; install G-code UDL for syntax highlighting.
macOS2 apps
Ultimaker Cura Open-source File → Open File → .gcode for layer preview.
PrusaSlicer Open-source Drag .gcode onto PrusaSlicer window to preview toolpaths.
Linux2 apps
Ultimaker Cura Open-source File → Open File → .gcode for layer preview and metadata.
OrcaSlicer Open-source Available as AppImage; File → Open → .gcode.

Technical details

deep spec
EncodingPlain ASCII text (7-bit); UTF-8 used for comment fields in some slicers
File structureLine-oriented: one command per line; numeric parameters (X/Y/Z/E/F values); semicolons mark comments
Command typesG-words (motion), M-words (machine control), T-words (tool selection)
Optional line checksumN<line_number> … *<checksum_byte> syntax (Marlin/RepRap); most slicer-generated files omit it
Typical file size10 KB - 200 MB (simple object to complex multi-hour print)
File signatureNone - plain text; files typically open with a slicer comment (; Generated by ...) or a command such as G28
Dialect incompatibilityMarlin, Klipper, Smoothieware, Fanuc, and Haas dialects are NOT cross-compatible; always re-slice for the target machine
FDM-specific commandsM104/M109 (hotend temperature), M140/M190 (bed temperature), E-axis (extruder feed) - absent from CNC mill G-code
Standard originRS-274D / ISO 6983-1 (1960s CNC standard); .gcode extension popularised by RepRap project circa 2007
Bambu Lab variant.gcode.3mf container (ZIP archive with embedded G-code and slicer metadata)
MIME typetext/x.gcode (also text/plain)
Related extensions.nc, .gco, .ngc, .tap - same language family, different naming conventions across CNC vendors
Released1960s (RS-274 standard); .gcode extension popularized by RepRap project ~2007
Latest versionISO 6983-1:2009 (CNC); RepRap/Marlin dialects evolve continuously
Open standardYes · royalty-free
Specificationreprap.org

GCODE conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with GCODE files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about GCODE files.

Frequently asked questions

What program opens a .gcode file?
Any text editor (Notepad, VS Code) reads it as plain text. For a visual layer-by-layer preview, use Ultimaker Cura, PrusaSlicer, or OrcaSlicer - all free.
Can I edit a .gcode file?
Yes - it's plain text. Edit temperatures, speeds, or individual commands carefully. Large changes are better done by re-slicing the original 3D model with new slicer settings.
Can I convert .gcode back to STL?
No. G-code is toolpath instructions, not a shape description. The original 3D model (STL) is needed to produce new G-code.
Is a .gcode file for one 3D printer compatible with another?
Usually no - G-code dialects differ between firmware (Marlin, Klipper, Bambu) and printer geometries. Always re-slice in your slicer with your printer's profile selected.
How do I send a .gcode file to my printer?
Copy it to a microSD/SD card and insert into the printer, or use USB/Wi-Fi with your slicer's 'Send to Printer' feature (Cura, PrusaSlicer, OrcaSlicer all support this).
Why is my .gcode file so large?
Complex models with many layers, fine layer heights, or support structures generate millions of movement lines. 50-200 MB files are normal for detailed multi-hour prints.

References

1ISO 6983-1:2009 (CNC standard)www.iso.org
2RepRap G-code referencereprap.org

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.MDMarkdown Document
3.CRDOWNLOADChrome Partial Download File
4.BINCD/DVD Disc Image (BIN/CUE)
5.PARTPartial Download File
6.RPMSGRestricted Permission Message
7.NOMEDIAAndroid No-Media Marker File
8.EXEWindows Executable (Portable Executable)
9.AVIFAV1 Image File Format (AVIF)
10.ICSiCalendar data file

Related extensions

.DOStata Do-File
.MDMarkdown Document
.HEXIntel HEX File
.XSDXML Schema Definition
.MAPSource Map (JavaScript / CSS)
.CONFIGConfiguration File

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z